From lattner at cs.uiuc.edu Mon Aug 28 12:31:09 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Aug 2006 12:31:09 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/WriteBytecodePass.h
Message-ID: <200608281731.k7SHV96e024978@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Bytecode:
WriteBytecodePass.h updated: 1.15 -> 1.16
---
Log message:
remove extraneous space
---
Diffs of the changes: (+1 -1)
WriteBytecodePass.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/include/llvm/Bytecode/WriteBytecodePass.h
diff -u llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.15 llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.16
--- llvm/include/llvm/Bytecode/WriteBytecodePass.h:1.15 Thu Apr 21 15:34:13 2005
+++ llvm/include/llvm/Bytecode/WriteBytecodePass.h Mon Aug 28 12:30:49 2006
@@ -36,7 +36,7 @@
}
bool runOnModule(Module &M) {
- WriteBytecodeToFile(&M, *Out, CompressFile );
+ WriteBytecodeToFile(&M, *Out, CompressFile);
return false;
}
};
From lattner at cs.uiuc.edu Mon Aug 28 12:32:09 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Aug 2006 12:32:09 -0500
Subject: [llvm-commits] CVS: llvm/tools/opt/opt.cpp
Message-ID: <200608281732.k7SHW9e4025040@zion.cs.uiuc.edu>
Changes in directory llvm/tools/opt:
opt.cpp updated: 1.117 -> 1.118
---
Log message:
Add a --disable-compression option like llvm-link/llvm-as etc have
---
Diffs of the changes: (+3 -1)
opt.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.117 llvm/tools/opt/opt.cpp:1.118
--- llvm/tools/opt/opt.cpp:1.117 Sun Aug 27 17:40:26 2006
+++ llvm/tools/opt/opt.cpp Mon Aug 28 12:31:55 2006
@@ -38,6 +38,8 @@
static cl::list
PassList(cl::desc("Optimizations available:"));
+static cl::opt NoCompress("disable-compression", cl::init(false),
+ cl::desc("Don't compress the generated bytecode"));
// Other command line options...
//
@@ -250,7 +252,7 @@
// Write bytecode out to disk or cout as the last step...
if (!NoOutput && !AnalyzeOnly)
- Passes.add(new WriteBytecodePass(Out, Out != &std::cout));
+ Passes.add(new WriteBytecodePass(Out, Out != &std::cout, !NoCompress));
// Now that we have all of the passes ready, run them.
Passes.run(*M.get());
From reid at x10sys.com Mon Aug 28 14:17:13 2006
From: reid at x10sys.com (Reid Spencer)
Date: Mon, 28 Aug 2006 14:17:13 -0500
Subject: [llvm-commits] CVS: llvm-test/Makefile.programs
Message-ID: <200608281917.k7SJHDuG026816@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.programs updated: 1.220 -> 1.221
---
Log message:
Don't try to link with crtend if the llvm-gcc version is 4. This just
eliminates gccld warning messages about not being able to find the crtend
library if it hasn't been built.
---
Diffs of the changes: (+12 -6)
Makefile.programs | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.220 llvm-test/Makefile.programs:1.221
--- llvm-test/Makefile.programs:1.220 Tue Jun 27 15:37:01 2006
+++ llvm-test/Makefile.programs Mon Aug 28 14:16:59 2006
@@ -46,6 +46,12 @@
.PRECIOUS: Output/%.cbe Output/%.cbe.c Output/%.llvm.bc
.PRECIOUS: Output/%.linked.bc
+# If we're using the llvm-gcc3 compiler then we need to also link with the
+# llvm c runtime library, othwerwise we don't
+ifneq ($(LLVMGCC_MAJVERS),4)
+LIBS += -lcrtend
+endif
+
PROGDIR = $(PROJ_SRC_ROOT)
#
@@ -224,7 +230,7 @@
$(PROGRAMS_TO_TEST:%=Output/%.llvm.bc): \
Output/%.llvm.bc: Output/%.linked.bc $(LGCCLDPROG)
- -$(LGCCLD) $(STATS) $< $(EXTRA_LINKTIME_OPT_FLAGS) -lc $(LIBS) -lcrtend -o Output/$*.llvm
+ -$(LGCCLD) $(STATS) $< $(EXTRA_LINKTIME_OPT_FLAGS) -lc $(LIBS) -o Output/$*.llvm
ifneq ($(OPTPASSES),)
-$(LOPT) -q $(OPTPASSES) < $@ > $@.tmp
$(MV) -f $@.tmp $@
@@ -232,7 +238,7 @@
$(PROGRAMS_TO_TEST:%=Output/%.llvm): \
Output/%.llvm: Output/%.linked.bc $(LGCCLDPROG)
- -$(LGCCLD) $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.llvm
+ -$(LGCCLD) $(STATS) $< -lc $(LIBS) -o Output/$*.llvm
ifneq ($(OPTPASSES),)
-$(LOPT) -q $(OPTPASSES) < $@ > $@.tmp
$(MV) -f $@.tmp $@
@@ -240,20 +246,20 @@
$(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm.bc): \
Output/%.noopt-llvm.bc: Output/%.linked.rbc $(LGCCLDPROG)
- -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.noopt-llvm
+ -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.noopt-llvm
$(PROGRAMS_TO_TEST:%=Output/%.noopt-llvm): \
Output/%.noopt-llvm: Output/%.linked.rbc $(LGCCLDPROG)
- -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.noopt-llvm
+ -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.noopt-llvm
$(PROGRAMS_TO_TEST:%=Output/%.nogccldopt-llvm.bc): \
Output/%.nogccldopt-llvm.bc: Output/%.linked.bc $(LGCCLDPROG)
- -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.nogccldopt-llvm
+ -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.nogccldopt-llvm
$(PROGRAMS_TO_TEST:%=Output/%.nogccldopt-llvm): \
Output/%.nogccldopt-llvm: Output/%.linked.rbc $(LGCCLDPROG)
- -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -lcrtend -o Output/$*.nogccldopt-llvm
+ -$(LGCCLD) -disable-opt $(STATS) $< -lc $(LIBS) -o Output/$*.nogccldopt-llvm
endif # ifndef DISABLE_FOR_LLVM_PROGRAMS
From evan.cheng at apple.com Mon Aug 28 15:10:31 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 28 Aug 2006 15:10:31 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Message-ID: <200608282010.k7SKAVwW027794@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.98 -> 1.99
---
Log message:
Add an optional pass to preprocess the DAG before x86 isel to allow selecting more load/mod/store instructions.
---
Diffs of the changes: (+130 -0)
X86ISelDAGToDAG.cpp | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 130 insertions(+)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.98 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.99
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.98 Sun Aug 27 07:54:01 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Mon Aug 28 15:10:17 2006
@@ -39,6 +39,10 @@
#include
using namespace llvm;
+#include "llvm/Support/CommandLine.h"
+static cl::opt X86ISelPreproc("enable-x86-isel-preprocessing", cl::Hidden,
+ cl::desc("Enable isel preprocessing on X86"));
+
//===----------------------------------------------------------------------===//
// Pattern Matcher Implementation
//===----------------------------------------------------------------------===//
@@ -133,6 +137,7 @@
bool TryFoldLoad(SDOperand P, SDOperand N,
SDOperand &Base, SDOperand &Scale,
SDOperand &Index, SDOperand &Disp);
+ void InstructionSelectPreprocess(SelectionDAG &DAG);
/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
/// inline asm expressions.
@@ -232,12 +237,137 @@
return !isNonImmUse(U, N);
}
+/// MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand
+/// and move load below the TokenFactor. Replace store's chain operand with
+/// load's chain result.
+static void MoveBelowTokenFactor(SelectionDAG &DAG, SDOperand Load,
+ SDOperand Store, SDOperand TF) {
+ std::vector Ops;
+ for (unsigned i = 0, e = TF.Val->getNumOperands(); i != e; ++i)
+ if (Load.Val == TF.Val->getOperand(i).Val)
+ Ops.push_back(Load.Val->getOperand(0));
+ else
+ Ops.push_back(TF.Val->getOperand(i));
+ DAG.UpdateNodeOperands(TF, &Ops[0], Ops.size());
+ DAG.UpdateNodeOperands(Load, TF, Load.getOperand(1), Load.getOperand(2));
+ DAG.UpdateNodeOperands(Store, Load.getValue(1), Store.getOperand(1),
+ Store.getOperand(2), Store.getOperand(3));
+}
+
+/// InstructionSelectPreprocess - Preprocess the DAG to allow the instruction
+/// selector to pick more load-modify-store instructions. This is a common
+/// case:
+///
+/// [Load chain]
+/// ^
+/// |
+/// [Load]
+/// ^ ^
+/// | |
+/// / \-
+/// / |
+/// [TokenFactor] [Op]
+/// ^ ^
+/// | |
+/// \ /
+/// \ /
+/// [Store]
+///
+/// The fact the store's chain operand != load's chain will prevent the
+/// (store (op (load))) instruction from being selected. We can transform it to:
+///
+/// [Load chain]
+/// ^
+/// |
+/// [TokenFactor]
+/// ^
+/// |
+/// [Load]
+/// ^ ^
+/// | |
+/// | \-
+/// | |
+/// | [Op]
+/// | ^
+/// | |
+/// \ /
+/// \ /
+/// [Store]
+void X86DAGToDAGISel::InstructionSelectPreprocess(SelectionDAG &DAG) {
+ for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
+ E = DAG.allnodes_end(); I != E; ++I) {
+ if (I->getOpcode() != ISD::STORE)
+ continue;
+ SDOperand Chain = I->getOperand(0);
+ if (Chain.Val->getOpcode() != ISD::TokenFactor)
+ continue;
+
+ SDOperand N1 = I->getOperand(1);
+ SDOperand N2 = I->getOperand(2);
+ if (!N1.hasOneUse())
+ continue;
+
+ bool RModW = false;
+ SDOperand Load;
+ unsigned Opcode = N1.Val->getOpcode();
+ switch (Opcode) {
+ case ISD::ADD:
+ case ISD::MUL:
+ case ISD::FADD:
+ case ISD::FMUL:
+ case ISD::AND:
+ case ISD::OR:
+ case ISD::XOR:
+ case ISD::ADDC:
+ case ISD::ADDE: {
+ SDOperand N10 = N1.getOperand(0);
+ SDOperand N11 = N1.getOperand(1);
+ if (N10.Val->getOpcode() == ISD::LOAD)
+ RModW = true;
+ else if (N11.Val->getOpcode() == ISD::LOAD) {
+ RModW = true;
+ std::swap(N10, N11);
+ }
+ RModW = RModW && N10.Val->isOperand(Chain.Val) && N10.hasOneUse() &&
+ N10.getOperand(1) == N2;
+ if (RModW)
+ Load = N10;
+ break;
+ }
+ case ISD::SUB:
+ case ISD::SHL:
+ case ISD::SRA:
+ case ISD::SRL:
+ case ISD::ROTL:
+ case ISD::ROTR:
+ case ISD::SUBC:
+ case ISD::SUBE:
+ case X86ISD::SHLD:
+ case X86ISD::SHRD: {
+ SDOperand N10 = N1.getOperand(0);
+ if (N10.Val->getOpcode() == ISD::LOAD)
+ RModW = N10.Val->isOperand(Chain.Val) && N10.hasOneUse() &&
+ N10.getOperand(1) == N2;
+ if (RModW)
+ Load = N10;
+ break;
+ }
+ }
+
+ if (RModW)
+ MoveBelowTokenFactor(DAG, Load, SDOperand(I, 0), Chain);
+ }
+}
+
/// InstructionSelectBasicBlock - This callback is invoked by SelectionDAGISel
/// when it has created a SelectionDAG for us to codegen.
void X86DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) {
DEBUG(BB->dump());
MachineFunction::iterator FirstMBB = BB;
+ if (X86ISelPreproc)
+ InstructionSelectPreprocess(DAG);
+
// Codegen the basic block.
#ifndef NDEBUG
DEBUG(std::cerr << "===== Instruction selection begins:\n");
From evan.cheng at apple.com Mon Aug 28 15:12:53 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 28 Aug 2006 15:12:53 -0500
Subject: [llvm-commits] CVS: llvm-test/Makefile.programs
Message-ID: <200608282012.k7SKCreH027859@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.programs updated: 1.221 -> 1.222
---
Log message:
Set x86 llcbeta to -enable-x86-isel-preprocessing.
---
Diffs of the changes: (+1 -1)
Makefile.programs | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.221 llvm-test/Makefile.programs:1.222
--- llvm-test/Makefile.programs:1.221 Mon Aug 28 14:16:59 2006
+++ llvm-test/Makefile.programs Mon Aug 28 15:12:39 2006
@@ -203,7 +203,7 @@
LLCBETAOPTION := -sched=simple
endif
ifeq ($(ARCH),x86)
-LLCBETAOPTION := -enable-x86-fastcc
+LLCBETAOPTION := -enable-x86-isel-preprocessing
endif
ifeq ($(ARCH),Sparc)
LLCBETAOPTION := -enable-sparc-v9-insts
From lattner at cs.uiuc.edu Mon Aug 28 16:52:23 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Aug 2006 16:52:23 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/SmallVector.h
Message-ID: <200608282152.k7SLqNfi029406@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/ADT:
SmallVector.h updated: 1.16 -> 1.17
---
Log message:
Add 2nd form of resize
---
Diffs of the changes: (+12 -0)
SmallVector.h | 12 ++++++++++++
1 files changed, 12 insertions(+)
Index: llvm/include/llvm/ADT/SmallVector.h
diff -u llvm/include/llvm/ADT/SmallVector.h:1.16 llvm/include/llvm/ADT/SmallVector.h:1.17
--- llvm/include/llvm/ADT/SmallVector.h:1.16 Tue Aug 22 12:28:57 2006
+++ llvm/include/llvm/ADT/SmallVector.h Mon Aug 28 16:52:08 2006
@@ -124,6 +124,18 @@
}
}
+ void resize(unsigned N, const T &NV) {
+ if (N < size()) {
+ destroy_range(Begin+N, End);
+ End = Begin+N;
+ } else if (N > size()) {
+ if (Begin+N > Capacity)
+ grow(N);
+ construct_range(End, Begin+N, NV);
+ End = Begin+N;
+ }
+ }
+
void swap(SmallVectorImpl &RHS);
/// append - Add the specified range to the end of the SmallVector.
From evan.cheng at apple.com Mon Aug 28 17:14:31 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Mon, 28 Aug 2006 17:14:31 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
Message-ID: <200608282214.k7SMEVoq029802@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.56 -> 1.57
---
Log message:
On Mac, print jump table entries after the function to work around a linker issue.
---
Diffs of the changes: (+6 -3)
X86ATTAsmPrinter.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.56 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.57
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.56 Wed Jul 26 21:05:13 2006
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Mon Aug 28 17:14:16 2006
@@ -38,9 +38,6 @@
// Print out constants referenced by the function
EmitConstantPool(MF.getConstantPool());
- // Print out jump tables referenced by the function
- EmitJumpTableInfo(MF.getJumpTableInfo());
-
// Print out labels for the function.
const Function *F = MF.getFunction();
switch (F->getLinkage()) {
@@ -98,6 +95,12 @@
printMachineInstruction(II);
}
}
+
+ // Print out jump tables referenced by the function
+ // Mac OS X requires at least one non-local (e.g. L1) labels before local
+ // lables that are used in jump table expressions (e.g. LBB1_1-LJT1_0).
+ EmitJumpTableInfo(MF.getJumpTableInfo());
+
if (HasDotTypeDotSizeDirective)
O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
From llvm at cs.uiuc.edu Mon Aug 28 17:32:19 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Mon, 28 Aug 2006 17:32:19 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/Transforms/PredicateSimplifier/
Message-ID: <200608282232.k7SMWJ1i030112@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/PredicateSimplifier:
---
Log message:
Directory /var/cvs/llvm/llvm/test/Regression/Transforms/PredicateSimplifier added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From nicholas at mxc.ca Mon Aug 28 17:45:14 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 28 Aug 2006 17:45:14 -0500
Subject: [llvm-commits] CVS: llvm/CREDITS.TXT
Message-ID: <200608282245.k7SMjEKJ030343@zion.cs.uiuc.edu>
Changes in directory llvm:
CREDITS.TXT updated: 1.64 -> 1.65
---
Log message:
Add PredicateSimplifier pass. Collapses equal variables into one form
and simplifies expressions. This implements the optimization described
in PR807: http://llvm.org/PR807 .
---
Diffs of the changes: (+4 -0)
CREDITS.TXT | 4 ++++
1 files changed, 4 insertions(+)
Index: llvm/CREDITS.TXT
diff -u llvm/CREDITS.TXT:1.64 llvm/CREDITS.TXT:1.65
--- llvm/CREDITS.TXT:1.64 Wed Aug 16 16:18:56 2006
+++ llvm/CREDITS.TXT Mon Aug 28 17:44:55 2006
@@ -176,3 +176,7 @@
E: isanbard at gmail.com
W: http://web.mac.com/bwendling/
D: The `Lower Setjmp/Longjmp' pass, improvements to the -lowerswitch pass.
+
+N: Nick Lewycky
+E: nicholas at mxc.ca
+D: PredicateSimplifier pass
From nicholas at mxc.ca Mon Aug 28 17:45:17 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 28 Aug 2006 17:45:17 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/Transforms/Scalar.h
Message-ID: <200608282245.k7SMjHO7030354@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Transforms:
Scalar.h updated: 1.66 -> 1.67
---
Log message:
Add PredicateSimplifier pass. Collapses equal variables into one form
and simplifies expressions. This implements the optimization described
in PR807: http://llvm.org/PR807 .
---
Diffs of the changes: (+5 -0)
Scalar.h | 5 +++++
1 files changed, 5 insertions(+)
Index: llvm/include/llvm/Transforms/Scalar.h
diff -u llvm/include/llvm/Transforms/Scalar.h:1.66 llvm/include/llvm/Transforms/Scalar.h:1.67
--- llvm/include/llvm/Transforms/Scalar.h:1.66 Thu Jun 8 15:02:53 2006
+++ llvm/include/llvm/Transforms/Scalar.h Mon Aug 28 17:44:55 2006
@@ -308,6 +308,11 @@
FunctionPass *createLCSSAPass();
extern const PassInfo *LCSSAID;
+//===----------------------------------------------------------------------===//
+// This pass collapses duplicate variables into one canonical form,
+// and tries to simplify expressions along the way.
+FunctionPass *createPredicateSimplifierPass();
+
} // End llvm namespace
#endif
From nicholas at mxc.ca Mon Aug 28 17:45:17 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 28 Aug 2006 17:45:17 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.ll
predsimplify.reg1.ll predsimplify.reg2.ll predsimplify.reg3.ll
Message-ID: <200608282245.k7SMjHSG030365@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/PredicateSimplifier:
predsimplify.ll added (r1.1)
predsimplify.reg1.ll added (r1.1)
predsimplify.reg2.ll added (r1.1)
predsimplify.reg3.ll added (r1.1)
---
Log message:
Add PredicateSimplifier pass. Collapses equal variables into one form
and simplifies expressions. This implements the optimization described
in PR807: http://llvm.org/PR807 .
---
Diffs of the changes: (+223 -0)
predsimplify.ll | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++
predsimplify.reg1.ll | 23 +++++++++
predsimplify.reg2.ll | 49 +++++++++++++++++++
predsimplify.reg3.ll | 21 ++++++++
4 files changed, 223 insertions(+)
Index: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.ll
diff -c /dev/null llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.ll:1.1
*** /dev/null Mon Aug 28 17:45:06 2006
--- llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.ll Mon Aug 28 17:44:55 2006
***************
*** 0 ****
--- 1,130 ----
+ ; RUN: llvm-as < %s | opt -predsimplify -instcombine -simplifycfg | llvm-dis | grep -v declare | not grep fail
+
+ void %test1(int %x) {
+ entry:
+ %A = seteq int %x, 0
+ br bool %A, label %then.1, label %else.1
+ then.1:
+ %B = seteq int %x, 1
+ br bool %B, label %then.2, label %else.1
+ then.2:
+ call void (...)* %fail( )
+ ret void
+ else.1:
+ ret void
+ }
+
+ void %test2(int %x) {
+ entry:
+ %A = seteq int %x, 0
+ %B = seteq int %x, 1
+ br bool %A, label %then.1, label %else.1
+ then.1:
+ br bool %B, label %then.2, label %else.1
+ then.2:
+ call void (...)* %fail( )
+ ret void
+ else.1:
+ ret void
+ }
+
+ void %test3(int %x) {
+ entry:
+ %A = seteq int %x, 0
+ %B = seteq int %x, 1
+ br bool %A, label %then.1, label %else.1
+ then.1:
+ br bool %B, label %then.2, label %else.1
+ then.2:
+ call void (...)* %fail( )
+ ret void
+ else.1:
+ ret void
+ }
+
+ void %test4(int %x, int %y) {
+ entry:
+ %A = seteq int %x, 0
+ %B = seteq int %y, 0
+ %C = and bool %A, %B
+ br bool %C, label %then.1, label %else.1
+ then.1:
+ %D = seteq int %x, 0
+ br bool %D, label %then.2, label %else.2
+ then.2:
+ %E = seteq int %y, 0
+ br bool %E, label %else.1, label %else.2
+ else.1:
+ ret void
+ else.2:
+ call void (...)* %fail( )
+ ret void
+ }
+
+ void %test5(int %x) {
+ entry:
+ %A = seteq int %x, 0
+ br bool %A, label %then.1, label %else.1
+ then.1:
+ ret void
+ then.2:
+ call void (...)* %fail( )
+ ret void
+ else.1:
+ %B = seteq int %x, 0
+ br bool %B, label %then.2, label %then.1
+ }
+
+ void %test6(int %x, int %y) {
+ entry:
+ %A = seteq int %x, 0
+ %B = seteq int %y, 0
+ %C = or bool %A, %B
+ br bool %C, label %then.1, label %else.1
+ then.1:
+ ret void
+ then.2:
+ call void (...)* %fail( )
+ ret void
+ else.1:
+ %D = seteq int %x, 0
+ br bool %D, label %then.2, label %else.2
+ else.2:
+ %E = setne int %y, 0
+ br bool %E, label %then.1, label %then.2
+ }
+
+ void %test7(int %x) {
+ entry:
+ %A = setne int %x, 0
+ %B = xor bool %A, true
+ br bool %B, label %then.1, label %else.1
+ then.1:
+ %C = seteq int %x, 1
+ br bool %C, label %then.2, label %else.1
+ then.2:
+ call void (...)* %fail( )
+ ret void
+ else.1:
+ ret void
+ }
+
+ void %test8(int %x) {
+ entry:
+ %A = add int %x, 1
+ %B = seteq int %x, 0
+ br bool %B, label %then.1, label %then.2
+ then.1:
+ %C = seteq int %A, 1
+ br bool %C, label %then.2, label %else.2
+ then.2:
+ ret void
+ else.2:
+ call void (...)* %fail( )
+ ret void
+ }
+
+
+ declare void %fail(...)
+
+ declare void %pass(...)
Index: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg1.ll
diff -c /dev/null llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg1.ll:1.1
*** /dev/null Mon Aug 28 17:45:17 2006
--- llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg1.ll Mon Aug 28 17:44:55 2006
***************
*** 0 ****
--- 1,23 ----
+ ; RUN: llvm-as < %s | opt -predsimplify -verify
+
+ void %dgefa() {
+ entry:
+ br label %cond_true96
+
+ cond_true: ; preds = %cond_true96
+ %tmp19 = seteq int %tmp10, %k.0 ; [#uses=1]
+ br bool %tmp19, label %cond_next, label %cond_true20
+
+ cond_true20: ; preds = %cond_true
+ br label %cond_next
+
+ cond_next: ; preds = %cond_true20, %cond_true
+ %tmp84 = setgt int %tmp3, 1999 ; [#uses=0]
+ ret void
+
+ cond_true96: ; preds = %cond_true96, %entry
+ %k.0 = phi int [ 0, %entry ], [ 0, %cond_true96 ] ; [#uses=3]
+ %tmp3 = add int %k.0, 1 ; [#uses=1]
+ %tmp10 = add int 0, %k.0 ; [#uses=1]
+ br bool false, label %cond_true96, label %cond_true
+ }
Index: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg2.ll
diff -c /dev/null llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg2.ll:1.1
*** /dev/null Mon Aug 28 17:45:17 2006
--- llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg2.ll Mon Aug 28 17:44:55 2006
***************
*** 0 ****
--- 1,49 ----
+ ; RUN: llvm-as < %s | opt -predsimplify -verify
+
+ ; ModuleID = 'bugpoint-reduced-simplified.bc'
+ target endian = little
+ target pointersize = 32
+ target triple = "i686-pc-linux-gnu"
+ deplibs = [ "c", "crtend" ]
+ %struct.anon = type { %struct.set_family*, %struct.set_family*, %struct.set_family*, sbyte*, int, uint*, %struct.pair_struct*, sbyte**, %struct.symbolic_t*, %struct.symbolic_t* }
+ %struct.pair_struct = type { int, int*, int* }
+ %struct.set_family = type { int, int, int, int, int, uint*, %struct.set_family* }
+ %struct.symbolic_label_t = type { sbyte*, %struct.symbolic_label_t* }
+ %struct.symbolic_list_t = type { int, int, %struct.symbolic_list_t* }
+ %struct.symbolic_t = type { %struct.symbolic_list_t*, int, %struct.symbolic_label_t*, int, %struct.symbolic_t* }
+
+ implementation ; Functions:
+
+ void %find_pairing_cost(int %strategy) {
+ entry:
+ br bool false, label %cond_true299, label %bb314
+
+ bb94: ; preds = %cond_true299
+ switch int %strategy, label %bb246 [
+ int 0, label %bb196
+ int 1, label %bb159
+ ]
+
+ cond_next113: ; preds = %cond_true299
+ switch int %strategy, label %bb246 [
+ int 0, label %bb196
+ int 1, label %bb159
+ ]
+
+ bb159: ; preds = %cond_next113, %bb94
+ ret void
+
+ bb196: ; preds = %cond_next113, %bb94
+ %Rsave.0.3 = phi %struct.set_family* [ null, %bb94 ], [ null, %cond_next113 ] ; <%struct.set_family*> [#uses=0]
+ ret void
+
+ bb246: ; preds = %cond_next113, %bb94
+ br label %bb314
+
+ cond_true299: ; preds = %entry
+ %tmp55 = setgt int %strategy, 0 ; [#uses=1]
+ br bool %tmp55, label %bb94, label %cond_next113
+
+ bb314: ; preds = %bb246, %entry
+ ret void
+ }
Index: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg3.ll
diff -c /dev/null llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg3.ll:1.1
*** /dev/null Mon Aug 28 17:45:17 2006
--- llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg3.ll Mon Aug 28 17:44:55 2006
***************
*** 0 ****
--- 1,21 ----
+ ; RUN: llvm-as < %s | opt -predsimplify -simplifycfg | llvm-dis | grep pass
+
+ void %regtest(int %x) {
+ entry:
+ %A = seteq int %x, 0
+ br bool %A, label %middle, label %after
+ middle:
+ br label %after
+ after:
+ %B = seteq int %x, 0
+ br bool %B, label %then, label %else
+ then:
+ br label %end
+ else:
+ call void (...)* %pass( )
+ br label %end
+ end:
+ ret void
+ }
+
+ declare void %pass(...)
From nicholas at mxc.ca Mon Aug 28 17:45:15 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 28 Aug 2006 17:45:15 -0500
Subject: [llvm-commits]
CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Message-ID: <200608282245.k7SMjFxD030348@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
PredicateSimplifier.cpp added (r1.1)
---
Log message:
Add PredicateSimplifier pass. Collapses equal variables into one form
and simplifies expressions. This implements the optimization described
in PR807: http://llvm.org/PR807 .
---
Diffs of the changes: (+744 -0)
PredicateSimplifier.cpp | 744 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 744 insertions(+)
Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -c /dev/null llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.1
*** /dev/null Mon Aug 28 17:45:05 2006
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Mon Aug 28 17:44:55 2006
***************
*** 0 ****
--- 1,744 ----
+ //===-- PredicateSimplifier.cpp - Path Sensitive Simplifier -----------===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Nick Lewycky and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ //===------------------------------------------------------------------===//
+ //
+ // Path-sensitive optimizer. In a branch where x == y, replace uses of
+ // x with y. Permits further optimization, such as the elimination of
+ // the unreachable call:
+ //
+ // void test(int *p, int *q)
+ // {
+ // if (p != q)
+ // return;
+ //
+ // if (*p != *q)
+ // foo(); // unreachable
+ // }
+ //
+ //===------------------------------------------------------------------===//
+ //
+ // This optimization works by substituting %q for %p when protected by a
+ // conditional that assures us of that fact. Equivalent variables are
+ // called SynSets; sets of synonyms. We maintain a mapping from Value *
+ // to the SynSet, and the SynSet maintains the best canonical form of the
+ // Value.
+ //
+ // Properties are stored as relationships between two SynSets.
+ //
+ //===------------------------------------------------------------------===//
+
+ // TODO:
+ // * Handle SelectInst
+ // * Switch to EquivalenceClasses ADT
+ // * Check handling of NAN in floating point types
+ // * Don't descend into false side of branches with ConstantBool condition.
+
+ #define DEBUG_TYPE "predsimplify"
+ #include "llvm/Transforms/Scalar.h"
+ #include "llvm/Constants.h"
+ #include "llvm/Instructions.h"
+ #include "llvm/Pass.h"
+ #include "llvm/ADT/Statistic.h"
+ #include "llvm/ADT/STLExtras.h"
+ #include "llvm/Analysis/Dominators.h"
+ #include "llvm/Support/CFG.h"
+ #include "llvm/Support/Debug.h"
+ #include
+ using namespace llvm;
+
+ namespace {
+ Statistic<>
+ NumVarsReplaced("predsimplify", "Number of argument substitutions");
+ Statistic<>
+ NumResolved("predsimplify", "Number of instruction substitutions");
+ Statistic<>
+ NumSwitchCases("predsimplify", "Number of switch cases removed");
+
+ /// Used for choosing the canonical Value in a synonym set.
+ /// Leaves the better one in V1. Returns whether a swap took place.
+ static void order(Value *&V1, Value *&V2) {
+ if (isa(V2)) {
+ if (!isa(V1)) {
+ std::swap(V1, V2);
+ return;
+ }
+ } else if (isa(V2)) {
+ if (!isa(V1) && !isa(V1)) {
+ std::swap(V1, V2);
+ return;
+ }
+ }
+ if (User *U1 = dyn_cast(V1)) {
+ for (User::const_op_iterator I = U1->op_begin(), E = U1->op_end();
+ I != E; ++I) {
+ if (*I == V2) {
+ std::swap(V1, V2);
+ return;
+ }
+ }
+ }
+ return;
+ }
+
+ /// Represents the set of equivalent Value*s and provides insertion
+ /// and fast lookup. Also stores the set of inequality relationships.
+ class PropertySet {
+ struct Property;
+ public:
+ typedef unsigned SynSet;
+ typedef std::map::iterator SynonymIterator;
+ typedef std::map::const_iterator ConstSynonymIterator;
+ typedef std::vector::iterator PropertyIterator;
+ typedef std::vector::const_iterator ConstPropertyIterator;
+
+ enum Ops {
+ EQ,
+ NE
+ };
+
+ Value *canonicalize(Value *V) const {
+ Value *C = lookup(V);
+ return C ? C : V;
+ }
+
+ Value *lookup(Value *V) const {
+ ConstSynonymIterator SI = SynonymMap.find(V);
+ if (SI == SynonymMap.end()) return NULL;
+
+ return Synonyms[SI->second];
+ }
+
+ Value *lookup(SynSet SS) const {
+ assert(SS < Synonyms.size());
+ return Synonyms[SS];
+ }
+
+ // Find a SynSet for a given Value.
+ //
+ // Given the Value *V sets SS to a valid SynSet. Returns true if it
+ // found it.
+ bool findSynSet(Value *V, SynSet &SS) const {
+ ConstSynonymIterator SI = SynonymMap.find(V);
+ if (SI != SynonymMap.end()) {
+ SS = SI->second;
+ return true;
+ }
+
+ std::vector::const_iterator I =
+ std::find(Synonyms.begin(), Synonyms.end(), V);
+ if (I != Synonyms.end()) {
+ SS = I-Synonyms.begin();
+ return true;
+ }
+
+ return false;
+ }
+
+ bool empty() const {
+ return Synonyms.empty();
+ }
+
+ void addEqual(Value *V1, Value *V2) {
+ order(V1, V2);
+ if (isa(V2)) return; // refuse to set false == true.
+
+ V1 = canonicalize(V1);
+ V2 = canonicalize(V2);
+
+ if (V1 == V2) return; // already equivalent.
+
+ SynSet I1, I2;
+ bool F1 = findSynSet(V1, I1),
+ F2 = findSynSet(V2, I2);
+
+ DEBUG(std::cerr << "V1: " << *V1 << " I1: " << I1
+ << " F1: " << F1 << "\n");
+ DEBUG(std::cerr << "V2: " << *V2 << " I2: " << I2
+ << " F2: " << F2 << "\n");
+
+ if (!F1 && !F2) {
+ SynSet SS = addSynSet(V1);
+ SynonymMap[V1] = SS;
+ SynonymMap[V2] = SS;
+ }
+
+ else if (!F1 && F2) {
+ SynonymMap[V1] = I2;
+ }
+
+ else if (F1 && !F2) {
+ SynonymMap[V2] = I1;
+ }
+
+ else {
+ // This is the case where we have two sets, [%a1, %a2, %a3] and
+ // [%p1, %p2, %p3] and someone says that %a2 == %p3. We need to
+ // combine the two synsets.
+
+ // Collapse synonyms of V2 into V1.
+ for (SynonymIterator I = SynonymMap.begin(), E = SynonymMap.end();
+ I != E; ++I) {
+ if (I->second == I2) I->second = I1;
+ else if (I->second > I2) --I->second;
+ }
+
+ // Move Properties
+ for (PropertyIterator I = Properties.begin(), E = Properties.end();
+ I != E; ++I) {
+ if (I->S1 == I2) I->S1 = I1;
+ else if (I->S1 > I2) --I->S1;
+ if (I->S2 == I2) I->S2 = I1;
+ else if (I->S2 > I2) --I->S2;
+ }
+
+ // Remove the synonym
+ Synonyms.erase(Synonyms.begin() + I2);
+ }
+
+ addImpliedProperties(EQ, V1, V2);
+ }
+
+ void addNotEqual(Value *V1, Value *V2) {
+ DEBUG(std::cerr << "not equal: " << *V1 << " and " << *V2 << "\n");
+ bool skip_search = false;
+ V1 = canonicalize(V1);
+ V2 = canonicalize(V2);
+
+ SynSet S1, S2;
+ if (!findSynSet(V1, S1)) {
+ skip_search = true;
+ S1 = addSynSet(V1);
+ }
+ if (!findSynSet(V2, S2)) {
+ skip_search = true;
+ S2 = addSynSet(V2);
+ }
+
+ if (!skip_search) {
+ // Does the property already exist?
+ for (PropertyIterator I = Properties.begin(), E = Properties.end();
+ I != E; ++I) {
+ if (I->Opcode != NE) continue;
+
+ if ((I->S1 == S1 && I->S2 == S2) ||
+ (I->S1 == S2 && I->S2 == S1)) {
+ return; // Found.
+ }
+ }
+ }
+
+ // Add the property.
+ Properties.push_back(Property(NE, S1, S2));
+ addImpliedProperties(NE, V1, V2);
+ }
+
+ PropertyIterator findProperty(Ops Opcode, Value *V1, Value *V2) {
+ assert(Opcode != EQ && "Can't findProperty on EQ."
+ "Use the lookup method instead.");
+
+ SynSet S1, S2;
+ if (!findSynSet(V1, S1)) return Properties.end();
+ if (!findSynSet(V2, S2)) return Properties.end();
+
+ // Does the property already exist?
+ for (PropertyIterator I = Properties.begin(), E = Properties.end();
+ I != E; ++I) {
+ if (I->Opcode != Opcode) continue;
+
+ if ((I->S1 == S1 && I->S2 == S2) ||
+ (I->S1 == S2 && I->S2 == S1)) {
+ return I; // Found.
+ }
+ }
+ return Properties.end();
+ }
+
+ ConstPropertyIterator
+ findProperty(Ops Opcode, Value *V1, Value *V2) const {
+ assert(Opcode != EQ && "Can't findProperty on EQ."
+ "Use the lookup method instead.");
+
+ SynSet S1, S2;
+ if (!findSynSet(V1, S1)) return Properties.end();
+ if (!findSynSet(V2, S2)) return Properties.end();
+
+ // Does the property already exist?
+ for (ConstPropertyIterator I = Properties.begin(),
+ E = Properties.end(); I != E; ++I) {
+ if (I->Opcode != Opcode) continue;
+
+ if ((I->S1 == S1 && I->S2 == S2) ||
+ (I->S1 == S2 && I->S2 == S1)) {
+ return I; // Found.
+ }
+ }
+ return Properties.end();
+ }
+
+ private:
+ // Represents Head OP [Tail1, Tail2, ...]
+ // For example: %x != %a, %x != %b.
+ struct Property {
+ Property(Ops opcode, SynSet s1, SynSet s2)
+ : Opcode(opcode), S1(s1), S2(s2)
+ { assert(opcode != EQ && "Equality belongs in the synonym set,"
+ "not a property."); }
+
+ bool operator<(const Property &rhs) const {
+ if (Opcode != rhs.Opcode) return Opcode < rhs.Opcode;
+ if (S1 != rhs.S1) return S1 < rhs.S1;
+ return S2 < rhs.S2;
+ }
+
+ Ops Opcode;
+ SynSet S1, S2;
+ };
+
+ SynSet addSynSet(Value *V) {
+ Synonyms.push_back(V);
+ return Synonyms.size()-1;
+ }
+
+ void add(Ops Opcode, Value *V1, Value *V2, bool invert) {
+ switch (Opcode) {
+ case EQ:
+ if (invert) addNotEqual(V1, V2);
+ else addEqual(V1, V2);
+ break;
+ case NE:
+ if (invert) addEqual(V1, V2);
+ else addNotEqual(V1, V2);
+ break;
+ default:
+ assert(0 && "Unknown property opcode.");
+ }
+ }
+
+ // Finds the properties implied by a synonym and adds them too.
+ // Example: ("seteq %a, %b", true, EQ) --> (%a, %b, EQ)
+ // ("seteq %a, %b", false, EQ) --> (%a, %b, NE)
+ void addImpliedProperties(Ops Opcode, Value *V1, Value *V2) {
+ order(V1, V2);
+
+ if (BinaryOperator *BO = dyn_cast(V2)) {
+ switch (BO->getOpcode()) {
+ case Instruction::SetEQ:
+ if (V1 == ConstantBool::True)
+ add(Opcode, BO->getOperand(0), BO->getOperand(1), false);
+ if (V1 == ConstantBool::False)
+ add(Opcode, BO->getOperand(0), BO->getOperand(1), true);
+ break;
+ case Instruction::SetNE:
+ if (V1 == ConstantBool::True)
+ add(Opcode, BO->getOperand(0), BO->getOperand(1), true);
+ if (V1 == ConstantBool::False)
+ add(Opcode, BO->getOperand(0), BO->getOperand(1), false);
+ break;
+ case Instruction::SetLT:
+ case Instruction::SetGT:
+ if (V1 == ConstantBool::True)
+ add(Opcode, BO->getOperand(0), BO->getOperand(1), true);
+ break;
+ case Instruction::SetLE:
+ case Instruction::SetGE:
+ if (V1 == ConstantBool::False)
+ add(Opcode, BO->getOperand(0), BO->getOperand(1), true);
+ break;
+ case Instruction::And:
+ if (V1 == ConstantBool::True) {
+ add(Opcode, ConstantBool::True, BO->getOperand(0), false);
+ add(Opcode, ConstantBool::True, BO->getOperand(1), false);
+ }
+ break;
+ case Instruction::Or:
+ if (V1 == ConstantBool::False) {
+ add(Opcode, ConstantBool::False, BO->getOperand(0), false);
+ add(Opcode, ConstantBool::False, BO->getOperand(1), false);
+ }
+ break;
+ case Instruction::Xor:
+ if (V1 == ConstantBool::True) {
+ if (BO->getOperand(0) == ConstantBool::True)
+ add(Opcode, ConstantBool::False, BO->getOperand(1), false);
+ if (BO->getOperand(1) == ConstantBool::True)
+ add(Opcode, ConstantBool::False, BO->getOperand(0), false);
+ }
+ if (V1 == ConstantBool::False) {
+ if (BO->getOperand(0) == ConstantBool::True)
+ add(Opcode, ConstantBool::True, BO->getOperand(1), false);
+ if (BO->getOperand(1) == ConstantBool::True)
+ add(Opcode, ConstantBool::True, BO->getOperand(0), false);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+
+ std::map SynonymMap;
+ std::vector Synonyms;
+
+ public:
+ void debug(std::ostream &os) const {
+ os << Synonyms.size() << " synsets:\n";
+ for (unsigned I = 0, E = Synonyms.size(); I != E; ++I) {
+ os << I << ". " << *Synonyms[I] << "\n";
+ }
+ for (ConstSynonymIterator I = SynonymMap.begin(),E = SynonymMap.end();
+ I != E; ++I) {
+ os << *I->first << "-> #" << I->second << "\n";
+ }
+ os << Properties.size() << " properties:\n";
+ for (unsigned I = 0, E = Properties.size(); I != E; ++I) {
+ os << I << ". (" << Properties[I].Opcode << ","
+ << Properties[I].S1 << "," << Properties[I].S2 << ")\n";
+ }
+ }
+
+ std::vector Properties;
+ };
+
+ /// PredicateSimplifier - This class is a simplifier that replaces
+ /// one equivalent variable with another. It also tracks what
+ /// can't be equal and will solve setcc instructions when possible.
+ class PredicateSimplifier : public FunctionPass {
+ public:
+ bool runOnFunction(Function &F);
+ virtual void getAnalysisUsage(AnalysisUsage &AU) const;
+
+ private:
+ // Try to replace the Use of the instruction with something simpler.
+ Value *resolve(SetCondInst *SCI, const PropertySet &);
+ Value *resolve(BinaryOperator *BO, const PropertySet &);
+ Value *resolve(Value *V, const PropertySet &);
+
+ // Used by terminator instructions to proceed from the current basic
+ // block to the next. Verifies that "current" dominates "next",
+ // then calls visitBasicBlock.
+ void proceedToSuccessor(PropertySet &CurrentPS, PropertySet &NextPS,
+ DominatorTree::Node *Current, DominatorTree::Node *Next);
+ void proceedToSuccessor(PropertySet &CurrentPS,
+ DominatorTree::Node *Current, DominatorTree::Node *Next);
+
+ // Visits each instruction in the basic block.
+ void visitBasicBlock(DominatorTree::Node *DTNode,
+ PropertySet &KnownProperties);
+
+ // For each instruction, add the properties to KnownProperties.
+ void visit(Instruction *I, DominatorTree::Node *, PropertySet &);
+ void visit(TerminatorInst *TI, DominatorTree::Node *, PropertySet &);
+ void visit(BranchInst *BI, DominatorTree::Node *, PropertySet &);
+ void visit(SwitchInst *SI, DominatorTree::Node *, PropertySet);
+ void visit(LoadInst *LI, DominatorTree::Node *, PropertySet &);
+ void visit(StoreInst *SI, DominatorTree::Node *, PropertySet &);
+ void visit(BinaryOperator *BO, DominatorTree::Node *, PropertySet &);
+
+ DominatorTree *DT;
+ bool modified;
+ };
+
+ RegisterPass X("predsimplify",
+ "Predicate Simplifier");
+ }
+
+ FunctionPass *llvm::createPredicateSimplifierPass() {
+ return new PredicateSimplifier();
+ }
+
+ bool PredicateSimplifier::runOnFunction(Function &F) {
+ DT = &getAnalysis();
+
+ modified = false;
+ PropertySet KnownProperties;
+ visitBasicBlock(DT->getRootNode(), KnownProperties);
+ return modified;
+ }
+
+ void PredicateSimplifier::getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.addRequired();
+ }
+
+ // resolve catches cases addProperty won't because it wasn't used as a
+ // condition in the branch, and that visit won't, because the instruction
+ // was defined outside of the range that the properties apply to.
+ Value *PredicateSimplifier::resolve(SetCondInst *SCI,
+ const PropertySet &KP) {
+ // Attempt to resolve the SetCondInst to a boolean.
+
+ Value *SCI0 = SCI->getOperand(0),
+ *SCI1 = SCI->getOperand(1);
+ PropertySet::ConstPropertyIterator NE =
+ KP.findProperty(PropertySet::NE, SCI0, SCI1);
+
+ if (NE != KP.Properties.end()) {
+ switch (SCI->getOpcode()) {
+ case Instruction::SetEQ:
+ return ConstantBool::False;
+ case Instruction::SetNE:
+ return ConstantBool::True;
+ case Instruction::SetLE:
+ case Instruction::SetGE:
+ case Instruction::SetLT:
+ case Instruction::SetGT:
+ break;
+ default:
+ assert(0 && "Unknown opcode in SetCondInst.");
+ break;
+ }
+ }
+
+ SCI0 = KP.canonicalize(SCI0);
+ SCI1 = KP.canonicalize(SCI1);
+
+ ConstantIntegral *CI1 = dyn_cast(SCI0),
+ *CI2 = dyn_cast(SCI1);
+
+ if (!CI1 || !CI2) return SCI;
+
+ switch(SCI->getOpcode()) {
+ case Instruction::SetLE:
+ case Instruction::SetGE:
+ case Instruction::SetEQ:
+ if (CI1->getRawValue() == CI2->getRawValue())
+ return ConstantBool::True;
+ else
+ return ConstantBool::False;
+ case Instruction::SetLT:
+ case Instruction::SetGT:
+ case Instruction::SetNE:
+ if (CI1->getRawValue() == CI2->getRawValue())
+ return ConstantBool::False;
+ else
+ return ConstantBool::True;
+ default:
+ assert(0 && "Unknown opcode in SetContInst.");
+ break;
+ }
+ }
+
+ Value *PredicateSimplifier::resolve(BinaryOperator *BO,
+ const PropertySet &KP) {
+ if (SetCondInst *SCI = dyn_cast(BO))
+ return resolve(SCI, KP);
+
+ DEBUG(std::cerr << "BO->getOperand(1) = " << *BO->getOperand(1) << "\n");
+
+ Value *lhs = resolve(BO->getOperand(0), KP),
+ *rhs = resolve(BO->getOperand(1), KP);
+ ConstantIntegral *CI1 = dyn_cast(lhs);
+ ConstantIntegral *CI2 = dyn_cast(rhs);
+
+ DEBUG(std::cerr << "resolveBO: lhs = " << *lhs
+ << ", rhs = " << *rhs << "\n");
+ if (CI1) DEBUG(std::cerr << "CI1 = " << *CI1);
+ if (CI2) DEBUG(std::cerr << "CI2 = " << *CI2);
+
+ if (!CI1 || !CI2) return BO;
+
+ Value *V = ConstantExpr::get(BO->getOpcode(), CI1, CI2);
+ if (V) return V;
+ return BO;
+ }
+
+ Value *PredicateSimplifier::resolve(Value *V, const PropertySet &KP) {
+ if (isa(V) || isa(V) || KP.empty()) return V;
+
+ V = KP.canonicalize(V);
+
+ if (BinaryOperator *BO = dyn_cast(V))
+ return resolve(BO, KP);
+
+ return V;
+ }
+
+ void PredicateSimplifier::visitBasicBlock(DominatorTree::Node *DTNode,
+ PropertySet &KnownProperties) {
+ BasicBlock *BB = DTNode->getBlock();
+ for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
+ visit(I, DTNode, KnownProperties);
+ }
+ }
+
+ void PredicateSimplifier::visit(Instruction *I, DominatorTree::Node *DTNode,
+ PropertySet &KnownProperties) {
+ DEBUG(std::cerr << "Considering instruction " << *I << "\n");
+ DEBUG(KnownProperties.debug(std::cerr));
+
+ // Substitute values known to be equal.
+ for (unsigned i = 0, E = I->getNumOperands(); i != E; ++i) {
+ Value *Oper = I->getOperand(i);
+ Value *V = resolve(Oper, KnownProperties);
+ assert(V && "resolve not supposed to return NULL.");
+ if (V != Oper) {
+ modified = true;
+ ++NumVarsReplaced;
+ DEBUG(std::cerr << "resolving " << *I);
+ I->setOperand(i, V);
+ DEBUG(std::cerr << "into " << *I);
+ }
+ }
+
+ Value *V = resolve(I, KnownProperties);
+ assert(V && "resolve not supposed to return NULL.");
+ if (V != I) {
+ modified = true;
+ ++NumResolved;
+ I->replaceAllUsesWith(V);
+ I->eraseFromParent();
+ }
+
+ if (TerminatorInst *TI = dyn_cast(I))
+ visit(TI, DTNode, KnownProperties);
+ else if (LoadInst *LI = dyn_cast(I))
+ visit(LI, DTNode, KnownProperties);
+ else if (StoreInst *SI = dyn_cast(I))
+ visit(SI, DTNode, KnownProperties);
+ else if (BinaryOperator *BO = dyn_cast(I))
+ visit(BO, DTNode, KnownProperties);
+ }
+
+ void PredicateSimplifier::proceedToSuccessor(PropertySet &CurrentPS,
+ PropertySet &NextPS, DominatorTree::Node *Current,
+ DominatorTree::Node *Next) {
+ if (Next->getBlock()->getSinglePredecessor() == Current->getBlock())
+ proceedToSuccessor(NextPS, Current, Next);
+ else
+ proceedToSuccessor(CurrentPS, Current, Next);
+ }
+
+ void PredicateSimplifier::proceedToSuccessor(PropertySet &KP,
+ DominatorTree::Node *Current, DominatorTree::Node *Next) {
+ if (Current->properlyDominates(Next))
+ visitBasicBlock(Next, KP);
+ }
+
+ void PredicateSimplifier::visit(TerminatorInst *TI,
+ DominatorTree::Node *Node, PropertySet &KP){
+ if (BranchInst *BI = dyn_cast(TI)) {
+ visit(BI, Node, KP);
+ return;
+ }
+ if (SwitchInst *SI = dyn_cast(TI)) {
+ visit(SI, Node, KP);
+ return;
+ }
+
+ for (unsigned i = 0, E = TI->getNumSuccessors(); i != E; ++i) {
+ BasicBlock *BB = TI->getSuccessor(i);
+ PropertySet KPcopy(KP);
+ proceedToSuccessor(KPcopy, Node, DT->getNode(TI->getSuccessor(i)));
+ }
+ }
+
+ void PredicateSimplifier::visit(BranchInst *BI,
+ DominatorTree::Node *Node, PropertySet &KP){
+ if (BI->isUnconditional()) {
+ proceedToSuccessor(KP, Node, DT->getNode(BI->getSuccessor(0)));
+ return;
+ }
+
+ Value *Condition = BI->getCondition();
+
+ PropertySet TrueProperties(KP), FalseProperties(KP);
+ DEBUG(std::cerr << "true set:\n");
+ TrueProperties.addEqual(ConstantBool::True, Condition);
+ DEBUG(std::cerr << "false set:\n");
+ FalseProperties.addEqual(ConstantBool::False, Condition);
+
+ BasicBlock *TrueDest = BI->getSuccessor(0),
+ *FalseDest = BI->getSuccessor(1);
+
+ PropertySet KPcopy(KP);
+ proceedToSuccessor(KP, TrueProperties, Node, DT->getNode(TrueDest));
+ proceedToSuccessor(KPcopy, FalseProperties, Node, DT->getNode(FalseDest));
+ }
+
+ void PredicateSimplifier::visit(SwitchInst *SI,
+ DominatorTree::Node *DTNode, PropertySet KP) {
+ Value *Condition = SI->getCondition();
+
+ // If there's an NEProperty covering this SwitchInst, we may be able to
+ // eliminate one of the cases.
+ PropertySet::SynSet S;
+
+ if (KP.findSynSet(Condition, S)) {
+ for (PropertySet::ConstPropertyIterator I = KP.Properties.begin(),
+ E = KP.Properties.end(); I != E; ++I) {
+ if (I->Opcode != PropertySet::NE) continue;
+ if (I->S1 != S && I->S2 != S) continue;
+
+ // Is one side a number?
+ ConstantInt *CI = dyn_cast(KP.lookup(I->S1));
+ if (!CI) CI = dyn_cast(KP.lookup(I->S2));
+
+ if (CI) {
+ unsigned i = SI->findCaseValue(CI);
+ if (i != 0) {
+ SI->getSuccessor(i)->removePredecessor(SI->getParent());
+ SI->removeCase(i);
+ modified = true;
+ ++NumSwitchCases;
+ }
+ }
+ }
+ }
+
+ // Set the EQProperty in each of the cases BBs,
+ // and the NEProperties in the default BB.
+ PropertySet DefaultProperties(KP);
+
+ DominatorTree::Node *Node = DT->getNode(SI->getParent()),
+ *DefaultNode = DT->getNode(SI->getSuccessor(0));
+ if (!Node->dominates(DefaultNode)) DefaultNode = NULL;
+
+ for (unsigned I = 1, E = SI->getNumCases(); I < E; ++I) {
+ ConstantInt *CI = SI->getCaseValue(I);
+
+ BasicBlock *SuccBB = SI->getSuccessor(I);
+ PropertySet copy(KP);
+ if (SuccBB->getSinglePredecessor()) {
+ PropertySet NewProperties(KP);
+ NewProperties.addEqual(Condition, CI);
+ proceedToSuccessor(copy, NewProperties, DTNode, DT->getNode(SuccBB));
+ } else
+ proceedToSuccessor(copy, DTNode, DT->getNode(SuccBB));
+
+ if (DefaultNode)
+ DefaultProperties.addNotEqual(Condition, CI);
+ }
+
+ if (DefaultNode)
+ proceedToSuccessor(DefaultProperties, DTNode, DefaultNode);
+ }
+
+ void PredicateSimplifier::visit(LoadInst *LI,
+ DominatorTree::Node *, PropertySet &KP) {
+ Value *Ptr = LI->getPointerOperand();
+ KP.addNotEqual(Constant::getNullValue(Ptr->getType()), Ptr);
+ }
+
+ void PredicateSimplifier::visit(StoreInst *SI,
+ DominatorTree::Node *, PropertySet &KP) {
+ Value *Ptr = SI->getPointerOperand();
+ KP.addNotEqual(Constant::getNullValue(Ptr->getType()), Ptr);
+ }
+
+ void PredicateSimplifier::visit(BinaryOperator *BO,
+ DominatorTree::Node *, PropertySet &KP) {
+ Instruction::BinaryOps ops = BO->getOpcode();
+ if (ops != Instruction::Div && ops != Instruction::Rem) return;
+
+ Value *Divisor = BO->getOperand(1);
+ const Type *Ty = cast(Divisor->getType());
+ KP.addNotEqual(Constant::getNullValue(Ty), Divisor);
+
+ // Some other things we could do:
+ // In f=x*y, if x != 1 && y != 1 then f != x && f != y.
+ // In f=x+y, if x != 0 then f != y and if y != 0 then f != x.
+ }
From nicholas at mxc.ca Mon Aug 28 17:45:11 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 28 Aug 2006 17:45:11 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/LinkAllPasses.h
Message-ID: <200608282245.k7SMjBLZ030337@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm:
LinkAllPasses.h updated: 1.2 -> 1.3
---
Log message:
Add PredicateSimplifier pass. Collapses equal variables into one form
and simplifies expressions. This implements the optimization described
in PR807: http://llvm.org/PR807 .
---
Diffs of the changes: (+1 -0)
LinkAllPasses.h | 1 +
1 files changed, 1 insertion(+)
Index: llvm/include/llvm/LinkAllPasses.h
diff -u llvm/include/llvm/LinkAllPasses.h:1.2 llvm/include/llvm/LinkAllPasses.h:1.3
--- llvm/include/llvm/LinkAllPasses.h:1.2 Mon Aug 21 00:37:03 2006
+++ llvm/include/llvm/LinkAllPasses.h Mon Aug 28 17:44:55 2006
@@ -120,6 +120,7 @@
(void) llvm::createDataStructureStatsPass();
(void) llvm::createDataStructureGraphCheckerPass();
(void) llvm::createInstCountPass();
+ (void) llvm::createPredicateSimplifierPass();
(void)new llvm::LocalDataStructures();
(void)new llvm::BUDataStructures();
From nicholas at mxc.ca Mon Aug 28 20:43:02 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Mon, 28 Aug 2006 20:43:02 -0500
Subject: [llvm-commits] CVS: llvm/CREDITS.TXT
Message-ID: <200608290143.k7T1h2AU001147@zion.cs.uiuc.edu>
Changes in directory llvm:
CREDITS.TXT updated: 1.65 -> 1.66
---
Log message:
The list is sorted by name.
---
Diffs of the changes: (+4 -4)
CREDITS.TXT | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: llvm/CREDITS.TXT
diff -u llvm/CREDITS.TXT:1.65 llvm/CREDITS.TXT:1.66
--- llvm/CREDITS.TXT:1.65 Mon Aug 28 17:44:55 2006
+++ llvm/CREDITS.TXT Mon Aug 28 20:42:47 2006
@@ -130,6 +130,10 @@
D: Alpha backend
D: Sampling based profiling
+N: Nick Lewycky
+E: nicholas at mxc.ca
+D: PredicateSimplifier pass
+
N: Duraid Madina
E: duraid at octopus.com.au
W: http://kinoko.c.u-tokyo.ac.jp/~duraid/
@@ -176,7 +180,3 @@
E: isanbard at gmail.com
W: http://web.mac.com/bwendling/
D: The `Lower Setjmp/Longjmp' pass, improvements to the -lowerswitch pass.
-
-N: Nick Lewycky
-E: nicholas at mxc.ca
-D: PredicateSimplifier pass
From natebegeman at mac.com Mon Aug 28 21:31:13 2006
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Aug 2006 21:31:13 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCJITInfo.cpp
PPCJITInfo.h PPCTargetMachine.cpp
Message-ID: <200608290231.k7T2VD4c001899@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCJITInfo.cpp updated: 1.27 -> 1.28
PPCJITInfo.h updated: 1.12 -> 1.13
PPCTargetMachine.cpp updated: 1.100 -> 1.101
---
Log message:
Make ppc64 jit kinda work right. About 2/3 of Olden passes with this,
there are clearly some encoding bugs lurking in there somewhere.
---
Diffs of the changes: (+359 -257)
PPCJITInfo.cpp | 608 +++++++++++++++++++++++++++++----------------------
PPCJITInfo.h | 6
PPCTargetMachine.cpp | 2
3 files changed, 359 insertions(+), 257 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCJITInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCJITInfo.cpp:1.27 llvm/lib/Target/PowerPC/PPCJITInfo.cpp:1.28
--- llvm/lib/Target/PowerPC/PPCJITInfo.cpp:1.27 Thu Jul 27 13:20:32 2006
+++ llvm/lib/Target/PowerPC/PPCJITInfo.cpp Mon Aug 28 21:30:59 2006
@@ -1,255 +1,353 @@
-//===-- PPCJITInfo.cpp - Implement the JIT interfaces for the PowerPC -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the JIT interfaces for the 32-bit PowerPC target.
-//
-//===----------------------------------------------------------------------===//
-
-#define DEBUG_TYPE "jit"
-#include "PPCJITInfo.h"
-#include "PPCRelocations.h"
-#include "llvm/CodeGen/MachineCodeEmitter.h"
-#include "llvm/Config/alloca.h"
-#include "llvm/Support/Debug.h"
-#include
-#include
-using namespace llvm;
-
-static TargetJITInfo::JITCompilerFn JITCompilerFunction;
-
-#define BUILD_ADDIS(RD,RS,IMM16) \
- ((15 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 65535))
-#define BUILD_ORI(RD,RS,UIMM16) \
- ((24 << 26) | ((RS) << 21) | ((RD) << 16) | ((UIMM16) & 65535))
-#define BUILD_MTSPR(RS,SPR) \
- ((31 << 26) | ((RS) << 21) | ((SPR) << 16) | (467 << 1))
-#define BUILD_BCCTRx(BO,BI,LINK) \
- ((19 << 26) | ((BO) << 21) | ((BI) << 16) | (528 << 1) | ((LINK) & 1))
-
-// Pseudo-ops
-#define BUILD_LIS(RD,IMM16) BUILD_ADDIS(RD,0,IMM16)
-#define BUILD_MTCTR(RS) BUILD_MTSPR(RS,9)
-#define BUILD_BCTR(LINK) BUILD_BCCTRx(20,0,LINK)
-
-
-static void EmitBranchToAt(void *At, void *To, bool isCall) {
- intptr_t Addr = (intptr_t)To;
-
- // FIXME: should special case the short branch case.
- unsigned *AtI = (unsigned*)At;
-
- AtI[0] = BUILD_LIS(12, Addr >> 16); // lis r12, hi16(address)
- AtI[1] = BUILD_ORI(12, 12, Addr); // ori r12, r12, low16(address)
- AtI[2] = BUILD_MTCTR(12); // mtctr r12
- AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl
-}
-
-extern "C" void PPC32CompilationCallback();
-
-#if defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)
-// CompilationCallback stub - We can't use a C function with inline assembly in
-// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
-// write our own wrapper, which does things our way, so we have complete control
-// over register saving and restoring.
-asm(
- ".text\n"
- ".align 2\n"
- ".globl _PPC32CompilationCallback\n"
-"_PPC32CompilationCallback:\n"
- // Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the
- // FIXME: need to save v[0-19] for altivec?
- // Set up a proper stack frame
- "stwu r1, -208(r1)\n"
- "mflr r0\n"
- "stw r0, 216(r1)\n"
- // Save all int arg registers
- "stw r10, 204(r1)\n" "stw r9, 200(r1)\n"
- "stw r8, 196(r1)\n" "stw r7, 192(r1)\n"
- "stw r6, 188(r1)\n" "stw r5, 184(r1)\n"
- "stw r4, 180(r1)\n" "stw r3, 176(r1)\n"
- // Save all call-clobbered FP regs.
- "stfd f13, 168(r1)\n" "stfd f12, 160(r1)\n"
- "stfd f11, 152(r1)\n" "stfd f10, 144(r1)\n"
- "stfd f9, 136(r1)\n" "stfd f8, 128(r1)\n"
- "stfd f7, 120(r1)\n" "stfd f6, 112(r1)\n"
- "stfd f5, 104(r1)\n" "stfd f4, 96(r1)\n"
- "stfd f3, 88(r1)\n" "stfd f2, 80(r1)\n"
- "stfd f1, 72(r1)\n"
- // Arguments to Compilation Callback:
- // r3 - our lr (address of the call instruction in stub plus 4)
- // r4 - stub's lr (address of instruction that called the stub plus 4)
- "mr r3, r0\n"
- "lwz r2, 208(r1)\n" // stub's frame
- "lwz r4, 8(r2)\n" // stub's lr
- "bl _PPC32CompilationCallbackC\n"
- "mtctr r3\n"
- // Restore all int arg registers
- "lwz r10, 204(r1)\n" "lwz r9, 200(r1)\n"
- "lwz r8, 196(r1)\n" "lwz r7, 192(r1)\n"
- "lwz r6, 188(r1)\n" "lwz r5, 184(r1)\n"
- "lwz r4, 180(r1)\n" "lwz r3, 176(r1)\n"
- // Restore all FP arg registers
- "lfd f13, 168(r1)\n" "lfd f12, 160(r1)\n"
- "lfd f11, 152(r1)\n" "lfd f10, 144(r1)\n"
- "lfd f9, 136(r1)\n" "lfd f8, 128(r1)\n"
- "lfd f7, 120(r1)\n" "lfd f6, 112(r1)\n"
- "lfd f5, 104(r1)\n" "lfd f4, 96(r1)\n"
- "lfd f3, 88(r1)\n" "lfd f2, 80(r1)\n"
- "lfd f1, 72(r1)\n"
- // Pop 3 frames off the stack and branch to target
- "lwz r1, 208(r1)\n"
- "lwz r2, 8(r1)\n"
- "mtlr r2\n"
- "bctr\n"
- );
-#else
-void PPC32CompilationCallback() {
- assert(0 && "This is not a power pc, you can't execute this!");
- abort();
-}
-#endif
-
-extern "C" unsigned *PPC32CompilationCallbackC(unsigned *StubCallAddrPlus4,
- unsigned *OrigCallAddrPlus4) {
- // Adjust the pointer to the address of the call instruction in the stub
- // emitted by emitFunctionStub, rather than the instruction after it.
- unsigned *StubCallAddr = StubCallAddrPlus4 - 1;
- unsigned *OrigCallAddr = OrigCallAddrPlus4 - 1;
-
- void *Target = JITCompilerFunction(StubCallAddr);
-
- // Check to see if *OrigCallAddr is a 'bl' instruction, and if we can rewrite
- // it to branch directly to the destination. If so, rewrite it so it does not
- // need to go through the stub anymore.
- unsigned OrigCallInst = *OrigCallAddr;
- if ((OrigCallInst >> 26) == 18) { // Direct call.
- intptr_t Offset = ((intptr_t)Target - (intptr_t)OrigCallAddr) >> 2;
-
- if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range?
- // Clear the original target out.
- OrigCallInst &= (63 << 26) | 3;
- // Fill in the new target.
- OrigCallInst |= (Offset & ((1 << 24)-1)) << 2;
- // Replace the call.
- *OrigCallAddr = OrigCallInst;
- }
- }
-
- // Assert that we are coming from a stub that was created with our
- // emitFunctionStub.
- assert((*StubCallAddr >> 26) == 19 && "Call in stub is not indirect!");
- StubCallAddr -= 6;
-
- // Rewrite the stub with an unconditional branch to the target, for any users
- // who took the address of the stub.
- EmitBranchToAt(StubCallAddr, Target, false);
-
- // Put the address of the target function to call and the address to return to
- // after calling the target function in a place that is easy to get on the
- // stack after we restore all regs.
- return (unsigned *)Target;
-}
-
-
-
-TargetJITInfo::LazyResolverFn
-PPCJITInfo::getLazyResolverFunction(JITCompilerFn Fn) {
- JITCompilerFunction = Fn;
- return PPC32CompilationCallback;
-}
-
-void *PPCJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
- // If this is just a call to an external function, emit a branch instead of a
- // call. The code is the same except for one bit of the last instruction.
- if (Fn != (void*)(intptr_t)PPC32CompilationCallback) {
- MCE.startFunctionStub(4*4);
- void *Addr = (void*)(intptr_t)MCE.getCurrentPCValue();
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- EmitBranchToAt(Addr, Fn, false);
- return MCE.finishFunctionStub(0);
- }
-
- MCE.startFunctionStub(4*7);
- MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
- MCE.emitWordBE(0x7d6802a6); // mflr r11
- MCE.emitWordBE(0x91610028); // stw r11, 40(r1)
- void *Addr = (void*)(intptr_t)MCE.getCurrentPCValue();
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- MCE.emitWordBE(0);
- EmitBranchToAt(Addr, Fn, true/*is call*/);
- return MCE.finishFunctionStub(0);
-}
-
-
-void PPCJITInfo::relocate(void *Function, MachineRelocation *MR,
- unsigned NumRelocs, unsigned char* GOTBase) {
- for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
- unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4;
- intptr_t ResultPtr = (intptr_t)MR->getResultPointer();
- switch ((PPC::RelocationType)MR->getRelocationType()) {
- default: assert(0 && "Unknown relocation type!");
- case PPC::reloc_pcrel_bx:
- // PC-relative relocation for b and bl instructions.
- ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2;
- assert(ResultPtr >= -(1 << 23) && ResultPtr < (1 << 23) &&
- "Relocation out of range!");
- *RelocPos |= (ResultPtr & ((1 << 24)-1)) << 2;
- break;
- case PPC::reloc_pcrel_bcx:
- // PC-relative relocation for BLT,BLE,BEQ,BGE,BGT,BNE, or other
- // bcx instructions.
- ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2;
- assert(ResultPtr >= -(1 << 13) && ResultPtr < (1 << 13) &&
- "Relocation out of range!");
- *RelocPos |= (ResultPtr & ((1 << 14)-1)) << 2;
- break;
- case PPC::reloc_absolute_ptr_high: // Pointer relocations.
- case PPC::reloc_absolute_ptr_low:
- case PPC::reloc_absolute_high: // high bits of ref -> low 16 of instr
- case PPC::reloc_absolute_low: { // low bits of ref -> low 16 of instr
- ResultPtr += MR->getConstantVal();
-
- // If this is a high-part access, get the high-part.
- if (MR->getRelocationType() == PPC::reloc_absolute_high ||
- MR->getRelocationType() == PPC::reloc_absolute_ptr_high) {
- // If the low part will have a carry (really a borrow) from the low
- // 16-bits into the high 16, add a bit to borrow from.
- if (((int)ResultPtr << 16) < 0)
- ResultPtr += 1 << 16;
- ResultPtr >>= 16;
- }
-
- // Do the addition then mask, so the addition does not overflow the 16-bit
- // immediate section of the instruction.
- unsigned LowBits = (*RelocPos + ResultPtr) & 65535;
- unsigned HighBits = *RelocPos & ~65535;
- *RelocPos = LowBits | HighBits; // Slam into low 16-bits
- break;
- }
- case PPC::reloc_absolute_low_ix: { // low bits of ref -> low 14 of instr
- ResultPtr += MR->getConstantVal();
- // Do the addition then mask, so the addition does not overflow the 16-bit
- // immediate section of the instruction.
- unsigned LowBits = (*RelocPos + ResultPtr) & 0xFFFC;
- unsigned HighBits = *RelocPos & 0xFFFF0003;
- *RelocPos = LowBits | HighBits; // Slam into low 14-bits.
- break;
- }
- }
- }
-}
-
-void PPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
- EmitBranchToAt(Old, New, false);
-}
+//===-- PPCJITInfo.cpp - Implement the JIT interfaces for the PowerPC -----===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by the LLVM research group and is distributed under
+// the University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the JIT interfaces for the 32-bit PowerPC target.
+//
+//===----------------------------------------------------------------------===//
+
+#define DEBUG_TYPE "jit"
+#include "PPCJITInfo.h"
+#include "PPCRelocations.h"
+#include "llvm/CodeGen/MachineCodeEmitter.h"
+#include "llvm/Config/alloca.h"
+#include "llvm/Support/Debug.h"
+#include
+#include
+using namespace llvm;
+
+static TargetJITInfo::JITCompilerFn JITCompilerFunction;
+
+#define BUILD_ADDIS(RD,RS,IMM16) \
+ ((15 << 26) | ((RD) << 21) | ((RS) << 16) | ((IMM16) & 65535))
+#define BUILD_ORI(RD,RS,UIMM16) \
+ ((24 << 26) | ((RS) << 21) | ((RD) << 16) | ((UIMM16) & 65535))
+#define BUILD_ORIS(RD,RS,UIMM16) \
+ ((25 << 26) | ((RS) << 21) | ((RD) << 16) | ((UIMM16) & 65535))
+#define BUILD_RLDICR(RD,RS,SH,ME) \
+ ((30 << 26) | ((RS) << 21) | ((RD) << 16) | (((SH) & 31) << 11) | \
+ (((ME) & 63) << 6) | (1 << 3) | (((SH) >> 5) & 1))
+#define BUILD_MTSPR(RS,SPR) \
+ ((31 << 26) | ((RS) << 21) | ((SPR) << 16) | (467 << 1))
+#define BUILD_BCCTRx(BO,BI,LINK) \
+ ((19 << 26) | ((BO) << 21) | ((BI) << 16) | (528 << 1) | ((LINK) & 1))
+#define BUILD_B(TARGET, LINK) \
+ ((18 << 26) | (((TARGET) & 0x00FFFFFF) << 2) | ((LINK) & 1))
+
+// Pseudo-ops
+#define BUILD_LIS(RD,IMM16) BUILD_ADDIS(RD,0,IMM16)
+#define BUILD_SLDI(RD,RS,IMM6) BUILD_RLDICR(RD,RS,IMM6,63-IMM6)
+#define BUILD_MTCTR(RS) BUILD_MTSPR(RS,9)
+#define BUILD_BCTR(LINK) BUILD_BCCTRx(20,0,LINK)
+
+static void EmitBranchToAt(uint64_t At, uint64_t To, bool isCall, bool is64Bit){
+ intptr_t Offset = ((intptr_t)To - (intptr_t)At) >> 2;
+ unsigned *AtI = (unsigned*)(intptr_t)At;
+
+ if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range?
+ AtI[0] = BUILD_B(Offset, isCall); // b/bl target
+ } else if (!is64Bit) {
+ AtI[0] = BUILD_LIS(12, To >> 16); // lis r12, hi16(address)
+ AtI[1] = BUILD_ORI(12, 12, To); // ori r12, r12, lo16(address)
+ AtI[2] = BUILD_MTCTR(12); // mtctr r12
+ AtI[3] = BUILD_BCTR(isCall); // bctr/bctrl
+ } else {
+ AtI[0] = BUILD_LIS(12, To >> 48); // lis r12, hi16(address)
+ AtI[1] = BUILD_ORI(12, 12, To >> 32); // ori r12, r12, lo16(address)
+ AtI[2] = BUILD_SLDI(12, 12, 32); // sldi r12, r12, 32
+ AtI[3] = BUILD_ORIS(12, 12, To >> 16); // oris r12, r12, hi16(address)
+ AtI[4] = BUILD_ORI(12, 12, To); // ori r12, r12, lo16(address)
+ AtI[5] = BUILD_MTCTR(12); // mtctr r12
+ AtI[6] = BUILD_BCTR(isCall); // bctr/bctrl
+ }
+}
+
+extern "C" void PPC32CompilationCallback();
+extern "C" void PPC64CompilationCallback();
+
+#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && !defined(__ppc64__)
+// CompilationCallback stub - We can't use a C function with inline assembly in
+// it, because we the prolog/epilog inserted by GCC won't work for us. Instead,
+// write our own wrapper, which does things our way, so we have complete control
+// over register saving and restoring.
+asm(
+ ".text\n"
+ ".align 2\n"
+ ".globl _PPC32CompilationCallback\n"
+"_PPC32CompilationCallback:\n"
+ // Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the
+ // FIXME: need to save v[0-19] for altivec?
+ // FIXME: could shrink frame
+ // Set up a proper stack frame
+ "stwu r1, -208(r1)\n"
+ "mflr r0\n"
+ "stw r0, 216(r1)\n"
+ // Save all int arg registers
+ "stw r10, 204(r1)\n" "stw r9, 200(r1)\n"
+ "stw r8, 196(r1)\n" "stw r7, 192(r1)\n"
+ "stw r6, 188(r1)\n" "stw r5, 184(r1)\n"
+ "stw r4, 180(r1)\n" "stw r3, 176(r1)\n"
+ // Save all call-clobbered FP regs.
+ "stfd f13, 168(r1)\n" "stfd f12, 160(r1)\n"
+ "stfd f11, 152(r1)\n" "stfd f10, 144(r1)\n"
+ "stfd f9, 136(r1)\n" "stfd f8, 128(r1)\n"
+ "stfd f7, 120(r1)\n" "stfd f6, 112(r1)\n"
+ "stfd f5, 104(r1)\n" "stfd f4, 96(r1)\n"
+ "stfd f3, 88(r1)\n" "stfd f2, 80(r1)\n"
+ "stfd f1, 72(r1)\n"
+ // Arguments to Compilation Callback:
+ // r3 - our lr (address of the call instruction in stub plus 4)
+ // r4 - stub's lr (address of instruction that called the stub plus 4)
+ "mr r3, r0\n"
+ "lwz r2, 208(r1)\n" // stub's frame
+ "lwz r4, 8(r2)\n" // stub's lr
+ "li r5, 0\n" // 0 == 32 bit
+ "bl _PPCCompilationCallbackC\n"
+ "mtctr r3\n"
+ // Restore all int arg registers
+ "lwz r10, 204(r1)\n" "lwz r9, 200(r1)\n"
+ "lwz r8, 196(r1)\n" "lwz r7, 192(r1)\n"
+ "lwz r6, 188(r1)\n" "lwz r5, 184(r1)\n"
+ "lwz r4, 180(r1)\n" "lwz r3, 176(r1)\n"
+ // Restore all FP arg registers
+ "lfd f13, 168(r1)\n" "lfd f12, 160(r1)\n"
+ "lfd f11, 152(r1)\n" "lfd f10, 144(r1)\n"
+ "lfd f9, 136(r1)\n" "lfd f8, 128(r1)\n"
+ "lfd f7, 120(r1)\n" "lfd f6, 112(r1)\n"
+ "lfd f5, 104(r1)\n" "lfd f4, 96(r1)\n"
+ "lfd f3, 88(r1)\n" "lfd f2, 80(r1)\n"
+ "lfd f1, 72(r1)\n"
+ // Pop 3 frames off the stack and branch to target
+ "lwz r1, 208(r1)\n"
+ "lwz r2, 8(r1)\n"
+ "mtlr r2\n"
+ "bctr\n"
+ );
+#else
+void PPC32CompilationCallback() {
+ assert(0 && "This is not a power pc, you can't execute this!");
+ abort();
+}
+#endif
+
+#if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && defined(__ppc64__)
+asm(
+ ".text\n"
+ ".align 2\n"
+ ".globl _PPC64CompilationCallback\n"
+"_PPC64CompilationCallback:\n"
+ // Make space for 8 ints r[3-10] and 13 doubles f[1-13] and the
+ // FIXME: need to save v[0-19] for altivec?
+ // Set up a proper stack frame
+ "stdu r1, -208(r1)\n"
+ "mflr r0\n"
+ "std r0, 224(r1)\n"
+ // Save all int arg registers
+ "std r10, 200(r1)\n" "std r9, 192(r1)\n"
+ "std r8, 184(r1)\n" "std r7, 176(r1)\n"
+ "std r6, 168(r1)\n" "std r5, 160(r1)\n"
+ "std r4, 152(r1)\n" "std r3, 144(r1)\n"
+ // Save all call-clobbered FP regs.
+ "stfd f13, 136(r1)\n" "stfd f12, 128(r1)\n"
+ "stfd f11, 120(r1)\n" "stfd f10, 112(r1)\n"
+ "stfd f9, 104(r1)\n" "stfd f8, 96(r1)\n"
+ "stfd f7, 88(r1)\n" "stfd f6, 80(r1)\n"
+ "stfd f5, 72(r1)\n" "stfd f4, 64(r1)\n"
+ "stfd f3, 56(r1)\n" "stfd f2, 48(r1)\n"
+ "stfd f1, 40(r1)\n"
+ // Arguments to Compilation Callback:
+ // r3 - our lr (address of the call instruction in stub plus 4)
+ // r4 - stub's lr (address of instruction that called the stub plus 4)
+ "mr r3, r0\n"
+ "ld r2, 208(r1)\n" // stub's frame
+ "ld r4, 16(r2)\n" // stub's lr
+ "li r5, 1\n" // 1 == 64 bit
+ "bl _PPCCompilationCallbackC\n"
+ "mtctr r3\n"
+ // Restore all int arg registers
+ "ld r10, 200(r1)\n" "ld r9, 192(r1)\n"
+ "ld r8, 184(r1)\n" "ld r7, 176(r1)\n"
+ "ld r6, 168(r1)\n" "ld r5, 160(r1)\n"
+ "ld r4, 152(r1)\n" "ld r3, 144(r1)\n"
+ // Restore all FP arg registers
+ "lfd f13, 136(r1)\n" "lfd f12, 128(r1)\n"
+ "lfd f11, 120(r1)\n" "lfd f10, 112(r1)\n"
+ "lfd f9, 104(r1)\n" "lfd f8, 96(r1)\n"
+ "lfd f7, 88(r1)\n" "lfd f6, 80(r1)\n"
+ "lfd f5, 72(r1)\n" "lfd f4, 64(r1)\n"
+ "lfd f3, 56(r1)\n" "lfd f2, 48(r1)\n"
+ "lfd f1, 40(r1)\n"
+ // Pop 3 frames off the stack and branch to target
+ "ld r1, 208(r1)\n"
+ "ld r2, 16(r1)\n"
+ "mtlr r2\n"
+ "bctr\n"
+ );
+#else
+void PPC64CompilationCallback() {
+ assert(0 && "This is not a power pc, you can't execute this!");
+ abort();
+}
+#endif
+
+extern "C" void *PPCCompilationCallbackC(unsigned *StubCallAddrPlus4,
+ unsigned *OrigCallAddrPlus4,
+ bool is64Bit) {
+ // Adjust the pointer to the address of the call instruction in the stub
+ // emitted by emitFunctionStub, rather than the instruction after it.
+ unsigned *StubCallAddr = StubCallAddrPlus4 - 1;
+ unsigned *OrigCallAddr = OrigCallAddrPlus4 - 1;
+
+ void *Target = JITCompilerFunction(StubCallAddr);
+
+ // Check to see if *OrigCallAddr is a 'bl' instruction, and if we can rewrite
+ // it to branch directly to the destination. If so, rewrite it so it does not
+ // need to go through the stub anymore.
+ unsigned OrigCallInst = *OrigCallAddr;
+ if ((OrigCallInst >> 26) == 18) { // Direct call.
+ intptr_t Offset = ((intptr_t)Target - (intptr_t)OrigCallAddr) >> 2;
+
+ if (Offset >= -(1 << 23) && Offset < (1 << 23)) { // In range?
+ // Clear the original target out.
+ OrigCallInst &= (63 << 26) | 3;
+ // Fill in the new target.
+ OrigCallInst |= (Offset & ((1 << 24)-1)) << 2;
+ // Replace the call.
+ *OrigCallAddr = OrigCallInst;
+ }
+ }
+
+ // Assert that we are coming from a stub that was created with our
+ // emitFunctionStub.
+ if ((*StubCallAddr >> 26) == 18)
+ StubCallAddr -= 3;
+ else {
+ assert((*StubCallAddr >> 26) == 19 && "Call in stub is not indirect!");
+ StubCallAddr -= is64Bit ? 9 : 6;
+ }
+
+ // Rewrite the stub with an unconditional branch to the target, for any users
+ // who took the address of the stub.
+ EmitBranchToAt((intptr_t)StubCallAddr, (intptr_t)Target, false, is64Bit);
+
+ // Put the address of the target function to call and the address to return to
+ // after calling the target function in a place that is easy to get on the
+ // stack after we restore all regs.
+ return Target;
+}
+
+
+
+TargetJITInfo::LazyResolverFn
+PPCJITInfo::getLazyResolverFunction(JITCompilerFn Fn) {
+ JITCompilerFunction = Fn;
+ return is64Bit ? PPC64CompilationCallback : PPC32CompilationCallback;
+}
+
+void *PPCJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
+ // If this is just a call to an external function, emit a branch instead of a
+ // call. The code is the same except for one bit of the last instruction.
+ if (Fn != (void*)(intptr_t)PPC32CompilationCallback &&
+ Fn != (void*)(intptr_t)PPC64CompilationCallback) {
+ MCE.startFunctionStub(7*4);
+ intptr_t Addr = (intptr_t)MCE.getCurrentPCValue();
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ EmitBranchToAt(Addr, (intptr_t)Fn, false, is64Bit);
+ return MCE.finishFunctionStub(0);
+ }
+
+ MCE.startFunctionStub(10*4);
+ if (is64Bit) {
+ MCE.emitWordBE(0xf821ffb1); // stdu r1,-80(r1)
+ MCE.emitWordBE(0x7d6802a6); // mflr r11
+ MCE.emitWordBE(0xf9610060); // std r11, 96(r1)
+ } else {
+ MCE.emitWordBE(0x9421ffe0); // stwu r1,-32(r1)
+ MCE.emitWordBE(0x7d6802a6); // mflr r11
+ MCE.emitWordBE(0x91610028); // stw r11, 40(r1)
+ }
+ intptr_t Addr = (intptr_t)MCE.getCurrentPCValue();
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ MCE.emitWordBE(0);
+ EmitBranchToAt(Addr, (intptr_t)Fn, true, is64Bit);
+ return MCE.finishFunctionStub(0);
+}
+
+
+void PPCJITInfo::relocate(void *Function, MachineRelocation *MR,
+ unsigned NumRelocs, unsigned char* GOTBase) {
+ for (unsigned i = 0; i != NumRelocs; ++i, ++MR) {
+ unsigned *RelocPos = (unsigned*)Function + MR->getMachineCodeOffset()/4;
+ intptr_t ResultPtr = (intptr_t)MR->getResultPointer();
+ switch ((PPC::RelocationType)MR->getRelocationType()) {
+ default: assert(0 && "Unknown relocation type!");
+ case PPC::reloc_pcrel_bx:
+ // PC-relative relocation for b and bl instructions.
+ ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2;
+ assert(ResultPtr >= -(1 << 23) && ResultPtr < (1 << 23) &&
+ "Relocation out of range!");
+ *RelocPos |= (ResultPtr & ((1 << 24)-1)) << 2;
+ break;
+ case PPC::reloc_pcrel_bcx:
+ // PC-relative relocation for BLT,BLE,BEQ,BGE,BGT,BNE, or other
+ // bcx instructions.
+ ResultPtr = (ResultPtr-(intptr_t)RelocPos) >> 2;
+ assert(ResultPtr >= -(1 << 13) && ResultPtr < (1 << 13) &&
+ "Relocation out of range!");
+ *RelocPos |= (ResultPtr & ((1 << 14)-1)) << 2;
+ break;
+ case PPC::reloc_absolute_ptr_high: // Pointer relocations.
+ case PPC::reloc_absolute_ptr_low:
+ case PPC::reloc_absolute_high: // high bits of ref -> low 16 of instr
+ case PPC::reloc_absolute_low: { // low bits of ref -> low 16 of instr
+ ResultPtr += MR->getConstantVal();
+
+ // If this is a high-part access, get the high-part.
+ if (MR->getRelocationType() == PPC::reloc_absolute_high ||
+ MR->getRelocationType() == PPC::reloc_absolute_ptr_high) {
+ // If the low part will have a carry (really a borrow) from the low
+ // 16-bits into the high 16, add a bit to borrow from.
+ if (((int)ResultPtr << 16) < 0)
+ ResultPtr += 1 << 16;
+ ResultPtr >>= 16;
+ }
+
+ // Do the addition then mask, so the addition does not overflow the 16-bit
+ // immediate section of the instruction.
+ unsigned LowBits = (*RelocPos + ResultPtr) & 65535;
+ unsigned HighBits = *RelocPos & ~65535;
+ *RelocPos = LowBits | HighBits; // Slam into low 16-bits
+ break;
+ }
+ case PPC::reloc_absolute_low_ix: { // low bits of ref -> low 14 of instr
+ ResultPtr += MR->getConstantVal();
+ // Do the addition then mask, so the addition does not overflow the 16-bit
+ // immediate section of the instruction.
+ unsigned LowBits = (*RelocPos + ResultPtr) & 0xFFFC;
+ unsigned HighBits = *RelocPos & 0xFFFF0003;
+ *RelocPos = LowBits | HighBits; // Slam into low 14-bits.
+ break;
+ }
+ }
+ }
+}
+
+void PPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
+ EmitBranchToAt((intptr_t)Old, (intptr_t)New, false, is64Bit);
+}
Index: llvm/lib/Target/PowerPC/PPCJITInfo.h
diff -u llvm/lib/Target/PowerPC/PPCJITInfo.h:1.12 llvm/lib/Target/PowerPC/PPCJITInfo.h:1.13
--- llvm/lib/Target/PowerPC/PPCJITInfo.h:1.12 Thu Jul 27 13:20:32 2006
+++ llvm/lib/Target/PowerPC/PPCJITInfo.h Mon Aug 28 21:30:59 2006
@@ -22,8 +22,12 @@
class PPCJITInfo : public TargetJITInfo {
protected:
PPCTargetMachine &TM;
+ bool is64Bit;
public:
- PPCJITInfo(PPCTargetMachine &tm) : TM(tm) {useGOT = 0;}
+ PPCJITInfo(PPCTargetMachine &tm, bool tmIs64Bit) : TM(tm) {
+ useGOT = 0;
+ is64Bit = tmIs64Bit;
+ }
/// addPassesToJITCompile - Add passes to the specified pass manager to
/// implement a fast dynamic compiler for this target. Return true if this
Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.100 llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.101
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.100 Wed Aug 23 16:08:52 2006
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cpp Mon Aug 28 21:30:59 2006
@@ -87,7 +87,7 @@
bool is64Bit)
: TargetMachine("PowerPC"), Subtarget(M, FS, is64Bit),
DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
- FrameInfo(*this, false), JITInfo(*this), TLInfo(*this),
+ FrameInfo(*this, false), JITInfo(*this, is64Bit), TLInfo(*this),
InstrItins(Subtarget.getInstrItineraryData()) {
if (getRelocationModel() == Reloc::Default)
From resistor at mac.com Tue Aug 29 01:11:10 2006
From: resistor at mac.com (Owen Anderson)
Date: Tue, 29 Aug 2006 01:11:10 -0500
Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp
Message-ID: <200608290611.k7T6BASA005323@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
LoopUnroll.cpp updated: 1.27 -> 1.28
---
Log message:
Clean up a bit.
---
Diffs of the changes: (+32 -51)
LoopUnroll.cpp | 83 +++++++++++++++++++++------------------------------------
1 files changed, 32 insertions(+), 51 deletions(-)
Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.27 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.28
--- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.27 Sun Aug 27 21:09:46 2006
+++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Tue Aug 29 01:10:56 2006
@@ -128,66 +128,47 @@
// pred, and if there is only one distinct successor of the predecessor, and
// if there are no PHI nodes.
//
- pred_iterator PI(pred_begin(BB)), PE(pred_end(BB));
- BasicBlock *OnlyPred = *PI++;
- for (; PI != PE; ++PI) // Search all predecessors, see if they are all same
- if (*PI != OnlyPred) {
- OnlyPred = 0; // There are multiple different predecessors...
- break;
- }
+ BasicBlock *OnlyPred = BB->getSinglePredecessor();
+ if (!OnlyPred) return 0;
- BasicBlock *OnlySucc = 0;
- if (OnlyPred && OnlyPred != BB && // Don't break self loops
- OnlyPred->getTerminator()->getOpcode() != Instruction::Invoke) {
- // Check to see if there is only one distinct successor...
- succ_iterator SI(succ_begin(OnlyPred)), SE(succ_end(OnlyPred));
- OnlySucc = BB;
- for (; SI != SE; ++SI)
- if (*SI != OnlySucc) {
- OnlySucc = 0; // There are multiple distinct successors!
- break;
- }
- }
+ if (OnlyPred->getTerminator()->getNumSuccessors() != 1)
+ return 0;
- if (OnlySucc) {
- DEBUG(std::cerr << "Merging: " << *BB << "into: " << *OnlyPred);
- TerminatorInst *Term = OnlyPred->getTerminator();
-
- // Resolve any PHI nodes at the start of the block. They are all
- // guaranteed to have exactly one entry if they exist, unless there are
- // multiple duplicate (but guaranteed to be equal) entries for the
- // incoming edges. This occurs when there are multiple edges from
- // OnlyPred to OnlySucc.
- //
- while (PHINode *PN = dyn_cast(&BB->front())) {
- PN->replaceAllUsesWith(PN->getIncomingValue(0));
- BB->getInstList().pop_front(); // Delete the phi node...
- }
+ DEBUG(std::cerr << "Merging: " << *BB << "into: " << *OnlyPred);
+ TerminatorInst *Term = OnlyPred->getTerminator();
- // Delete the unconditional branch from the predecessor...
- OnlyPred->getInstList().pop_back();
+ // Resolve any PHI nodes at the start of the block. They are all
+ // guaranteed to have exactly one entry if they exist, unless there are
+ // multiple duplicate (but guaranteed to be equal) entries for the
+ // incoming edges. This occurs when there are multiple edges from
+ // OnlyPred to OnlySucc.
+ //
+ while (PHINode *PN = dyn_cast(&BB->front())) {
+ PN->replaceAllUsesWith(PN->getIncomingValue(0));
+ BB->getInstList().pop_front(); // Delete the phi node...
+ }
- // Move all definitions in the successor to the predecessor...
- OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
+ // Delete the unconditional branch from the predecessor...
+ OnlyPred->getInstList().pop_back();
- // Make all PHI nodes that referred to BB now refer to Pred as their
- // source...
- BB->replaceAllUsesWith(OnlyPred);
+ // Move all definitions in the successor to the predecessor...
+ OnlyPred->getInstList().splice(OnlyPred->end(), BB->getInstList());
- std::string OldName = BB->getName();
+ // Make all PHI nodes that referred to BB now refer to Pred as their
+ // source...
+ BB->replaceAllUsesWith(OnlyPred);
- // Erase basic block from the function...
- LI->removeBlock(BB);
- BB->eraseFromParent();
+ std::string OldName = BB->getName();
- // Inherit predecessors name if it exists...
- if (!OldName.empty() && !OnlyPred->hasName())
- OnlyPred->setName(OldName);
+ // Erase basic block from the function...
+ LI->removeBlock(BB);
+ BB->eraseFromParent();
- return OnlyPred;
- }
-
- return 0;
+ // Inherit predecessors name if it exists...
+ if (!OldName.empty() && !OnlyPred->hasName())
+ OnlyPred->setName(OldName);
+
+ return OnlyPred;
}
bool LoopUnroll::visitLoop(Loop *L) {
From evan.cheng at apple.com Tue Aug 29 01:42:24 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 01:42:24 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h
Message-ID: <200608290642.k7T6gOAj005837@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.127 -> 1.128
---
Log message:
Move isCommutativeBinOp from SelectionDAG.cpp and DAGCombiner.cpp out. Make it a static method of SelectionDAG.
---
Diffs of the changes: (+19 -0)
SelectionDAG.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.127 llvm/include/llvm/CodeGen/SelectionDAG.h:1.128
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.127 Sun Aug 27 03:07:55 2006
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Tue Aug 29 01:42:10 2006
@@ -388,6 +388,25 @@
/// of the SDNodes* in assigned order by reference.
unsigned AssignTopologicalOrder(std::vector &TopOrder);
+ /// isCommutativeBinOp - Returns true if the opcode is a commutative binary
+ /// operation.
+ static bool isCommutativeBinOp(unsigned Opcode) {
+ switch (Opcode) {
+ case ISD::ADD:
+ case ISD::MUL:
+ case ISD::MULHU:
+ case ISD::MULHS:
+ case ISD::FADD:
+ case ISD::FMUL:
+ case ISD::AND:
+ case ISD::OR:
+ case ISD::XOR:
+ case ISD::ADDC:
+ case ISD::ADDE: return true;
+ default: return false;
+ }
+ }
+
void dump() const;
private:
From evan.cheng at apple.com Tue Aug 29 01:42:49 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 01:42:49 -0500
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
SelectionDAG.cpp
Message-ID: <200608290642.k7T6gnaB005863@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen/SelectionDAG:
DAGCombiner.cpp updated: 1.183 -> 1.184
SelectionDAG.cpp updated: 1.335 -> 1.336
---
Log message:
Move isCommutativeBinOp from SelectionDAG.cpp and DAGCombiner.cpp out. Make it a static method of SelectionDAG.
---
Diffs of the changes: (+3 -31)
DAGCombiner.cpp | 19 +++----------------
SelectionDAG.cpp | 15 ---------------
2 files changed, 3 insertions(+), 31 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.183 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.184
--- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.183 Sun Aug 27 07:54:01 2006
+++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Tue Aug 29 01:42:35 2006
@@ -306,19 +306,6 @@
return false;
}
-// FIXME: This should probably go in the ISD class rather than being duplicated
-// in several files.
-static bool isCommutativeBinOp(unsigned Opcode) {
- switch (Opcode) {
- case ISD::ADD:
- case ISD::MUL:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: return true;
- default: return false; // FIXME: Need commutative info for user ops!
- }
-}
-
SDOperand DAGCombiner::ReassociateOps(unsigned Opc, SDOperand N0, SDOperand N1){
MVT::ValueType VT = N0.getValueType();
// reassoc. (op (op x, c1), y) -> (op (op x, y), c1) iff x+c1 has one use
@@ -3456,7 +3443,7 @@
return DAG.getSetCC(VT, N0.getOperand(1), N1.getOperand(1), Cond);
if (N0.getOperand(1) == N1.getOperand(1))
return DAG.getSetCC(VT, N0.getOperand(0), N1.getOperand(0), Cond);
- if (isCommutativeBinOp(N0.getOpcode())) {
+ if (DAG.isCommutativeBinOp(N0.getOpcode())) {
// If X op Y == Y op X, try other combinations.
if (N0.getOperand(0) == N1.getOperand(1))
return DAG.getSetCC(VT, N0.getOperand(1), N1.getOperand(0), Cond);
@@ -3499,7 +3486,7 @@
return DAG.getSetCC(VT, N0.getOperand(1),
DAG.getConstant(0, N0.getValueType()), Cond);
if (N0.getOperand(1) == N1) {
- if (isCommutativeBinOp(N0.getOpcode()))
+ if (DAG.isCommutativeBinOp(N0.getOpcode()))
return DAG.getSetCC(VT, N0.getOperand(0),
DAG.getConstant(0, N0.getValueType()), Cond);
else {
@@ -3521,7 +3508,7 @@
return DAG.getSetCC(VT, N1.getOperand(1),
DAG.getConstant(0, N1.getValueType()), Cond);
} else if (N1.getOperand(1) == N0) {
- if (isCommutativeBinOp(N1.getOpcode())) {
+ if (DAG.isCommutativeBinOp(N1.getOpcode())) {
return DAG.getSetCC(VT, N1.getOperand(0),
DAG.getConstant(0, N1.getValueType()), Cond);
} else {
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.335 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.336
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.335 Sun Aug 27 03:08:54 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 29 01:42:35 2006
@@ -38,21 +38,6 @@
return Res;
}
-static bool isCommutativeBinOp(unsigned Opcode) {
- switch (Opcode) {
- case ISD::ADD:
- case ISD::MUL:
- case ISD::MULHU:
- case ISD::MULHS:
- case ISD::FADD:
- case ISD::FMUL:
- case ISD::AND:
- case ISD::OR:
- case ISD::XOR: return true;
- default: return false; // FIXME: Need commutative info for user ops!
- }
-}
-
// isInvertibleForFree - Return true if there is no cost to emitting the logical
// inverse of this node.
static bool isInvertibleForFree(SDOperand N) {
From evan.cheng at apple.com Tue Aug 29 01:44:31 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 01:44:31 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Message-ID: <200608290644.k7T6iVM7005896@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.99 -> 1.100
---
Log message:
Avoid making unneeded load/mod/store transformation which can hurt performance.
---
Diffs of the changes: (+10 -5)
X86ISelDAGToDAG.cpp | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.99 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.100
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.99 Mon Aug 28 15:10:17 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Aug 29 01:44:17 2006
@@ -80,6 +80,9 @@
Statistic<>
NumFPKill("x86-codegen", "Number of FP_REG_KILL instructions added");
+ Statistic<>
+ NumLoadMoved("x86-codegen", "Number of loads moved below TokenFactor");
+
//===--------------------------------------------------------------------===//
/// ISel - X86 specific code to select X86 machine instructions for
/// SelectionDAG operations.
@@ -313,8 +316,6 @@
switch (Opcode) {
case ISD::ADD:
case ISD::MUL:
- case ISD::FADD:
- case ISD::FMUL:
case ISD::AND:
case ISD::OR:
case ISD::XOR:
@@ -329,7 +330,8 @@
std::swap(N10, N11);
}
RModW = RModW && N10.Val->isOperand(Chain.Val) && N10.hasOneUse() &&
- N10.getOperand(1) == N2;
+ (N10.getOperand(1) == N2) &&
+ (N10.Val->getValueType(0) == N1.getValueType());
if (RModW)
Load = N10;
break;
@@ -347,15 +349,18 @@
SDOperand N10 = N1.getOperand(0);
if (N10.Val->getOpcode() == ISD::LOAD)
RModW = N10.Val->isOperand(Chain.Val) && N10.hasOneUse() &&
- N10.getOperand(1) == N2;
+ (N10.getOperand(1) == N2) &&
+ (N10.Val->getValueType(0) == N1.getValueType());
if (RModW)
Load = N10;
break;
}
}
- if (RModW)
+ if (RModW) {
MoveBelowTokenFactor(DAG, Load, SDOperand(I, 0), Chain);
+ ++NumLoadMoved;
+ }
}
}
From jlaskey at apple.com Tue Aug 29 10:13:30 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 29 Aug 2006 10:13:30 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/TargetMachine.cpp
Message-ID: <200608291513.k7TFDUKH030089@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target:
TargetMachine.cpp updated: 1.50 -> 1.51
---
Log message:
Tidy up options.
---
Diffs of the changes: (+9 -9)
TargetMachine.cpp | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
Index: llvm/lib/Target/TargetMachine.cpp
diff -u llvm/lib/Target/TargetMachine.cpp:1.50 llvm/lib/Target/TargetMachine.cpp:1.51
--- llvm/lib/Target/TargetMachine.cpp:1.50 Wed Jul 26 16:12:04 2006
+++ llvm/lib/Target/TargetMachine.cpp Tue Aug 29 10:13:10 2006
@@ -63,13 +63,13 @@
cl::init(Reloc::Default),
cl::values(
clEnumValN(Reloc::Default, "default",
- "Target default relocation model"),
+ " Target default relocation model"),
clEnumValN(Reloc::Static, "static",
- "Non-relocatable code"),
+ " Non-relocatable code"),
clEnumValN(Reloc::PIC_, "pic",
- "Fully relocatable, position independent code"),
+ " Fully relocatable, position independent code"),
clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
- "Relocatable external references, non-relocatable code"),
+ " Relocatable external references, non-relocatable code"),
clEnumValEnd));
cl::opt
DefCodeModel(
@@ -79,15 +79,15 @@
cl::init(CodeModel::Default),
cl::values(
clEnumValN(CodeModel::Default, "default",
- "Target default code model"),
+ " Target default code model"),
clEnumValN(CodeModel::Small, "small",
- "Small code model"),
+ " Small code model"),
clEnumValN(CodeModel::Kernel, "kernel",
- "Kernel code model"),
+ " Kernel code model"),
clEnumValN(CodeModel::Medium, "medium",
- "Medium code model"),
+ " Medium code model"),
clEnumValN(CodeModel::Large, "large",
- "Large code model"),
+ " Large code model"),
clEnumValEnd));
}
From jlaskey at apple.com Tue Aug 29 11:24:41 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 29 Aug 2006 11:24:41 -0500
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp
Message-ID: <200608291624.k7TGOfce031362@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
DwarfWriter.cpp updated: 1.71 -> 1.72
---
Log message:
Handle callee saved registers in dwarf frame info (lead up to exception
handling.)
---
Diffs of the changes: (+35 -9)
DwarfWriter.cpp | 44 +++++++++++++++++++++++++++++++++++---------
1 files changed, 35 insertions(+), 9 deletions(-)
Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.71 llvm/lib/CodeGen/DwarfWriter.cpp:1.72
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.71 Fri Aug 25 14:39:52 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp Tue Aug 29 11:24:26 2006
@@ -35,7 +35,7 @@
static cl::opt
DwarfVerbose("dwarf-verbose", cl::Hidden,
- cl::desc("Add comments to Dwarf directives."));
+ cl::desc("Add comments to Dwarf directives."));
namespace llvm {
@@ -1946,7 +1946,7 @@
// Advance row if new location.
if (BaseLabel && LabelID && BaseLabelID != LabelID) {
- EmitULEB128Bytes(DW_CFA_advance_loc4);
+ EmitInt8(DW_CFA_advance_loc4);
EOL("DW_CFA_advance_loc4");
EmitDifference("loc", LabelID, BaseLabel, BaseLabelID);
EOL("");
@@ -1955,30 +1955,56 @@
BaseLabel = "loc";
}
+ int stackGrowth =
+ Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
+ TargetFrameInfo::StackGrowsUp ?
+ AddressSize : -AddressSize;
+
// If advancing cfa.
if (Dst.isRegister() && Dst.getRegister() == MachineLocation::VirtualFP) {
if (!Src.isRegister()) {
if (Src.getRegister() == MachineLocation::VirtualFP) {
- EmitULEB128Bytes(DW_CFA_def_cfa_offset);
+ EmitInt8(DW_CFA_def_cfa_offset);
EOL("DW_CFA_def_cfa_offset");
} else {
- EmitULEB128Bytes(DW_CFA_def_cfa);
+ EmitInt8(DW_CFA_def_cfa);
EOL("DW_CFA_def_cfa");
EmitULEB128Bytes(RI->getDwarfRegNum(Src.getRegister()));
EOL("Register");
}
- int stackGrowth =
- Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
- TargetFrameInfo::StackGrowsUp ?
- AddressSize : -AddressSize;
+ int Offset = Src.getOffset() / stackGrowth;
- EmitULEB128Bytes(Src.getOffset() / stackGrowth);
+ EmitULEB128Bytes(Offset);
EOL("Offset");
} else {
+ assert(0 && "Machine move no supported yet.");
}
} else {
+ unsigned Reg = RI->getDwarfRegNum(Src.getRegister());
+ int Offset = Dst.getOffset() / stackGrowth;
+
+ if (Offset < 0) {
+ EmitInt8(DW_CFA_offset_extended_sf);
+ EOL("DW_CFA_offset_extended_sf");
+ EmitULEB128Bytes(Reg);
+ EOL("Reg");
+ EmitSLEB128Bytes(Offset);
+ EOL("Offset");
+ } else if (Reg < 64) {
+ EmitInt8(DW_CFA_offset + Reg);
+ EOL("DW_CFA_offset + Reg");
+ EmitULEB128Bytes(Offset);
+ EOL("Offset");
+ } else {
+ EmitInt8(DW_CFA_offset_extended);
+ EOL("DW_CFA_offset_extended");
+ EmitULEB128Bytes(Reg);
+ EOL("Reg");
+ EmitULEB128Bytes(Offset);
+ EOL("Offset");
+ }
}
}
}
From jlaskey at apple.com Tue Aug 29 11:24:40 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Tue, 29 Aug 2006 11:24:40 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
Message-ID: <200608291624.k7TGOe7k031357@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPCRegisterInfo.cpp updated: 1.74 -> 1.75
---
Log message:
Handle callee saved registers in dwarf frame info (lead up to exception
handling.)
---
Diffs of the changes: (+13 -6)
PPCRegisterInfo.cpp | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.74 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.75
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.74 Fri Aug 25 14:40:59 2006
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Tue Aug 29 11:24:26 2006
@@ -668,15 +668,22 @@
std::vector &Moves = DebugInfo->getFrameMoves();
unsigned LabelID = DebugInfo->NextLabelID();
- // Show update of SP.
- MachineLocation Dst(MachineLocation::VirtualFP);
- MachineLocation Src(MachineLocation::VirtualFP, NegNumbytes);
- Moves.push_back(new MachineMove(LabelID, Dst, Src));
-
// Mark effective beginning of when frame pointer becomes valid.
BuildMI(MBB, MBBI, PPC::DWARF_LABEL, 1).addImm(LabelID);
-
+ // Show update of SP.
+ MachineLocation SPDst(MachineLocation::VirtualFP);
+ MachineLocation SPSrc(MachineLocation::VirtualFP, NegNumbytes);
+ Moves.push_back(new MachineMove(LabelID, SPDst, SPSrc));
+
+ // Add callee saved registers to move list.
+ const std::vector &CSI = MFI->getCalleeSavedInfo();
+ for (unsigned I = 0, E = CSI.size(); I != E; ++I) {
+ MachineLocation CSDst(MachineLocation::VirtualFP,
+ MFI->getObjectOffset(CSI[I].getFrameIdx()));
+ MachineLocation CSSrc(CSI[I].getReg());
+ Moves.push_back(new MachineMove(LabelID, CSDst, CSSrc));
+ }
}
// If there is a frame pointer, copy R1 (SP) into R31 (FP)
From evan.cheng at apple.com Tue Aug 29 13:01:32 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 13:01:32 -0500
Subject: [llvm-commits] CVS: llvm/utils/NewNightlyTest.pl NightlyTest.pl
Message-ID: <200608291801.k7TI1Wfv000663@zion.cs.uiuc.edu>
Changes in directory llvm/utils:
NewNightlyTest.pl updated: 1.57 -> 1.58
NightlyTest.pl updated: 1.112 -> 1.113
---
Log message:
Issue cvs co with -P option to prune empty directories. Remove the unnecessary
update stage.
---
Diffs of the changes: (+2 -11)
NewNightlyTest.pl | 6 +-----
NightlyTest.pl | 7 +------
2 files changed, 2 insertions(+), 11 deletions(-)
Index: llvm/utils/NewNightlyTest.pl
diff -u llvm/utils/NewNightlyTest.pl:1.57 llvm/utils/NewNightlyTest.pl:1.58
--- llvm/utils/NewNightlyTest.pl:1.57 Tue Aug 22 13:11:19 2006
+++ llvm/utils/NewNightlyTest.pl Tue Aug 29 13:01:18 2006
@@ -488,7 +488,7 @@
# Use compression if going over ssh.
$CVSOPT = "-z3"
if $CVSRootDir =~ /^:ext:/;
-my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co $CVSCOOPT";
+my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
if (!$NOCHECKOUT) {
if ( $VERBOSE ) {
print "CHECKOUT STAGE:\n";
@@ -500,10 +500,6 @@
ChangeDir( $BuildDir , "CVS Checkout directory") ;
}
ChangeDir( "llvm" , "llvm source directory") ;
-if (!$NOCHECKOUT) {
- if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
- system "$NICE cvs update -PdRA >> $CVSLog 2>&1" ;
-}
##############################################################
#
Index: llvm/utils/NightlyTest.pl
diff -u llvm/utils/NightlyTest.pl:1.112 llvm/utils/NightlyTest.pl:1.113
--- llvm/utils/NightlyTest.pl:1.112 Wed Jun 28 19:54:37 2006
+++ llvm/utils/NightlyTest.pl Tue Aug 29 13:01:18 2006
@@ -409,7 +409,7 @@
my $CVSOPT = "";
# Use compression if going over ssh.
$CVSOPT = "-z3" if $CVSRootDir =~ /^:ext:/;
-my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co $CVSCOOPT";
+my $CVSCMD = "$NICE cvs $CVSOPT -d $CVSRootDir co -P $CVSCOOPT";
if (!$NOCHECKOUT) {
if ( $VERBOSE ) { print "CHECKOUT STAGE\n"; }
system "( time -p $CVSCMD llvm; cd llvm/projects ; " .
@@ -419,11 +419,6 @@
ChangeDir( "llvm" , "llvm source directory") ;
-if (!$NOCHECKOUT) {
- if ( $VERBOSE ) { print "UPDATE STAGE\n"; }
- system "$NICE cvs update -PdRA >> $CVSLog 2>&1" ;
-}
-
if ( $Template eq "" ) {
$Template = "$BuildDir/llvm/utils/NightlyTestTemplate.html";
}
From evan.cheng at apple.com Tue Aug 29 13:28:47 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 13:28:47 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86.h X86ISelDAGToDAG.cpp
X86TargetMachine.cpp
Message-ID: <200608291828.k7TISlDj001136@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86.h updated: 1.46 -> 1.47
X86ISelDAGToDAG.cpp updated: 1.100 -> 1.101
X86TargetMachine.cpp updated: 1.121 -> 1.122
---
Log message:
- Enable x86 isel preprocessing by default unless -fast is specified.
- Also disable isel load folding if -fast.
---
Diffs of the changes: (+13 -8)
X86.h | 2 +-
X86ISelDAGToDAG.cpp | 15 ++++++++++-----
X86TargetMachine.cpp | 4 ++--
3 files changed, 13 insertions(+), 8 deletions(-)
Index: llvm/lib/Target/X86/X86.h
diff -u llvm/lib/Target/X86/X86.h:1.46 llvm/lib/Target/X86/X86.h:1.47
--- llvm/lib/Target/X86/X86.h:1.46 Tue Jul 25 15:40:54 2006
+++ llvm/lib/Target/X86/X86.h Tue Aug 29 13:28:33 2006
@@ -28,7 +28,7 @@
/// createX86ISelDag - This pass converts a legalized DAG into a
/// X86-specific DAG, ready for instruction scheduling.
///
-FunctionPass *createX86ISelDag(X86TargetMachine &TM);
+FunctionPass *createX86ISelDag(X86TargetMachine &TM, bool Fast);
/// createX86FloatingPointStackifierPass - This function returns a pass which
/// converts floating point register references and pseudo instructions into
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.100 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.101
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.100 Tue Aug 29 01:44:17 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Aug 29 13:28:33 2006
@@ -92,6 +92,10 @@
/// register should set this to true.
bool ContainsFPCode;
+ /// FastISel - Enable fast(er) instruction selection.
+ ///
+ bool FastISel;
+
/// X86Lowering - This object fully describes how to lower LLVM code to an
/// X86-specific SelectionDAG.
X86TargetLowering X86Lowering;
@@ -103,8 +107,9 @@
unsigned GlobalBaseReg;
public:
- X86DAGToDAGISel(X86TargetMachine &TM)
+ X86DAGToDAGISel(X86TargetMachine &TM, bool fast)
: SelectionDAGISel(X86Lowering),
+ ContainsFPCode(false), FastISel(fast),
X86Lowering(*TM.getTargetLowering()),
Subtarget(&TM.getSubtarget()) {}
@@ -237,7 +242,7 @@
// / [X]
// | ^
// [U]--------|
- return !isNonImmUse(U, N);
+ return !FastISel && !isNonImmUse(U, N);
}
/// MoveBelowTokenFactor - Replace TokenFactor operand with load's chain operand
@@ -370,7 +375,7 @@
DEBUG(BB->dump());
MachineFunction::iterator FirstMBB = BB;
- if (X86ISelPreproc)
+ if (!FastISel)
InstructionSelectPreprocess(DAG);
// Codegen the basic block.
@@ -1071,6 +1076,6 @@
/// createX86ISelDag - This pass converts a legalized DAG into a
/// X86-specific DAG, ready for instruction scheduling.
///
-FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM) {
- return new X86DAGToDAGISel(TM);
+FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM, bool Fast) {
+ return new X86DAGToDAGISel(TM, Fast);
}
Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.121 llvm/lib/Target/X86/X86TargetMachine.cpp:1.122
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.121 Wed Aug 23 16:08:52 2006
+++ llvm/lib/Target/X86/X86TargetMachine.cpp Tue Aug 29 13:28:33 2006
@@ -103,7 +103,7 @@
PM.add(createUnreachableBlockEliminationPass());
// Install an instruction selector.
- PM.add(createX86ISelDag(*this));
+ PM.add(createX86ISelDag(*this, Fast));
// Print the instruction selected machine code...
if (PrintMachineCode)
@@ -168,7 +168,7 @@
PM.add(createUnreachableBlockEliminationPass());
// Install an instruction selector.
- PM.add(createX86ISelDag(TM));
+ PM.add(createX86ISelDag(TM, false));
// Print the instruction selected machine code...
if (PrintMachineCode)
From evan.cheng at apple.com Tue Aug 29 13:37:51 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 13:37:51 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Message-ID: <200608291837.k7TIbpSg001265@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.101 -> 1.102
---
Log message:
Don't performance load/op/store transformation if op produces a floating point
or vector result. X86 does not have load/mod/store variants of those
instructions.
---
Diffs of the changes: (+3 -1)
X86ISelDAGToDAG.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.101 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.102
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.101 Tue Aug 29 13:28:33 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Aug 29 13:37:37 2006
@@ -312,7 +312,9 @@
SDOperand N1 = I->getOperand(1);
SDOperand N2 = I->getOperand(2);
- if (!N1.hasOneUse())
+ if (MVT::isFloatingPoint(N1.getValueType()) &&
+ MVT::isVector(N1.getValueType()) &&
+ !N1.hasOneUse())
continue;
bool RModW = false;
From evan.cheng at apple.com Tue Aug 29 13:49:55 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 13:49:55 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll
Message-ID: <200608291849.k7TIntLu001467@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/X86:
store_op_load_fold2.ll updated: 1.2 -> 1.3
---
Log message:
Undo xfail.
---
Diffs of the changes: (+1 -5)
store_op_load_fold2.ll | 6 +-----
1 files changed, 1 insertion(+), 5 deletions(-)
Index: llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll
diff -u llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll:1.2 llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll:1.3
--- llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll:1.2 Mon Jul 24 02:37:33 2006
+++ llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll Tue Aug 29 13:49:41 2006
@@ -1,8 +1,4 @@
-; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep 'and DWORD PTR' | wc -l | grep 1
-;
-; FIXME: The number of (store (and (load ..) ..) ..) really should be 2. But the current hack
-; only allow one of the folding to happen.
-; XFAIL: *
+; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep 'and DWORD PTR' | wc -l | grep 2
%struct.Macroblock = type { int, int, int, int, int, [8 x int], %struct.Macroblock*, %struct.Macroblock*, int, [2 x [4 x [4 x [2 x int]]]], [16 x sbyte], [16 x sbyte], int, long, [4 x int], [4 x int], long, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, short, double, int, int, int, int, int, int, int, int, int }
From lattner at cs.uiuc.edu Tue Aug 29 15:48:21 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 15:48:21 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/NightlyTester.php
Message-ID: <200608292048.k7TKmL8a003460@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
NightlyTester.php updated: 1.18 -> 1.19
---
Log message:
Fix typo
---
Diffs of the changes: (+1 -1)
NightlyTester.php | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: nightlytest-serverside/NightlyTester.php
diff -u nightlytest-serverside/NightlyTester.php:1.18 nightlytest-serverside/NightlyTester.php:1.19
--- nightlytest-serverside/NightlyTester.php:1.18 Mon Aug 21 15:21:55 2006
+++ nightlytest-serverside/NightlyTester.php Tue Aug 29 15:48:07 2006
@@ -10,7 +10,7 @@
'dejagnutime_cpu' => 'Dejagnu CPU Time',
'teststats_exppass' => 'Expected Test Passes',
'teststats_unexpfail' => 'Unexpected Test Failures',
- 'teststats_expfail' => 'Expected Test Failurs');
+ 'teststats_expfail' => 'Expected Test Failures');
/*****************************************************
*
From reid at x10sys.com Tue Aug 29 15:52:58 2006
From: reid at x10sys.com (Reid Spencer)
Date: Tue, 29 Aug 2006 15:52:58 -0500
Subject: [llvm-commits] CVS: llvm/tools/llvmc/ll
Message-ID: <200608292052.k7TKqwoB003572@zion.cs.uiuc.edu>
Changes in directory llvm/tools/llvmc:
ll updated: 1.7 -> 1.8
---
Log message:
Delete a no-longer-supported configuration item.
---
Diffs of the changes: (+0 -1)
ll | 1 -
1 files changed, 1 deletion(-)
Index: llvm/tools/llvmc/ll
diff -u llvm/tools/llvmc/ll:1.7 llvm/tools/llvmc/ll:1.8
--- llvm/tools/llvmc/ll:1.7 Wed May 18 19:52:29 2005
+++ llvm/tools/llvmc/ll Tue Aug 29 15:52:44 2006
@@ -4,7 +4,6 @@
preprocessor.command=
preprocessor.required=false
translator.command=%bindir%/llvm-as %in% -o %out%
- translator.optimizes=no
translator.preprocesses=true
translator.required=TRUE
optimizer.command=%bindir%/opt %in% -o %out% %opt% %args%
From evan.cheng at apple.com Tue Aug 29 15:55:23 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 15:55:23 -0500
Subject: [llvm-commits] CVS: llvm-test/Makefile.programs
Message-ID: <200608292055.k7TKtNFv003630@zion.cs.uiuc.edu>
Changes in directory llvm-test:
Makefile.programs updated: 1.222 -> 1.223
---
Log message:
Check x86 llcbeta back to -enable-x86-fastcc
---
Diffs of the changes: (+1 -1)
Makefile.programs | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.222 llvm-test/Makefile.programs:1.223
--- llvm-test/Makefile.programs:1.222 Mon Aug 28 15:12:39 2006
+++ llvm-test/Makefile.programs Tue Aug 29 15:55:09 2006
@@ -203,7 +203,7 @@
LLCBETAOPTION := -sched=simple
endif
ifeq ($(ARCH),x86)
-LLCBETAOPTION := -enable-x86-isel-preprocessing
+LLCBETAOPTION := -enable-x86-fastcc
endif
ifeq ($(ARCH),Sparc)
LLCBETAOPTION := -enable-sparc-v9-insts
From evan.cheng at apple.com Tue Aug 29 16:43:12 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 16:43:12 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
Message-ID: <200608292143.k7TLhCqB004418@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ISelDAGToDAG.cpp updated: 1.102 -> 1.103
---
Log message:
Remove dead code.
---
Diffs of the changes: (+0 -4)
X86ISelDAGToDAG.cpp | 4 ----
1 files changed, 4 deletions(-)
Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.102 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.103
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.102 Tue Aug 29 13:37:37 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Tue Aug 29 16:42:58 2006
@@ -39,10 +39,6 @@
#include
using namespace llvm;
-#include "llvm/Support/CommandLine.h"
-static cl::opt X86ISelPreproc("enable-x86-isel-preprocessing", cl::Hidden,
- cl::desc("Enable isel preprocessing on X86"));
-
//===----------------------------------------------------------------------===//
// Pattern Matcher Implementation
//===----------------------------------------------------------------------===//
From evan.cheng at apple.com Tue Aug 29 16:50:12 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 16:50:12 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll
Message-ID: <200608292150.k7TLoCjv004539@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/X86:
store_op_load_fold2.ll updated: 1.3 -> 1.4
---
Log message:
Fix test case so it passes on x86-64.
---
Diffs of the changes: (+3 -0)
store_op_load_fold2.ll | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll
diff -u llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll:1.3 llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll:1.4
--- llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll:1.3 Tue Aug 29 13:49:41 2006
+++ llvm/test/Regression/CodeGen/X86/store_op_load_fold2.ll Tue Aug 29 16:49:58 2006
@@ -1,5 +1,8 @@
; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep 'and DWORD PTR' | wc -l | grep 2
+target endian = little
+target pointersize = 32
+
%struct.Macroblock = type { int, int, int, int, int, [8 x int], %struct.Macroblock*, %struct.Macroblock*, int, [2 x [4 x [4 x [2 x int]]]], [16 x sbyte], [16 x sbyte], int, long, [4 x int], [4 x int], long, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, short, double, int, int, int, int, int, int, int, int, int }
implementation ; Functions:
From evan.cheng at apple.com Tue Aug 29 17:01:53 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 17:01:53 -0500
Subject: [llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/fabs.ll
Message-ID: <200608292201.k7TM1rQG004747@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/X86:
fabs.ll updated: 1.8 -> 1.9
---
Log message:
This is also a 32-bit only test. x86-64 would pass fp parameters through XMM registers.
---
Diffs of the changes: (+3 -0)
fabs.ll | 3 +++
1 files changed, 3 insertions(+)
Index: llvm/test/Regression/CodeGen/X86/fabs.ll
diff -u llvm/test/Regression/CodeGen/X86/fabs.ll:1.8 llvm/test/Regression/CodeGen/X86/fabs.ll:1.9
--- llvm/test/Regression/CodeGen/X86/fabs.ll:1.8 Tue May 23 19:49:32 2006
+++ llvm/test/Regression/CodeGen/X86/fabs.ll Tue Aug 29 17:01:39 2006
@@ -2,6 +2,9 @@
; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 | grep 'fabs$' | wc -l | grep 1 &&
; RUN: llvm-as < %s | llc -march=x86 -mattr=-sse2,-sse3 -enable-unsafe-fp-math | grep 'fabs$' | wc -l | grep 2
+target endian = little
+target pointersize = 32
+
declare float %fabsf(float)
float %fabsftest(float %X) {
From evan.cheng at apple.com Tue Aug 29 17:13:24 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 17:13:24 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
Message-ID: <200608292213.k7TMDOb4004925@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86ATTAsmPrinter.cpp updated: 1.57 -> 1.58
---
Log message:
Minor asm fix.
---
Diffs of the changes: (+3 -1)
X86ATTAsmPrinter.cpp | 4 +++-
1 files changed, 3 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.57 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.58
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.57 Mon Aug 28 17:14:16 2006
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp Tue Aug 29 17:13:10 2006
@@ -252,7 +252,9 @@
return;
}
- if (DispSpec.isGlobalAddress() || DispSpec.isConstantPoolIndex()) {
+ if (DispSpec.isGlobalAddress() ||
+ DispSpec.isConstantPoolIndex() ||
+ DispSpec.isJumpTableIndex()) {
printOperand(MI, Op+3, "mem");
} else {
int DispVal = DispSpec.getImmedValue();
From evan.cheng at apple.com Tue Aug 29 17:15:02 2006
From: evan.cheng at apple.com (Evan Cheng)
Date: Tue, 29 Aug 2006 17:15:02 -0500
Subject: [llvm-commits] CVS: llvm/lib/Target/X86/X86AsmPrinter.h
Message-ID: <200608292215.k7TMF2wP004960@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/X86:
X86AsmPrinter.h updated: 1.26 -> 1.27
---
Log message:
Minor asm fix.
---
Diffs of the changes: (+2 -1)
X86AsmPrinter.h | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/X86/X86AsmPrinter.h
diff -u llvm/lib/Target/X86/X86AsmPrinter.h:1.26 llvm/lib/Target/X86/X86AsmPrinter.h:1.27
--- llvm/lib/Target/X86/X86AsmPrinter.h:1.26 Thu Aug 3 12:27:09 2006
+++ llvm/lib/Target/X86/X86AsmPrinter.h Tue Aug 29 17:14:48 2006
@@ -90,7 +90,8 @@
MI->getOperand(Op+2).isRegister() &&
(MI->getOperand(Op+3).isImmediate() ||
MI->getOperand(Op+3).isGlobalAddress() ||
- MI->getOperand(Op+3).isConstantPoolIndex());
+ MI->getOperand(Op+3).isConstantPoolIndex() ||
+ MI->getOperand(Op+3).isJumpTableIndex());
}
};
From dpatel at apple.com Tue Aug 29 17:29:32 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 29 Aug 2006 17:29:32 -0500
Subject: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
Message-ID: <200608292229.k7TMTWUl005197@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
LoopUnswitch.cpp updated: 1.46 -> 1.47
---
Log message:
Do not rely on std::sort and std::erase to get list of unique
exit blocks. The output is dependent on addresses of basic block.
Add and use Loop::getUniqueExitBlocks.
---
Diffs of the changes: (+4 -10)
LoopUnswitch.cpp | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.46 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.47
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.46 Sun Aug 27 17:42:52 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Tue Aug 29 17:29:16 2006
@@ -570,11 +570,8 @@
LoopBlocks.insert(LoopBlocks.end(), L->block_begin(), L->block_end());
std::vector ExitBlocks;
- L->getExitBlocks(ExitBlocks);
- std::sort(ExitBlocks.begin(), ExitBlocks.end());
- ExitBlocks.erase(std::unique(ExitBlocks.begin(), ExitBlocks.end()),
- ExitBlocks.end());
-
+ L->getUniqueExitBlocks(ExitBlocks);
+
// Split all of the edges from inside the loop to their exit blocks. Update
// the appropriate Phi nodes as we do so.
unsigned NumBlocks = L->getBlocks().size();
@@ -626,11 +623,8 @@
// The exit blocks may have been changed due to edge splitting, recompute.
ExitBlocks.clear();
- L->getExitBlocks(ExitBlocks);
- std::sort(ExitBlocks.begin(), ExitBlocks.end());
- ExitBlocks.erase(std::unique(ExitBlocks.begin(), ExitBlocks.end()),
- ExitBlocks.end());
-
+ L->getUniqueExitBlocks(ExitBlocks);
+
// Add exit blocks to the loop blocks.
LoopBlocks.insert(LoopBlocks.end(), ExitBlocks.begin(), ExitBlocks.end());
From dpatel at apple.com Tue Aug 29 17:29:33 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 29 Aug 2006 17:29:33 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/Analysis/LoopInfo.h
Message-ID: <200608292229.k7TMTXZG005202@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Analysis:
LoopInfo.h updated: 1.57 -> 1.58
---
Log message:
Do not rely on std::sort and std::erase to get list of unique
exit blocks. The output is dependent on addresses of basic block.
Add and use Loop::getUniqueExitBlocks.
---
Diffs of the changes: (+6 -0)
LoopInfo.h | 6 ++++++
1 files changed, 6 insertions(+)
Index: llvm/include/llvm/Analysis/LoopInfo.h
diff -u llvm/include/llvm/Analysis/LoopInfo.h:1.57 llvm/include/llvm/Analysis/LoopInfo.h:1.58
--- llvm/include/llvm/Analysis/LoopInfo.h:1.57 Sun Jun 11 14:22:28 2006
+++ llvm/include/llvm/Analysis/LoopInfo.h Tue Aug 29 17:29:16 2006
@@ -112,6 +112,12 @@
///
void getExitBlocks(std::vector &Blocks) const;
+ /// getUniqueExitBlocks - Return all unique successor blocks of this loop.
+ /// These are the blocks _outside of the current loop_ which are branched to.
+ /// This assumes that loop is in canonical form.
+ ///
+ void getUniqueExitBlocks(std::vector &ExitBlocks) const;
+
/// getLoopPreheader - If there is a preheader for this loop, return it. A
/// loop has a preheader if there is only one edge to the header of the loop
/// from outside of the loop. If this is the case, the block branching to the
From dpatel at apple.com Tue Aug 29 17:29:33 2006
From: dpatel at apple.com (Devang Patel)
Date: Tue, 29 Aug 2006 17:29:33 -0500
Subject: [llvm-commits] CVS: llvm/lib/Analysis/LoopInfo.cpp
Message-ID: <200608292229.k7TMTXwr005207@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Analysis:
LoopInfo.cpp updated: 1.77 -> 1.78
---
Log message:
Do not rely on std::sort and std::erase to get list of unique
exit blocks. The output is dependent on addresses of basic block.
Add and use Loop::getUniqueExitBlocks.
---
Diffs of the changes: (+53 -0)
LoopInfo.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 53 insertions(+)
Index: llvm/lib/Analysis/LoopInfo.cpp
diff -u llvm/lib/Analysis/LoopInfo.cpp:1.77 llvm/lib/Analysis/LoopInfo.cpp:1.78
--- llvm/lib/Analysis/LoopInfo.cpp:1.77 Sun Aug 27 17:30:17 2006
+++ llvm/lib/Analysis/LoopInfo.cpp Tue Aug 29 17:29:16 2006
@@ -349,6 +349,59 @@
ExitBlocks.push_back(*I);
}
+/// getUniqueExitBlocks - Return all unique successor blocks of this loop. These
+/// are the blocks _outside of the current loop_ which are branched to. This
+/// assumes that loop is in canonical form.
+//
+void Loop::getUniqueExitBlocks(std::vector &ExitBlocks) const {
+ // Sort the blocks vector so that we can use binary search to do quick
+ // lookups.
+ std::vector LoopBBs(block_begin(), block_end());
+ std::sort(LoopBBs.begin(), LoopBBs.end());
+
+ std::vector switchExitBlocks;
+
+ for (std::vector::const_iterator BI = Blocks.begin(),
+ BE = Blocks.end(); BI != BE; ++BI) {
+
+ BasicBlock *current = *BI;
+ switchExitBlocks.clear();
+
+ for (succ_iterator I = succ_begin(*BI), E = succ_end(*BI); I != E; ++I) {
+ if (std::binary_search(LoopBBs.begin(), LoopBBs.end(), *I))
+ // If block is inside the loop then it is not a exit block.
+ continue;
+
+ pred_iterator PI = pred_begin(*I);
+ BasicBlock *firstPred = *PI;
+
+ // If current basic block is this exit block's first predecessor
+ // then only insert exit block in to the output ExitBlocks vector.
+ // This ensures that same exit block is not inserted twice into
+ // ExitBlocks vector.
+ if (current != firstPred)
+ continue;
+
+ // If a terminator has more then two successors, for example SwitchInst,
+ // then it is possible that there are multiple edges from current block
+ // to one exit block.
+ if (current->getTerminator()->getNumSuccessors() <= 2) {
+ ExitBlocks.push_back(*I);
+ continue;
+ }
+
+ // In case of multiple edges from current block to exit block, collect
+ // only one edge in ExitBlocks. Use switchExitBlocks to keep track of
+ // duplicate edges.
+ if (std::find(switchExitBlocks.begin(), switchExitBlocks.end(), *I)
+ == switchExitBlocks.end()) {
+ switchExitBlocks.push_back(*I);
+ ExitBlocks.push_back(*I);
+ }
+ }
+ }
+}
+
/// getLoopPreheader - If there is a preheader for this loop, return it. A
/// loop has a preheader if there is only one edge to the header of the loop
From lattner at cs.uiuc.edu Tue Aug 29 18:10:13 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 18:10:13 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/CodeGen/X86/shift-coalesce.ll
Message-ID: <200608292310.k7TNADgK005984@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/X86:
shift-coalesce.ll added (r1.1)
---
Log message:
new testcase for pr687: http://llvm.org/PR687
---
Diffs of the changes: (+11 -0)
shift-coalesce.ll | 11 +++++++++++
1 files changed, 11 insertions(+)
Index: llvm/test/Regression/CodeGen/X86/shift-coalesce.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/shift-coalesce.ll:1.1
*** /dev/null Tue Aug 29 18:10:09 2006
--- llvm/test/Regression/CodeGen/X86/shift-coalesce.ll Tue Aug 29 18:09:59 2006
***************
*** 0 ****
--- 1,11 ----
+ ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | grep 'shld.*CL' &&
+ ; RUN: llvm-as < %s | llc -march=x86 -x86-asm-syntax=intel | not grep 'mov CL, BL'
+
+ ; PR687
+
+ ulong %foo(ulong %x, long* %X) {
+ %tmp.1 = load long* %X ; [#uses=1]
+ %tmp.3 = cast long %tmp.1 to ubyte ; [#uses=1]
+ %tmp.4 = shl ulong %x, ubyte %tmp.3 ; [#uses=1]
+ ret ulong %tmp.4
+ }
From lattner at cs.uiuc.edu Tue Aug 29 18:18:30 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 18:18:30 -0500
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp
LiveIntervalAnalysis.cpp
Message-ID: <200608292318.k7TNIUaK006213@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
LiveInterval.cpp updated: 1.32 -> 1.33
LiveIntervalAnalysis.cpp updated: 1.171 -> 1.172
---
Log message:
Teach the coallescer to coallesce live intervals joined by an arbitrary
number of copies, potentially defining live ranges that appear to have
differing value numbers that become identical when coallsced. Among other
things, this fixes CodeGen/X86/shift-coalesce.ll and PR687: http://llvm.org/PR687 .
---
Diffs of the changes: (+249 -155)
LiveInterval.cpp | 189 ++++++++++++-----------------------------
LiveIntervalAnalysis.cpp | 215 +++++++++++++++++++++++++++++++++++++++++------
2 files changed, 249 insertions(+), 155 deletions(-)
Index: llvm/lib/CodeGen/LiveInterval.cpp
diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.32 llvm/lib/CodeGen/LiveInterval.cpp:1.33
--- llvm/lib/CodeGen/LiveInterval.cpp:1.32 Fri Aug 25 20:28:16 2006
+++ llvm/lib/CodeGen/LiveInterval.cpp Tue Aug 29 18:18:15 2006
@@ -101,101 +101,6 @@
return false;
}
-/// NontrivialOverlap - Check to see if the two live ranges specified by i and j
-/// overlap. If so, check to see if they have value numbers that are not
-/// iIdx/jIdx respectively. If both conditions are true, return true.
-static inline bool NontrivialOverlap(const LiveRange &I, const LiveRange &J,
- unsigned iIdx, unsigned jIdx) {
- if (I.start == J.start) {
- // If this is not the allowed value merge, we cannot join.
- if (I.ValId != iIdx || J.ValId != jIdx)
- return true;
- } else if (I.start < J.start) {
- if (I.end > J.start && (I.ValId != iIdx || J.ValId != jIdx)) {
- return true;
- }
- } else {
- if (J.end > I.start && (I.ValId != iIdx || J.ValId != jIdx))
- return true;
- }
-
- return false;
-}
-
-/// joinable - Two intervals are joinable if the either don't overlap at all
-/// or if the destination of the copy is a single assignment value, and it
-/// only overlaps with one value in the source interval.
-bool LiveInterval::joinable(const LiveInterval &other, unsigned CopyIdx) const {
- const LiveRange *SourceLR = other.getLiveRangeContaining(CopyIdx-1);
- const LiveRange *DestLR = getLiveRangeContaining(CopyIdx);
- assert(SourceLR && DestLR && "Not joining due to a copy?");
- unsigned OtherValIdx = SourceLR->ValId;
- unsigned ThisValIdx = DestLR->ValId;
-
- Ranges::const_iterator i = ranges.begin();
- Ranges::const_iterator ie = ranges.end();
- Ranges::const_iterator j = other.ranges.begin();
- Ranges::const_iterator je = other.ranges.end();
-
- if (i->start < j->start) {
- i = std::upper_bound(i, ie, j->start);
- if (i != ranges.begin()) --i;
- } else if (j->start < i->start) {
- j = std::upper_bound(j, je, i->start);
- if (j != other.ranges.begin()) --j;
- }
-
- while (i != ie && j != je) {
- if (NontrivialOverlap(*i, *j, ThisValIdx, OtherValIdx))
- return false;
-
- if (i->end < j->end)
- ++i;
- else
- ++j;
- }
-
- return true;
-}
-
-/// getOverlapingRanges - Given another live interval which is defined as a
-/// copy from this one, return a list of all of the live ranges where the
-/// two overlap and have different value numbers.
-void LiveInterval::getOverlapingRanges(const LiveInterval &other,
- unsigned CopyIdx,
- std::vector &Ranges) {
- const LiveRange *SourceLR = getLiveRangeContaining(CopyIdx-1);
- const LiveRange *DestLR = other.getLiveRangeContaining(CopyIdx);
- assert(SourceLR && DestLR && "Not joining due to a copy?");
- unsigned OtherValIdx = SourceLR->ValId;
- unsigned ThisValIdx = DestLR->ValId;
-
- Ranges::iterator i = ranges.begin();
- Ranges::iterator ie = ranges.end();
- Ranges::const_iterator j = other.ranges.begin();
- Ranges::const_iterator je = other.ranges.end();
-
- if (i->start < j->start) {
- i = std::upper_bound(i, ie, j->start);
- if (i != ranges.begin()) --i;
- } else if (j->start < i->start) {
- j = std::upper_bound(j, je, i->start);
- if (j != other.ranges.begin()) --j;
- }
-
- while (i != ie && j != je) {
- if (NontrivialOverlap(*i, *j, ThisValIdx, OtherValIdx))
- Ranges.push_back(&*i);
-
- if (i->end < j->end)
- ++i;
- else
- ++j;
- }
-}
-
-
-
/// extendIntervalEndTo - This method is used when we want to extend the range
/// specified by I to end at the specified endpoint. To do this, we should
/// merge and eliminate all ranges that this will overlap with. The iterator is
@@ -361,7 +266,7 @@
LiveInterval::iterator
LiveInterval::FindLiveRangeContaining(unsigned Idx) {
iterator It = std::upper_bound(begin(), end(), Idx);
- if (It != ranges.begin()) {
+ if (It != begin()) {
--It;
if (It->contains(Idx))
return It;
@@ -370,10 +275,13 @@
return end();
}
-/// join - Join two live intervals (this, and other) together. This operation
-/// is the result of a copy instruction in the source program, that occurs at
-/// index 'CopyIdx' that copies from 'Other' to 'this'.
-void LiveInterval::join(LiveInterval &Other, unsigned CopyIdx) {
+/// join - Join two live intervals (this, and other) together. This applies
+/// mappings to the value numbers in the LHS/RHS intervals as specified. If
+/// the intervals are not joinable, this aborts.
+void LiveInterval::join(LiveInterval &Other, int *LHSValNoAssignments,
+ int *RHSValNoAssignments,
+ SmallVector &NewInstDefiningValue) {
+
// Try to do the least amount of work possible. In particular, if there are
// more liverange chunks in the other set than there are in the 'this' set,
// swap sets to merge the fewest chunks in possible.
@@ -385,39 +293,61 @@
MRegisterInfo::isVirtualRegister(reg)) ||
MRegisterInfo::isPhysicalRegister(Other.reg)) {
swap(Other);
- std::swap(ThisOffs, OtherOffs);
+ std::swap(LHSValNoAssignments, RHSValNoAssignments);
}
-
- const LiveRange *SourceLR = Other.getLiveRangeContaining(CopyIdx-OtherOffs);
- const LiveRange *DestLR = getLiveRangeContaining(CopyIdx-ThisOffs);
- assert(SourceLR && DestLR && "Not joining due to a copy?");
- unsigned MergedSrcValIdx = SourceLR->ValId;
- unsigned MergedDstValIdx = DestLR->ValId;
- // Join the ranges of other into the ranges of this interval.
- std::map Dst2SrcIdxMap;
- iterator InsertPos = begin();
- for (iterator I = Other.begin(), E = Other.end(); I != E; ++I) {
- // Map the ValId in the other live range to the current live range.
- if (I->ValId == MergedSrcValIdx)
- I->ValId = MergedDstValIdx;
- else {
- unsigned &NV = Dst2SrcIdxMap[I->ValId];
- if (NV == 0) NV = getNextValue(Other.getInstForValNum(I->ValId));
- I->ValId = NV;
+ // Determine if any of our live range values are mapped. This is uncommon, so
+ // we want to avoid the interval scan if not.
+ bool MustMapCurValNos = false;
+ for (unsigned i = 0, e = getNumValNums(); i != e; ++i) {
+ if (InstDefiningValue[i] == ~2U) continue; // tombstone value #
+ if (i != (unsigned)LHSValNoAssignments[i]) {
+ MustMapCurValNos = true;
+ break;
}
-
- InsertPos = addRangeFrom(*I, InsertPos);
}
- // Update the value number information for the value number defined by the
- // copy. The copy is about to be removed, so ensure that the value is defined
- // by whatever the other value is defined by.
- if (InstDefiningValue[MergedDstValIdx] == CopyIdx) {
- InstDefiningValue[MergedDstValIdx] =
- Other.InstDefiningValue[MergedSrcValIdx];
+ // If we have to apply a mapping to our base interval assignment, rewrite it
+ // now.
+ if (MustMapCurValNos) {
+ // Map the first live range.
+ iterator OutIt = begin();
+ OutIt->ValId = LHSValNoAssignments[OutIt->ValId];
+ ++OutIt;
+ for (iterator I = OutIt, E = end(); I != E; ++I) {
+ OutIt->ValId = LHSValNoAssignments[I->ValId];
+
+ // If this live range has the same value # as its immediate predecessor,
+ // and if they are neighbors, remove one LiveRange. This happens when we
+ // have [0,3:0)[4,7:1) and map 0/1 onto the same value #.
+ if (OutIt->ValId == (OutIt-1)->ValId && (OutIt-1)->end == OutIt->start) {
+ (OutIt-1)->end = OutIt->end;
+ } else {
+ if (I != OutIt) {
+ OutIt->start = I->start;
+ OutIt->end = I->end;
+ }
+
+ // Didn't merge, on to the next one.
+ ++OutIt;
+ }
+ }
+
+ // If we merge some live ranges, chop off the end.
+ ranges.erase(OutIt, end());
}
+ // Okay, now insert the RHS live ranges into the LHS.
+ iterator InsertPos = begin();
+ for (iterator I = Other.begin(), E = Other.end(); I != E; ++I) {
+ // Map the ValId in the other live range to the current live range.
+ I->ValId = RHSValNoAssignments[I->ValId];
+ InsertPos = addRangeFrom(*I, InsertPos);
+ }
+
+ InstDefiningValue.clear();
+ InstDefiningValue.append(NewInstDefiningValue.begin(),
+ NewInstDefiningValue.end());
weight += Other.weight;
}
@@ -511,10 +441,9 @@
// Now that V1 is dead, remove it. If it is the largest value number, just
// nuke it (and any other deleted values neighboring it), otherwise mark it as
// ~1U so it can be nuked later.
- if (V1 == NumValues-1) {
+ if (V1 == getNumValNums()-1) {
do {
InstDefiningValue.pop_back();
- --NumValues;
} while (InstDefiningValue.back() == ~1U);
} else {
InstDefiningValue[V1] = ~1U;
@@ -548,9 +477,9 @@
}
// Print value number info.
- if (NumValues) {
+ if (getNumValNums()) {
OS << " ";
- for (unsigned i = 0; i != NumValues; ++i) {
+ for (unsigned i = 0; i != getNumValNums(); ++i) {
if (i) OS << " ";
OS << i << "@";
if (InstDefiningValue[i] == ~0U) {
Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.171 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.172
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.171 Sun Aug 27 17:30:17 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Tue Aug 29 18:18:15 2006
@@ -629,8 +629,9 @@
/// This returns true if an interval was modified.
///
bool LiveIntervals::AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB,
- MachineInstr *CopyMI,
- unsigned CopyIdx) {
+ MachineInstr *CopyMI) {
+ unsigned CopyIdx = getDefIndex(getInstructionIndex(CopyMI));
+
// BValNo is a value number in B that is defined by a copy from A. 'B3' in
// the example above.
LiveInterval::iterator BLR = IntB.FindLiveRangeContaining(CopyIdx);
@@ -768,34 +769,22 @@
std::cerr << " and "; DestInt.print(std::cerr, mri_);
std::cerr << ": ");
- // If two intervals contain a single value and are joined by a copy, it
- // does not matter if the intervals overlap, they can always be joined.
+ // Okay, attempt to join these two intervals. On failure, this returns false.
+ // Otherwise, if one of the intervals being joined is a physreg, this method
+ // always canonicalizes DestInt to be it. The output "SrcInt" will not have
+ // been modified, so we can use this information below to update aliases.
+ if (!JoinIntervals(DestInt, SrcInt)) {
+ // Coallescing failed.
+
+ // If we can eliminate the copy without merging the live ranges, do so now.
+ if (AdjustCopiesBackFrom(SrcInt, DestInt, CopyMI))
+ return true;
- bool Joinable = SrcInt.containsOneValue() && DestInt.containsOneValue();
-
- unsigned MIDefIdx = getDefIndex(getInstructionIndex(CopyMI));
-
- // If the intervals think that this is joinable, do so now.
- if (!Joinable && DestInt.joinable(SrcInt, MIDefIdx))
- Joinable = true;
-
- // If DestInt is actually a copy from SrcInt (which we know) that is used
- // to define another value of SrcInt, we can change the other range of
- // SrcInt to be the value of the range that defines DestInt, simplying the
- // interval an promoting coallescing.
- if (!Joinable && AdjustCopiesBackFrom(SrcInt, DestInt, CopyMI, MIDefIdx))
- return true;
-
- if (!Joinable) {
+ // Otherwise, we are unable to join the intervals.
DEBUG(std::cerr << "Interference!\n");
return false;
}
- // Okay, we can join these two intervals. If one of the intervals being
- // joined is a physreg, this method always canonicalizes DestInt to be it.
- // The output "SrcInt" will not have been modified.
- DestInt.join(SrcInt, MIDefIdx);
-
bool Swapped = SrcReg == DestInt.reg;
if (Swapped)
std::swap(SrcReg, DstReg);
@@ -823,6 +812,182 @@
return true;
}
+/// ComputeUltimateVN - Assuming we are going to join two live intervals,
+/// compute what the resultant value numbers for each value in the input two
+/// ranges will be. This is complicated by copies between the two which can
+/// and will commonly cause multiple value numbers to be merged into one.
+///
+/// VN is the value number that we're trying to resolve. InstDefiningValue
+/// keeps track of the new InstDefiningValue assignment for the result
+/// LiveInterval. ThisFromOther/OtherFromThis are sets that keep track of
+/// whether a value in this or other is a copy from the opposite set.
+/// ThisValNoAssignments/OtherValNoAssignments keep track of value #'s that have
+/// already been assigned.
+///
+/// ThisFromOther[x] - If x is defined as a copy from the other interval, this
+/// contains the value number the copy is from.
+///
+static unsigned ComputeUltimateVN(unsigned VN,
+ SmallVector &InstDefiningValue,
+ SmallVector &ThisFromOther,
+ SmallVector &OtherFromThis,
+ SmallVector &ThisValNoAssignments,
+ SmallVector &OtherValNoAssignments,
+ LiveInterval &ThisLI, LiveInterval &OtherLI) {
+ // If the VN has already been computed, just return it.
+ if (ThisValNoAssignments[VN] >= 0)
+ return ThisValNoAssignments[VN];
+ assert(ThisValNoAssignments[VN] != -2 && "FIXME: Cyclic case, handle it!");
+
+ // If this val is not a copy from the other val, then it must be a new value
+ // number in the destination.
+ int OtherValNo = ThisFromOther[VN];
+ if (OtherValNo == -1) {
+ InstDefiningValue.push_back(ThisLI.getInstForValNum(VN));
+ return ThisValNoAssignments[VN] = InstDefiningValue.size()-1;
+ }
+
+ // Otherwise, this *is* a copy from the RHS. Mark this value number as
+ // currently being computed, then ask what the ultimate value # of the other
+ // value is.
+ ThisValNoAssignments[VN] = -2;
+ unsigned UltimateVN =
+ ComputeUltimateVN(OtherValNo, InstDefiningValue,
+ OtherFromThis, ThisFromOther,
+ OtherValNoAssignments, ThisValNoAssignments,
+ OtherLI, ThisLI);
+ return ThisValNoAssignments[VN] = UltimateVN;
+}
+
+
+/// JoinIntervals - Attempt to join these two intervals. On failure, this
+/// returns false. Otherwise, if one of the intervals being joined is a
+/// physreg, this method always canonicalizes LHS to be it. The output
+/// "RHS" will not have been modified, so we can use this information
+/// below to update aliases.
+bool LiveIntervals::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) {
+ // Loop over the value numbers of the LHS, seeing if any are defined from the
+ // RHS.
+ SmallVector LHSValsDefinedFromRHS;
+ LHSValsDefinedFromRHS.resize(LHS.getNumValNums(), -1);
+ for (unsigned VN = 0, e = LHS.getNumValNums(); VN != e; ++VN) {
+ unsigned ValInst = LHS.getInstForValNum(VN);
+ if (ValInst == ~0U || ValInst == ~1U)
+ continue;
+
+ // If the instruction defining the LHS's value is a copy.
+ MachineInstr *ValInstMI = getInstructionFromIndex(ValInst);
+
+ // If the value number is not defined by a copy instruction, ignore it.
+ unsigned SrcReg, DstReg;
+ if (!tii_->isMoveInstr(*ValInstMI, SrcReg, DstReg))
+ continue;
+
+ // DstReg is known to be a register in the LHS interval. If the src is from
+ // the RHS interval, we can use its value #.
+ if (rep(SrcReg) != RHS.reg)
+ continue;
+
+ // Figure out the value # from the RHS.
+ LHSValsDefinedFromRHS[VN] = RHS.getLiveRangeContaining(ValInst-1)->ValId;
+ }
+
+ // Loop over the value numbers of the RHS, seeing if any are defined from the
+ // LHS.
+ SmallVector RHSValsDefinedFromLHS;
+ RHSValsDefinedFromLHS.resize(RHS.getNumValNums(), -1);
+ for (unsigned VN = 0, e = RHS.getNumValNums(); VN != e; ++VN) {
+ unsigned ValInst = RHS.getInstForValNum(VN);
+ if (ValInst == ~0U || ValInst == ~1U)
+ continue;
+
+ // If the instruction defining the RHS's value is a copy.
+ MachineInstr *ValInstMI = getInstructionFromIndex(ValInst);
+
+ // If the value number is not defined by a copy instruction, ignore it.
+ unsigned SrcReg, DstReg;
+ if (!tii_->isMoveInstr(*ValInstMI, SrcReg, DstReg))
+ continue;
+
+ // DstReg is known to be a register in the RHS interval. If the src is from
+ // the LHS interval, we can use its value #.
+ if (rep(SrcReg) != LHS.reg)
+ continue;
+
+ // Figure out the value # from the LHS.
+ RHSValsDefinedFromLHS[VN] = LHS.getLiveRangeContaining(ValInst-1)->ValId;
+ }
+
+ // Now that we know the value mapping, compute the final value assignment,
+ // assuming that the live ranges can be coallesced.
+ SmallVector LHSValNoAssignments;
+ SmallVector RHSValNoAssignments;
+ SmallVector InstDefiningValue;
+ LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
+ RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
+
+ // Compute ultimate value numbers for the LHS and RHS values.
+ for (unsigned VN = 0, e = LHS.getNumValNums(); VN != e; ++VN) {
+ if (LHS.getInstForValNum(VN) == ~2U) continue;
+ ComputeUltimateVN(VN, InstDefiningValue,
+ LHSValsDefinedFromRHS, RHSValsDefinedFromLHS,
+ LHSValNoAssignments, RHSValNoAssignments, LHS, RHS);
+ }
+ for (unsigned VN = 0, e = RHS.getNumValNums(); VN != e; ++VN) {
+ if (RHS.getInstForValNum(VN) == ~2U) continue;
+ ComputeUltimateVN(VN, InstDefiningValue,
+ RHSValsDefinedFromLHS, LHSValsDefinedFromRHS,
+ RHSValNoAssignments, LHSValNoAssignments, RHS, LHS);
+ }
+
+ // Armed with the mappings of LHS/RHS values to ultimate values, walk the
+ // interval lists to see if these intervals are coallescable.
+ LiveInterval::const_iterator I = LHS.begin();
+ LiveInterval::const_iterator IE = LHS.end();
+ LiveInterval::const_iterator J = RHS.begin();
+ LiveInterval::const_iterator JE = RHS.end();
+
+ // Skip ahead until the first place of potential sharing.
+ if (I->start < J->start) {
+ I = std::upper_bound(I, IE, J->start);
+ if (I != LHS.begin()) --I;
+ } else if (J->start < I->start) {
+ J = std::upper_bound(J, JE, I->start);
+ if (J != RHS.begin()) --J;
+ }
+
+ while (1) {
+ // Determine if these two live ranges overlap.
+ bool Overlaps;
+ if (I->start < J->start) {
+ Overlaps = I->end > J->start;
+ } else {
+ Overlaps = J->end > I->start;
+ }
+
+ // If so, check value # info to determine if they are really different.
+ if (Overlaps) {
+ // If the live range overlap will map to the same value number in the
+ // result liverange, we can still coallesce them. If not, we can't.
+ if (LHSValNoAssignments[I->ValId] != RHSValNoAssignments[J->ValId])
+ return false;
+ }
+
+ if (I->end < J->end) {
+ ++I;
+ if (I == IE) break;
+ } else {
+ ++J;
+ if (J == JE) break;
+ }
+ }
+
+ // If we get here, we know that we can coallesce the live ranges. Ask the
+ // intervals to coallesce themselves now.
+ LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0],
+ InstDefiningValue);
+ return true;
+}
namespace {
From lattner at cs.uiuc.edu Tue Aug 29 18:18:13 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 18:18:13 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveInterval.h
LiveIntervalAnalysis.h
Message-ID: <200608292318.k7TNIDRl006184@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
LiveInterval.h updated: 1.21 -> 1.22
LiveIntervalAnalysis.h updated: 1.54 -> 1.55
---
Log message:
Teach the coallescer to coallesce live intervals joined by an arbitrary
number of copies, potentially defining live ranges that appear to have
differing value numbers that become identical when coallsced. Among other
things, this fixes CodeGen/X86/shift-coalesce.ll and PR687: http://llvm.org/PR687 .
---
Diffs of the changes: (+19 -18)
LiveInterval.h | 28 +++++++++++-----------------
LiveIntervalAnalysis.h | 9 ++++++++-
2 files changed, 19 insertions(+), 18 deletions(-)
Index: llvm/include/llvm/CodeGen/LiveInterval.h
diff -u llvm/include/llvm/CodeGen/LiveInterval.h:1.21 llvm/include/llvm/CodeGen/LiveInterval.h:1.22
--- llvm/include/llvm/CodeGen/LiveInterval.h:1.21 Fri Aug 25 18:41:24 2006
+++ llvm/include/llvm/CodeGen/LiveInterval.h Tue Aug 29 18:17:59 2006
@@ -78,8 +78,6 @@
float weight; // weight of this interval
Ranges ranges; // the ranges in which this register is live
private:
- unsigned NumValues; // the number of distinct values in this interval.
-
/// InstDefiningValue - This tracks the def index of the instruction that
/// defines a particular value number in the interval. This may be ~0,
/// which is treated as unknown, or ~1, which is a deleted value number.
@@ -87,7 +85,7 @@
public:
LiveInterval(unsigned Reg, float Weight)
- : reg(Reg), weight(Weight), NumValues(0) {
+ : reg(Reg), weight(Weight) {
}
typedef Ranges::iterator iterator;
@@ -115,24 +113,24 @@
std::swap(reg, other.reg);
std::swap(weight, other.weight);
std::swap(ranges, other.ranges);
- std::swap(NumValues, other.NumValues);
std::swap(InstDefiningValue, other.InstDefiningValue);
}
- bool containsOneValue() const { return NumValues == 1; }
+ bool containsOneValue() const { return InstDefiningValue.size() == 1; }
- unsigned getNumValNums() const { return NumValues; }
+ unsigned getNumValNums() const { return InstDefiningValue.size(); }
/// getNextValue - Create a new value number and return it. MIIdx specifies
/// the instruction that defines the value number.
unsigned getNextValue(unsigned MIIdx) {
InstDefiningValue.push_back(MIIdx);
- return NumValues++;
+ return InstDefiningValue.size()-1;
}
/// getInstForValNum - Return the machine instruction index that defines the
/// specified value number.
unsigned getInstForValNum(unsigned ValNo) const {
+ assert(ValNo < InstDefiningValue.size());
return InstDefiningValue[ValNo];
}
@@ -189,11 +187,6 @@
/// contains the specified index, or end() if there is none.
iterator FindLiveRangeContaining(unsigned Idx);
- /// joinable - Two intervals are joinable if the either don't overlap at all
- /// or if the destination of the copy is a single assignment value, and it
- /// only overlaps with one value in the source interval.
- bool joinable(const LiveInterval& other, unsigned CopyIdx) const;
-
/// getOverlapingRanges - Given another live interval which is defined as a
/// copy from this one, return a list of all of the live ranges where the
/// two overlap and have different value numbers.
@@ -218,11 +211,12 @@
addRangeFrom(LR, ranges.begin());
}
- /// join - Join two live intervals (this, and other) together. This
- /// operation is the result of a copy instruction in the source program,
- /// that occurs at index 'CopyIdx' that copies from 'other' to 'this'. This
- /// destroys 'other'.
- void join(LiveInterval& other, unsigned CopyIdx);
+ /// join - Join two live intervals (this, and other) together. This applies
+ /// mappings to the value numbers in the LHS/RHS intervals as specified. If
+ /// the intervals are not joinable, this aborts.
+ void join(LiveInterval &Other, int *ValNoAssignments,
+ int *RHSValNoAssignments,
+ SmallVector &NewInstDefiningValue);
/// removeRange - Remove the specified range from this interval. Note that
Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.54 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.55
--- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.54 Thu Aug 24 17:43:55 2006
+++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h Tue Aug 29 18:17:59 2006
@@ -174,6 +174,13 @@
/// it may be possible if other things get coallesced.
bool JoinCopy(MachineInstr *CopyMI, unsigned SrcReg, unsigned DstReg);
+ /// JoinIntervals - Attempt to join these two intervals. On failure, this
+ /// returns false. Otherwise, if one of the intervals being joined is a
+ /// physreg, this method always canonicalizes DestInt to be it. The output
+ /// "SrcInt" will not have been modified, so we can use this information
+ /// below to update aliases.
+ bool JoinIntervals(LiveInterval &LHS, LiveInterval &RHS);
+
/// handleRegisterDef - update intervals for a register def
/// (calls handlePhysicalRegisterDef and
/// handleVirtualRegisterDef)
@@ -200,7 +207,7 @@
bool AdjustCopiesBackFrom(LiveInterval &IntA, LiveInterval &IntB,
- MachineInstr *CopyMI, unsigned CopyIdx);
+ MachineInstr *CopyMI);
bool overlapsAliases(const LiveInterval *lhs,
const LiveInterval *rhs) const;
From lattner at cs.uiuc.edu Tue Aug 29 18:38:34 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 18:38:34 -0500
Subject: [llvm-commits] CVS: llvm/tools/bugpoint/ExtractFunction.cpp
Message-ID: <200608292338.k7TNcY35006655@zion.cs.uiuc.edu>
Changes in directory llvm/tools/bugpoint:
ExtractFunction.cpp updated: 1.51 -> 1.52
---
Log message:
Code cleanups, no functionality change.
---
Diffs of the changes: (+30 -36)
ExtractFunction.cpp | 66 +++++++++++++++++++++++-----------------------------
1 files changed, 30 insertions(+), 36 deletions(-)
Index: llvm/tools/bugpoint/ExtractFunction.cpp
diff -u llvm/tools/bugpoint/ExtractFunction.cpp:1.51 llvm/tools/bugpoint/ExtractFunction.cpp:1.52
--- llvm/tools/bugpoint/ExtractFunction.cpp:1.51 Sun Aug 27 17:42:52 2006
+++ llvm/tools/bugpoint/ExtractFunction.cpp Tue Aug 29 18:38:20 2006
@@ -248,11 +248,11 @@
}
}
-//// RewriteUsesInNewModule - takes a Module and a reference to a globalvalue
-//// (OrigVal) in that module and changes the reference to a different
-//// globalvalue (NewVal) in a seperate module.
+/// RewriteUsesInNewModule - Given a constant 'OrigVal' and a module 'OrigMod',
+/// find all uses of the constant. If they are not in the specified module,
+/// replace them with uses of another constant 'NewVal'.
static void RewriteUsesInNewModule(Constant *OrigVal, Constant *NewVal,
- Module *TargetMod) {
+ Module *OrigMod) {
assert(OrigVal->getType() == NewVal->getType() &&
"Can't replace something with a different type");
for (Value::use_iterator UI = OrigVal->use_begin(), E = OrigVal->use_end();
@@ -260,20 +260,17 @@
Value::use_iterator TmpUI = UI++;
User *U = *TmpUI;
if (Instruction *Inst = dyn_cast(U)) {
- Module *InstM = Inst->getParent()->getParent()->getParent();
- if (InstM != TargetMod) {
- TmpUI.getUse() = NewVal;
- }
+ if (Inst->getParent()->getParent()->getParent() != OrigMod)
+ TmpUI.getUse() = NewVal;
} else if (GlobalVariable *GV = dyn_cast(U)) {
- if (GV->getParent() != TargetMod) {
+ if (GV->getParent() != OrigMod)
TmpUI.getUse() = NewVal;
- }
} else if (ConstantExpr *CE = dyn_cast(U)) {
// If nothing uses this, don't bother making a copy.
if (CE->use_empty()) continue;
Constant *NewCE = CE->getWithOperandReplaced(TmpUI.getOperandNo(),
NewVal);
- RewriteUsesInNewModule(CE, NewCE, TargetMod);
+ RewriteUsesInNewModule(CE, NewCE, OrigMod);
} else if (ConstantStruct *CS = dyn_cast(U)) {
// If nothing uses this, don't bother making a copy.
if (CS->use_empty()) continue;
@@ -282,7 +279,7 @@
for (unsigned i = 0, e = CS->getNumOperands(); i != e; ++i)
Ops.push_back(i == OpNo ? NewVal : CS->getOperand(i));
Constant *NewStruct = ConstantStruct::get(Ops);
- RewriteUsesInNewModule(CS, NewStruct, TargetMod);
+ RewriteUsesInNewModule(CS, NewStruct, OrigMod);
} else if (ConstantPacked *CP = dyn_cast(U)) {
// If nothing uses this, don't bother making a copy.
if (CP->use_empty()) continue;
@@ -291,7 +288,7 @@
for (unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
Ops.push_back(i == OpNo ? NewVal : CP->getOperand(i));
Constant *NewPacked = ConstantPacked::get(Ops);
- RewriteUsesInNewModule(CP, NewPacked, TargetMod);
+ RewriteUsesInNewModule(CP, NewPacked, OrigMod);
} else if (ConstantArray *CA = dyn_cast(U)) {
// If nothing uses this, don't bother making a copy.
if (CA->use_empty()) continue;
@@ -301,7 +298,7 @@
Ops.push_back(i == OpNo ? NewVal : CA->getOperand(i));
}
Constant *NewArray = ConstantArray::get(CA->getType(), Ops);
- RewriteUsesInNewModule(CA, NewArray, TargetMod);
+ RewriteUsesInNewModule(CA, NewArray, OrigMod);
} else {
assert(0 && "Unexpected user");
}
@@ -345,42 +342,38 @@
// Adding specified functions to new module...
for (Module::iterator I = M->begin(), E = M->end(); I != E;) {
OrigGlobals.push_back(I);
- if(TestFunctions.count(std::make_pair(I->getName(), I->getType()))) {
+ if (TestFunctions.count(std::make_pair(I->getName(), I->getType()))) {
Module::iterator tempI = I;
I++;
- Function * func = new Function(tempI->getFunctionType(),
+ Function *Func = new Function(tempI->getFunctionType(),
GlobalValue::ExternalLinkage);
- M->getFunctionList().insert(tempI, func);
+ M->getFunctionList().insert(tempI, Func);
New->getFunctionList().splice(New->end(),
M->getFunctionList(),
tempI);
- func->setName(tempI->getName());
- func->setCallingConv(tempI->getCallingConv());
- GlobalToPrototypeMap[tempI] = func;
- // NEW TO OLD
+ Func->setName(tempI->getName());
+ Func->setCallingConv(tempI->getCallingConv());
+ GlobalToPrototypeMap[tempI] = Func;
} else {
- Function * func = new Function(I->getFunctionType(),
+ Function *Func = new Function(I->getFunctionType(),
GlobalValue::ExternalLinkage,
I->getName(),
New);
- func->setCallingConv(I->getCallingConv());
- GlobalToPrototypeMap[I] = func;
- // NEW TO OLD
+ Func->setCallingConv(I->getCallingConv());
+ GlobalToPrototypeMap[I] = Func;
I++;
}
}
- //copy over global list
- for (Module::global_iterator I = M->global_begin(),
- E = M->global_end(); I != E; ++I) {
+ // Copy over global variable list.
+ for (Module::global_iterator I = M->global_begin(), E = M->global_end();
+ I != E; ++I) {
OrigGlobals.push_back(I);
- GlobalVariable *glob = new GlobalVariable (I->getType()->getElementType(),
- I->isConstant(),
- GlobalValue::ExternalLinkage,
- 0,
- I->getName(),
- New);
- GlobalToPrototypeMap[I] = glob;
+ GlobalVariable *G = new GlobalVariable(I->getType()->getElementType(),
+ I->isConstant(),
+ GlobalValue::ExternalLinkage,
+ 0, I->getName(), New);
+ GlobalToPrototypeMap[I] = G;
}
// Copy all of the type symbol table entries over.
@@ -394,7 +387,8 @@
// the prototype.
for (unsigned i = 0, e = OrigGlobals.size(); i != e; ++i) {
assert(OrigGlobals[i]->getName() ==
- GlobalToPrototypeMap[OrigGlobals[i]]->getName());
+ GlobalToPrototypeMap[OrigGlobals[i]]->getName() &&
+ "Something got renamed?");
RewriteUsesInNewModule(OrigGlobals[i], GlobalToPrototypeMap[OrigGlobals[i]],
OrigGlobals[i]->getParent());
}
From nicholas at mxc.ca Tue Aug 29 21:47:02 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Tue, 29 Aug 2006 21:47:02 -0500
Subject: [llvm-commits]
CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Message-ID: <200608300247.k7U2l2T5009997@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
PredicateSimplifier.cpp updated: 1.1 -> 1.2
---
Log message:
Move to using the EquivalenceClass ADT. Removes SynSets.
If a branch's condition has become a ConstantBool, simplify it immediately.
Removing the edge saves work and exposes up more optimization opportunities
in the pass.
Add support for SelectInst.
---
Diffs of the changes: (+92 -165)
PredicateSimplifier.cpp | 257 +++++++++++++++++-------------------------------
1 files changed, 92 insertions(+), 165 deletions(-)
Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.1 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.2
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.1 Mon Aug 28 17:44:55 2006
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Tue Aug 29 21:46:48 2006
@@ -23,26 +23,20 @@
//===------------------------------------------------------------------===//
//
// This optimization works by substituting %q for %p when protected by a
-// conditional that assures us of that fact. Equivalent variables are
-// called SynSets; sets of synonyms. We maintain a mapping from Value *
-// to the SynSet, and the SynSet maintains the best canonical form of the
-// Value.
-//
-// Properties are stored as relationships between two SynSets.
+// conditional that assures us of that fact. Properties are stored as
+// relationships between two values.
//
//===------------------------------------------------------------------===//
// TODO:
-// * Handle SelectInst
-// * Switch to EquivalenceClasses ADT
// * Check handling of NAN in floating point types
-// * Don't descend into false side of branches with ConstantBool condition.
#define DEBUG_TYPE "predsimplify"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
#include "llvm/Pass.h"
+#include "llvm/ADT/EquivalenceClasses.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/Dominators.h"
@@ -55,9 +49,11 @@
Statistic<>
NumVarsReplaced("predsimplify", "Number of argument substitutions");
Statistic<>
- NumResolved("predsimplify", "Number of instruction substitutions");
+ NumInstruction("predsimplify", "Number of instructions removed");
Statistic<>
NumSwitchCases("predsimplify", "Number of switch cases removed");
+ Statistic<>
+ NumBranches("predsimplify", "Number of branches made unconditional");
/// Used for choosing the canonical Value in a synonym set.
/// Leaves the better one in V1. Returns whether a swap took place.
@@ -89,10 +85,8 @@
/// and fast lookup. Also stores the set of inequality relationships.
class PropertySet {
struct Property;
+ class EquivalenceClasses union_find;
public:
- typedef unsigned SynSet;
- typedef std::map::iterator SynonymIterator;
- typedef std::map::const_iterator ConstSynonymIterator;
typedef std::vector::iterator PropertyIterator;
typedef std::vector::const_iterator ConstPropertyIterator;
@@ -107,133 +101,44 @@
}
Value *lookup(Value *V) const {
- ConstSynonymIterator SI = SynonymMap.find(V);
- if (SI == SynonymMap.end()) return NULL;
-
- return Synonyms[SI->second];
- }
-
- Value *lookup(SynSet SS) const {
- assert(SS < Synonyms.size());
- return Synonyms[SS];
- }
-
- // Find a SynSet for a given Value.
- //
- // Given the Value *V sets SS to a valid SynSet. Returns true if it
- // found it.
- bool findSynSet(Value *V, SynSet &SS) const {
- ConstSynonymIterator SI = SynonymMap.find(V);
- if (SI != SynonymMap.end()) {
- SS = SI->second;
- return true;
- }
-
- std::vector::const_iterator I =
- std::find(Synonyms.begin(), Synonyms.end(), V);
- if (I != Synonyms.end()) {
- SS = I-Synonyms.begin();
- return true;
- }
-
- return false;
+ EquivalenceClasses::member_iterator SI =
+ union_find.findLeader(V);
+ if (SI == union_find.member_end()) return NULL;
+ return *SI;
}
bool empty() const {
- return Synonyms.empty();
+ return union_find.empty();
}
void addEqual(Value *V1, Value *V2) {
order(V1, V2);
if (isa(V2)) return; // refuse to set false == true.
- V1 = canonicalize(V1);
- V2 = canonicalize(V2);
-
- if (V1 == V2) return; // already equivalent.
-
- SynSet I1, I2;
- bool F1 = findSynSet(V1, I1),
- F2 = findSynSet(V2, I2);
-
- DEBUG(std::cerr << "V1: " << *V1 << " I1: " << I1
- << " F1: " << F1 << "\n");
- DEBUG(std::cerr << "V2: " << *V2 << " I2: " << I2
- << " F2: " << F2 << "\n");
-
- if (!F1 && !F2) {
- SynSet SS = addSynSet(V1);
- SynonymMap[V1] = SS;
- SynonymMap[V2] = SS;
- }
-
- else if (!F1 && F2) {
- SynonymMap[V1] = I2;
- }
-
- else if (F1 && !F2) {
- SynonymMap[V2] = I1;
- }
-
- else {
- // This is the case where we have two sets, [%a1, %a2, %a3] and
- // [%p1, %p2, %p3] and someone says that %a2 == %p3. We need to
- // combine the two synsets.
-
- // Collapse synonyms of V2 into V1.
- for (SynonymIterator I = SynonymMap.begin(), E = SynonymMap.end();
- I != E; ++I) {
- if (I->second == I2) I->second = I1;
- else if (I->second > I2) --I->second;
- }
-
- // Move Properties
- for (PropertyIterator I = Properties.begin(), E = Properties.end();
- I != E; ++I) {
- if (I->S1 == I2) I->S1 = I1;
- else if (I->S1 > I2) --I->S1;
- if (I->S2 == I2) I->S2 = I1;
- else if (I->S2 > I2) --I->S2;
- }
-
- // Remove the synonym
- Synonyms.erase(Synonyms.begin() + I2);
- }
-
+ union_find.unionSets(V1, V2);
addImpliedProperties(EQ, V1, V2);
}
void addNotEqual(Value *V1, Value *V2) {
DEBUG(std::cerr << "not equal: " << *V1 << " and " << *V2 << "\n");
- bool skip_search = false;
V1 = canonicalize(V1);
V2 = canonicalize(V2);
- SynSet S1, S2;
- if (!findSynSet(V1, S1)) {
- skip_search = true;
- S1 = addSynSet(V1);
- }
- if (!findSynSet(V2, S2)) {
- skip_search = true;
- S2 = addSynSet(V2);
- }
+ // Does the property already exist?
+ for (PropertyIterator I = Properties.begin(), E = Properties.end();
+ I != E; ++I) {
+ if (I->Opcode != NE) continue;
- if (!skip_search) {
- // Does the property already exist?
- for (PropertyIterator I = Properties.begin(), E = Properties.end();
- I != E; ++I) {
- if (I->Opcode != NE) continue;
-
- if ((I->S1 == S1 && I->S2 == S2) ||
- (I->S1 == S2 && I->S2 == S1)) {
- return; // Found.
- }
+ I->V1 = canonicalize(I->V1);
+ I->V2 = canonicalize(I->V2);
+ if ((I->V1 == V1 && I->V2 == V2) ||
+ (I->V1 == V2 && I->V2 == V1)) {
+ return; // Found.
}
}
// Add the property.
- Properties.push_back(Property(NE, S1, S2));
+ Properties.push_back(Property(NE, V1, V2));
addImpliedProperties(NE, V1, V2);
}
@@ -241,17 +146,19 @@
assert(Opcode != EQ && "Can't findProperty on EQ."
"Use the lookup method instead.");
- SynSet S1, S2;
- if (!findSynSet(V1, S1)) return Properties.end();
- if (!findSynSet(V2, S2)) return Properties.end();
+ V1 = lookup(V1);
+ V2 = lookup(V2);
+ if (!V1 || !V2) return Properties.end();
// Does the property already exist?
for (PropertyIterator I = Properties.begin(), E = Properties.end();
I != E; ++I) {
if (I->Opcode != Opcode) continue;
- if ((I->S1 == S1 && I->S2 == S2) ||
- (I->S1 == S2 && I->S2 == S1)) {
+ I->V1 = canonicalize(I->V1);
+ I->V2 = canonicalize(I->V2);
+ if ((I->V1 == V1 && I->V2 == V2) ||
+ (I->V1 == V2 && I->V2 == V1)) {
return I; // Found.
}
}
@@ -263,17 +170,20 @@
assert(Opcode != EQ && "Can't findProperty on EQ."
"Use the lookup method instead.");
- SynSet S1, S2;
- if (!findSynSet(V1, S1)) return Properties.end();
- if (!findSynSet(V2, S2)) return Properties.end();
+ V1 = lookup(V1);
+ V2 = lookup(V2);
+ if (!V1 || !V2) return Properties.end();
// Does the property already exist?
for (ConstPropertyIterator I = Properties.begin(),
E = Properties.end(); I != E; ++I) {
if (I->Opcode != Opcode) continue;
- if ((I->S1 == S1 && I->S2 == S2) ||
- (I->S1 == S2 && I->S2 == S1)) {
+ Value *v1 = lookup(I->V1),
+ *v2 = lookup(I->V2);
+ if (!v1 || !v2) continue;
+ if ((v1 == V1 && v2 == V2) ||
+ (v1 == V2 && v2 == V1)) {
return I; // Found.
}
}
@@ -284,26 +194,21 @@
// Represents Head OP [Tail1, Tail2, ...]
// For example: %x != %a, %x != %b.
struct Property {
- Property(Ops opcode, SynSet s1, SynSet s2)
- : Opcode(opcode), S1(s1), S2(s2)
+ Property(Ops opcode, Value *v1, Value *v2)
+ : Opcode(opcode), V1(v1), V2(v2)
{ assert(opcode != EQ && "Equality belongs in the synonym set,"
"not a property."); }
bool operator<(const Property &rhs) const {
if (Opcode != rhs.Opcode) return Opcode < rhs.Opcode;
- if (S1 != rhs.S1) return S1 < rhs.S1;
- return S2 < rhs.S2;
+ if (V1 != rhs.V1) return V1 < rhs.V1;
+ return V2 < rhs.V2;
}
Ops Opcode;
- SynSet S1, S2;
+ Value *V1, *V2;
};
- SynSet addSynSet(Value *V) {
- Synonyms.push_back(V);
- return Synonyms.size()-1;
- }
-
void add(Ops Opcode, Value *V1, Value *V2, bool invert) {
switch (Opcode) {
case EQ:
@@ -386,19 +291,6 @@
public:
void debug(std::ostream &os) const {
- os << Synonyms.size() << " synsets:\n";
- for (unsigned I = 0, E = Synonyms.size(); I != E; ++I) {
- os << I << ". " << *Synonyms[I] << "\n";
- }
- for (ConstSynonymIterator I = SynonymMap.begin(),E = SynonymMap.end();
- I != E; ++I) {
- os << *I->first << "-> #" << I->second << "\n";
- }
- os << Properties.size() << " properties:\n";
- for (unsigned I = 0, E = Properties.size(); I != E; ++I) {
- os << I << ". (" << Properties[I].Opcode << ","
- << Properties[I].S1 << "," << Properties[I].S2 << ")\n";
- }
}
std::vector Properties;
@@ -416,6 +308,7 @@
// Try to replace the Use of the instruction with something simpler.
Value *resolve(SetCondInst *SCI, const PropertySet &);
Value *resolve(BinaryOperator *BO, const PropertySet &);
+ Value *resolve(SelectInst *SI, const PropertySet &);
Value *resolve(Value *V, const PropertySet &);
// Used by terminator instructions to proceed from the current basic
@@ -546,6 +439,15 @@
return BO;
}
+Value *PredicateSimplifier::resolve(SelectInst *SI, const PropertySet &KP) {
+ Value *Condition = resolve(SI->getCondition(), KP);
+ if (Condition == ConstantBool::True)
+ return resolve(SI->getTrueValue(), KP);
+ else if (Condition == ConstantBool::False)
+ return resolve(SI->getFalseValue(), KP);
+ return SI;
+}
+
Value *PredicateSimplifier::resolve(Value *V, const PropertySet &KP) {
if (isa(V) || isa(V) || KP.empty()) return V;
@@ -553,6 +455,8 @@
if (BinaryOperator *BO = dyn_cast(V))
return resolve(BO, KP);
+ else if (SelectInst *SI = dyn_cast(V))
+ return resolve(SI, KP);
return V;
}
@@ -588,7 +492,7 @@
assert(V && "resolve not supposed to return NULL.");
if (V != I) {
modified = true;
- ++NumResolved;
+ ++NumInstruction;
I->replaceAllUsesWith(V);
I->eraseFromParent();
}
@@ -645,15 +549,31 @@
Value *Condition = BI->getCondition();
+ BasicBlock *TrueDest = BI->getSuccessor(0),
+ *FalseDest = BI->getSuccessor(1);
+
+ if (Condition == ConstantBool::True) {
+ FalseDest->removePredecessor(BI->getParent());
+ BI->setUnconditionalDest(TrueDest);
+ modified = true;
+ ++NumBranches;
+ proceedToSuccessor(KP, Node, DT->getNode(TrueDest));
+ return;
+ } else if (Condition == ConstantBool::False) {
+ TrueDest->removePredecessor(BI->getParent());
+ BI->setUnconditionalDest(FalseDest);
+ modified = true;
+ ++NumBranches;
+ proceedToSuccessor(KP, Node, DT->getNode(FalseDest));
+ return;
+ }
+
PropertySet TrueProperties(KP), FalseProperties(KP);
DEBUG(std::cerr << "true set:\n");
TrueProperties.addEqual(ConstantBool::True, Condition);
DEBUG(std::cerr << "false set:\n");
FalseProperties.addEqual(ConstantBool::False, Condition);
- BasicBlock *TrueDest = BI->getSuccessor(0),
- *FalseDest = BI->getSuccessor(1);
-
PropertySet KPcopy(KP);
proceedToSuccessor(KP, TrueProperties, Node, DT->getNode(TrueDest));
proceedToSuccessor(KPcopy, FalseProperties, Node, DT->getNode(FalseDest));
@@ -665,17 +585,18 @@
// If there's an NEProperty covering this SwitchInst, we may be able to
// eliminate one of the cases.
- PropertySet::SynSet S;
-
- if (KP.findSynSet(Condition, S)) {
+ if (Value *C = KP.lookup(Condition)) {
+ Condition = C;
for (PropertySet::ConstPropertyIterator I = KP.Properties.begin(),
E = KP.Properties.end(); I != E; ++I) {
if (I->Opcode != PropertySet::NE) continue;
- if (I->S1 != S && I->S2 != S) continue;
+ Value *V1 = KP.lookup(I->V1),
+ *V2 = KP.lookup(I->V2);
+ if (V1 != C && V2 != C) continue;
// Is one side a number?
- ConstantInt *CI = dyn_cast(KP.lookup(I->S1));
- if (!CI) CI = dyn_cast(KP.lookup(I->S2));
+ ConstantInt *CI = dyn_cast(KP.lookup(I->V1));
+ if (!CI) CI = dyn_cast(KP.lookup(I->V2));
if (CI) {
unsigned i = SI->findCaseValue(CI);
@@ -732,11 +653,17 @@
void PredicateSimplifier::visit(BinaryOperator *BO,
DominatorTree::Node *, PropertySet &KP) {
Instruction::BinaryOps ops = BO->getOpcode();
- if (ops != Instruction::Div && ops != Instruction::Rem) return;
- Value *Divisor = BO->getOperand(1);
- const Type *Ty = cast(Divisor->getType());
- KP.addNotEqual(Constant::getNullValue(Ty), Divisor);
+ switch (ops) {
+ case Instruction::Div:
+ case Instruction::Rem: {
+ Value *Divisor = BO->getOperand(1);
+ KP.addNotEqual(Constant::getNullValue(Divisor->getType()), Divisor);
+ break;
+ }
+ default:
+ break;
+ }
// Some other things we could do:
// In f=x*y, if x != 1 && y != 1 then f != x && f != y.
From lattner at cs.uiuc.edu Tue Aug 29 23:17:14 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 23:17:14 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/ADT/Statistic.h
Message-ID: <200608300417.k7U4HEIs011508@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/ADT:
Statistic.h updated: 1.16 -> 1.17
---
Log message:
Instantiate Statistic<> in one place, not in every .o file that uses it.
---
Diffs of the changes: (+4 -1)
Statistic.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletion(-)
Index: llvm/include/llvm/ADT/Statistic.h
diff -u llvm/include/llvm/ADT/Statistic.h:1.16 llvm/include/llvm/ADT/Statistic.h:1.17
--- llvm/include/llvm/ADT/Statistic.h:1.16 Wed Jun 21 11:53:47 2006
+++ llvm/include/llvm/ADT/Statistic.h Tue Aug 29 23:17:00 2006
@@ -24,7 +24,8 @@
#ifndef LLVM_ADT_STATISTIC_H
#define LLVM_ADT_STATISTIC_H
-#include
+#include
+#include "llvm/Support/Compiler.h"
namespace llvm {
@@ -85,6 +86,8 @@
const Statistic &operator/=(const DataType &V) { Value /= V; return *this; }
};
+EXTERN_TEMPLATE_INSTANTIATION(class Statistic);
+
} // End llvm namespace
#endif
From lattner at cs.uiuc.edu Tue Aug 29 23:17:15 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Tue, 29 Aug 2006 23:17:15 -0500
Subject: [llvm-commits] CVS: llvm/lib/Support/Statistic.cpp
Message-ID: <200608300417.k7U4HFp0011513@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Support:
Statistic.cpp updated: 1.17 -> 1.18
---
Log message:
Instantiate Statistic<> in one place, not in every .o file that uses it.
---
Diffs of the changes: (+2 -0)
Statistic.cpp | 2 ++
1 files changed, 2 insertions(+)
Index: llvm/lib/Support/Statistic.cpp
diff -u llvm/lib/Support/Statistic.cpp:1.17 llvm/lib/Support/Statistic.cpp:1.18
--- llvm/lib/Support/Statistic.cpp:1.17 Wed Jun 21 11:53:47 2006
+++ llvm/lib/Support/Statistic.cpp Tue Aug 29 23:17:00 2006
@@ -33,6 +33,8 @@
unsigned StatisticBase::NumStats = 0;
+TEMPLATE_INSTANTIATION(class Statistic);
+
// -stats - Command line option to cause transformations to emit stats about
// what they did.
//
From lattner at cs.uiuc.edu Wed Aug 30 00:57:06 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Aug 2006 00:57:06 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAG.h
Message-ID: <200608300557.k7U5v6RR012994@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/CodeGen:
SelectionDAG.h updated: 1.128 -> 1.129
---
Log message:
fix 80 column issue
---
Diffs of the changes: (+1 -1)
SelectionDAG.h | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm/include/llvm/CodeGen/SelectionDAG.h
diff -u llvm/include/llvm/CodeGen/SelectionDAG.h:1.128 llvm/include/llvm/CodeGen/SelectionDAG.h:1.129
--- llvm/include/llvm/CodeGen/SelectionDAG.h:1.128 Tue Aug 29 01:42:10 2006
+++ llvm/include/llvm/CodeGen/SelectionDAG.h Wed Aug 30 00:56:52 2006
@@ -135,7 +135,7 @@
}
- //===----------------------------------------------------------------------===//
+ //===--------------------------------------------------------------------===//
// Node creation methods.
//
SDOperand getString(const std::string &Val);
From jlaskey at apple.com Wed Aug 30 13:47:44 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 13:47:44 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608301847.k7UIli4l008768@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.9 -> 1.10
---
Log message:
Debugging newly pass fail report.
---
Diffs of the changes: (+27 -23)
ProgramResults.php | 50 +++++++++++++++++++++++++++-----------------------
1 files changed, 27 insertions(+), 23 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.9 nightlytest-serverside/ProgramResults.php:1.10
--- nightlytest-serverside/ProgramResults.php:1.9 Tue Aug 22 12:26:12 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 13:47:30 2006
@@ -435,7 +435,7 @@
* Get New Tests
*
* This is somewhat of a hack because from night 684 forward we now store the test
- * in their own table as oppoesd in the night table.
+ * in their own table as opposed in the night table.
*/
function getNewTests($cur_id, $prev_id, $mysql_link){
if(strcmp($prev_id, "")===0 || strcmp($cur_id, "")===0){
@@ -463,8 +463,9 @@
$query = "SELECT * FROM tests WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if( !isset($test_hash["{$row['measure']} - {$row['program']}"])){
- $result .= "{$row['measure']} - {$row['program']}
\n";
+ $test_key = "{$row['measure']} - {$row['program']}";
+ if(!isset($test_hash[$test_key])){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -476,7 +477,7 @@
* Get Removed Tests
*
* This is somewhat of a hack because from night 684 forward we now store the test
- * in their own table as oppoesd in the night table.
+ * in their own table as opposed in the night table.
*/
function getRemovedTests($cur_id, $prev_id, $mysql_link){
if(strcmp($prev_id, "")===0 || strcmp($cur_id, "")===0){
@@ -494,18 +495,19 @@
}
else{
$test_hash=array();
- $query = "SELECT * FROM tests WHERE night=$cur_id";
+ $query = "SELECT * FROM tests WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_hash["{$row['measure']} - {$row['program']}"]=1;
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$prev_id";
+ $query = "SELECT * FROM tests WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if( !isset($test_hash["{$row['measure']} - {$row['program']}"])){
- $result .= "{$row['measure']} - {$row['program']}
\n";
+ $test_key = "{$row['measure']} - {$row['program']}";
+ if(!isset($test_hash[$test_key])){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -517,7 +519,7 @@
* Get Fixed Tests
*
* This is somewhat of a hack because from night 684 forward we now store the test
- * in their own table as oppoesd in the night table.
+ * in their own table as opposed in the night table.
*/
function getFixedTests($cur_id, $prev_id, $mysql_link){
if(strcmp($prev_id, "")===0 || strcmp($cur_id, "")===0){
@@ -535,21 +537,22 @@
}
else{
$test_hash=array();
- $query = "SELECT * FROM tests WHERE night=$cur_id";
+ $query = "SELECT * FROM tests WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strcmp("{$row['result']}", "PASS")===0){
+ if(strcmp("{$row['result']}", "PASS")!==0){
$test_hash["{$row['measure']} - {$row['program']}"]=$row['result'];
}
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$prev_id";
+ $query = "SELECT * FROM tests WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if( isset($test_hash["{$row['measure']} - {$row['program']}"]) &&
- strcmp($test_hash["{$row['measure']} - {$row['program']}"], $row['result'])!==0){
- $result .= "{$row['measure']} - {$row['program']}
\n";
+ $test_key = "{$row['measure']} - {$row['program']}";
+ if(isset($test_hash[$test_key]) &&
+ strcmp($test_hash[$test_key], $row['result'])!==0){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -579,21 +582,22 @@
}
else{
$test_hash=array();
- $query = "SELECT * FROM tests WHERE night=$prev_id";
+ $query = "SELECT * FROM tests WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strcmp("{$row['result']}", "PASS")===0){
+ if(strcmp("{$row['result']}", "PASS")!==0){
$test_hash["{$row['measure']} - {$row['program']}"]=$row['result'];
- }
+ }
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$cur_id";
+ $query = "SELECT * FROM tests WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if( isset($test_hash["{$row['measure']} - {$row['program']}"]) &&
- strcmp($test_hash["{$row['measure']} - {$row['program']}"], $row['result'])!==0){
- $result .= "{$row['measure']} - {$row['program']}
\n";
+ $test_key = "{$row['measure']} - {$row['program']}";
+ if(isset($test_hash[$test_key]) &&
+ strcmp($test_hash[$test_key], $row['result'])!==0){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -691,4 +695,4 @@
}
-?>
\ No newline at end of file
+?>
From jlaskey at apple.com Wed Aug 30 13:52:10 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 13:52:10 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608301852.k7UIqAh1008895@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.10 -> 1.11
---
Log message:
Debugging newly pass fail report attempt #2.
---
Diffs of the changes: (+2 -2)
ProgramResults.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.10 nightlytest-serverside/ProgramResults.php:1.11
--- nightlytest-serverside/ProgramResults.php:1.10 Wed Aug 30 13:47:30 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 13:51:55 2006
@@ -495,14 +495,14 @@
}
else{
$test_hash=array();
- $query = "SELECT * FROM tests WHERE night=$prev_id";
+ $query = "SELECT * FROM tests WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_hash["{$row['measure']} - {$row['program']}"]=1;
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$cur_id";
+ $query = "SELECT * FROM tests WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
From jlaskey at apple.com Wed Aug 30 14:40:05 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 14:40:05 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608301940.k7UJe50O009798@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.11 -> 1.12
---
Log message:
Debugging newly pass fail report attempt #3.
---
Diffs of the changes: (+4 -2)
ProgramResults.php | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.11 nightlytest-serverside/ProgramResults.php:1.12
--- nightlytest-serverside/ProgramResults.php:1.11 Wed Aug 30 13:51:55 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 14:39:51 2006
@@ -552,8 +552,9 @@
$test_key = "{$row['measure']} - {$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
- $result .= $test_key . "
\n";
+// $result .= $test_key . "
\n";
}
+ $result .= $test_key . "
\n";
}
mysql_free_result($program_query);
}
@@ -597,8 +598,9 @@
$test_key = "{$row['measure']} - {$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
- $result .= $test_key . "
\n";
+// $result .= $test_key . "
\n";
}
+ $result .= $test_key . "
\n";
}
mysql_free_result($program_query);
}
From jlaskey at apple.com Wed Aug 30 14:41:47 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 14:41:47 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608301941.k7UJfleM009888@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.12 -> 1.13
---
Log message:
Debugging newly pass fail report attempt #4.
---
Diffs of the changes: (+2 -4)
ProgramResults.php | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.12 nightlytest-serverside/ProgramResults.php:1.13
--- nightlytest-serverside/ProgramResults.php:1.12 Wed Aug 30 14:39:51 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 14:41:33 2006
@@ -552,9 +552,8 @@
$test_key = "{$row['measure']} - {$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
-// $result .= $test_key . "
\n";
+ $result .= $test_key . "
\n";
}
- $result .= $test_key . "
\n";
}
mysql_free_result($program_query);
}
@@ -598,9 +597,8 @@
$test_key = "{$row['measure']} - {$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
-// $result .= $test_key . "
\n";
+ $result .= $test_key . "
\n";
}
- $result .= $test_key . "
\n";
}
mysql_free_result($program_query);
}
From lattner at cs.uiuc.edu Wed Aug 30 15:37:20 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Aug 2006 15:37:20 -0500
Subject: [llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp
Message-ID: <200608302037.k7UKbKqm011069@zion.cs.uiuc.edu>
Changes in directory llvm/lib/System:
DynamicLibrary.cpp updated: 1.17 -> 1.18
---
Log message:
Guess what happens when asserts are disabled. :(
Also, the assert could never fire due to || instead of &&.
---
Diffs of the changes: (+2 -1)
DynamicLibrary.cpp | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm/lib/System/DynamicLibrary.cpp
diff -u llvm/lib/System/DynamicLibrary.cpp:1.17 llvm/lib/System/DynamicLibrary.cpp:1.18
--- llvm/lib/System/DynamicLibrary.cpp:1.17 Fri Aug 25 14:54:53 2006
+++ llvm/lib/System/DynamicLibrary.cpp Wed Aug 30 15:37:06 2006
@@ -48,7 +48,8 @@
static inline void check_ltdl_initialization() {
static bool did_initialize_ltdl = false;
if (!did_initialize_ltdl) {
- assert(0 == lt_dlinit() || "Can't init the ltdl library");
+ int Err = lt_dlinit();
+ assert(0 == Err && "Can't init the ltdl library");
did_initialize_ltdl = true;
}
}
From lattner at cs.uiuc.edu Wed Aug 30 15:48:02 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Aug 2006 15:48:02 -0500
Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Reader.h
Message-ID: <200608302048.k7UKm2BI011323@zion.cs.uiuc.edu>
Changes in directory llvm/include/llvm/Bytecode:
Reader.h updated: 1.26 -> 1.27
---
Log message:
Restore source-level compatibility with clients of these functions.
---
Diffs of the changes: (+6 -6)
Reader.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
Index: llvm/include/llvm/Bytecode/Reader.h
diff -u llvm/include/llvm/Bytecode/Reader.h:1.26 llvm/include/llvm/Bytecode/Reader.h:1.27
--- llvm/include/llvm/Bytecode/Reader.h:1.26 Fri Aug 25 12:43:11 2006
+++ llvm/include/llvm/Bytecode/Reader.h Wed Aug 30 15:47:48 2006
@@ -36,7 +36,7 @@
/// @brief Get a ModuleProvide for a bytecode file.
ModuleProvider *getBytecodeModuleProvider(
const std::string &Filename, ///< Name of file to be read
- std::string* ErrMsg, ///< Optional error message holder
+ std::string* ErrMsg = 0, ///< Optional error message holder
BytecodeHandler* H = 0 ///< Optional handler for reader events
);
@@ -49,8 +49,8 @@
const unsigned char *Buffer, ///< Start of buffer to parse
unsigned BufferSize, ///< Size of the buffer
const std::string &ModuleID, ///< Name to give the module
- std::string* ErrMsg, ///< Optional place to return an error message
- BytecodeHandler* H ///< Optional handler for reader events
+ std::string* ErrMsg = 0, ///< Optional place to return an error message
+ BytecodeHandler* H = 0 ///< Optional handler for reader events
);
/// This is the main interface to bytecode parsing. It opens the file specified
@@ -84,7 +84,7 @@
bool GetBytecodeDependentLibraries(
const std::string &fileName, ///< File name to read bytecode from
Module::LibraryListType& deplibs, ///< List of dependent libraries extracted
- std::string* ErrMsg ///< Optional error message holder
+ std::string* ErrMsg = 0 ///< Optional error message holder
);
/// This function will read only the necessary parts of a bytecode file in order
@@ -96,7 +96,7 @@
bool GetBytecodeSymbols(
const sys::Path& fileName, ///< Filename to read bytecode from
std::vector& syms, ///< Vector to return symbols in
- std::string* ErrMsg ///< Optional error message holder
+ std::string* ErrMsg = 0 ///< Optional error message holder
);
/// This function will read only the necessary parts of a bytecode buffer in
@@ -111,7 +111,7 @@
unsigned Length, ///< The length of \p Buffer
const std::string& ModuleID, ///< An identifier for the module
std::vector& symbols, ///< The symbols defined in the module
- std::string* ErrMsg ///< Optional error message holder
+ std::string* ErrMsg = 0 ///< Optional error message holder
);
} // End llvm namespace
From rspencer at reidspencer.com Wed Aug 30 15:52:09 2006
From: rspencer at reidspencer.com (Reid Spencer)
Date: Wed, 30 Aug 2006 13:52:09 -0700
Subject: [llvm-commits] CVS: llvm/lib/System/DynamicLibrary.cpp
In-Reply-To: <200608302037.k7UKbKqm011069@zion.cs.uiuc.edu>
References: <200608302037.k7UKbKqm011069@zion.cs.uiuc.edu>
Message-ID: <1156971129.2694.39.camel@bashful.x10sys.com>
Oops!
On Wed, 2006-08-30 at 15:37 -0500, Chris Lattner wrote:
>
> Changes in directory llvm/lib/System:
>
> DynamicLibrary.cpp updated: 1.17 -> 1.18
> ---
> Log message:
>
> Guess what happens when asserts are disabled. :(
>
> Also, the assert could never fire due to || instead of &&.
>
>
> ---
> Diffs of the changes: (+2 -1)
>
> DynamicLibrary.cpp | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletion(-)
>
>
> Index: llvm/lib/System/DynamicLibrary.cpp
> diff -u llvm/lib/System/DynamicLibrary.cpp:1.17 llvm/lib/System/DynamicLibrary.cpp:1.18
> --- llvm/lib/System/DynamicLibrary.cpp:1.17 Fri Aug 25 14:54:53 2006
> +++ llvm/lib/System/DynamicLibrary.cpp Wed Aug 30 15:37:06 2006
> @@ -48,7 +48,8 @@
> static inline void check_ltdl_initialization() {
> static bool did_initialize_ltdl = false;
> if (!did_initialize_ltdl) {
> - assert(0 == lt_dlinit() || "Can't init the ltdl library");
> + int Err = lt_dlinit();
> + assert(0 == Err && "Can't init the ltdl library");
> did_initialize_ltdl = true;
> }
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From rspencer at reidspencer.com Wed Aug 30 15:53:34 2006
From: rspencer at reidspencer.com (Reid Spencer)
Date: Wed, 30 Aug 2006 13:53:34 -0700
Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Reader.h
In-Reply-To: <200608302048.k7UKm2BI011323@zion.cs.uiuc.edu>
References: <200608302048.k7UKm2BI011323@zion.cs.uiuc.edu>
Message-ID: <1156971214.2694.41.camel@bashful.x10sys.com>
Personally, I consider this "compatibility" to be wrong since it allows
callers to avoid the error message. We should report errors that occur.
Reid.
On Wed, 2006-08-30 at 15:48 -0500, Chris Lattner wrote:
>
> Changes in directory llvm/include/llvm/Bytecode:
>
> Reader.h updated: 1.26 -> 1.27
> ---
> Log message:
>
> Restore source-level compatibility with clients of these functions.
>
>
> ---
> Diffs of the changes: (+6 -6)
>
> Reader.h | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
>
> Index: llvm/include/llvm/Bytecode/Reader.h
> diff -u llvm/include/llvm/Bytecode/Reader.h:1.26 llvm/include/llvm/Bytecode/Reader.h:1.27
> --- llvm/include/llvm/Bytecode/Reader.h:1.26 Fri Aug 25 12:43:11 2006
> +++ llvm/include/llvm/Bytecode/Reader.h Wed Aug 30 15:47:48 2006
> @@ -36,7 +36,7 @@
> /// @brief Get a ModuleProvide for a bytecode file.
> ModuleProvider *getBytecodeModuleProvider(
> const std::string &Filename, ///< Name of file to be read
> - std::string* ErrMsg, ///< Optional error message holder
> + std::string* ErrMsg = 0, ///< Optional error message holder
> BytecodeHandler* H = 0 ///< Optional handler for reader events
> );
>
> @@ -49,8 +49,8 @@
> const unsigned char *Buffer, ///< Start of buffer to parse
> unsigned BufferSize, ///< Size of the buffer
> const std::string &ModuleID, ///< Name to give the module
> - std::string* ErrMsg, ///< Optional place to return an error message
> - BytecodeHandler* H ///< Optional handler for reader events
> + std::string* ErrMsg = 0, ///< Optional place to return an error message
> + BytecodeHandler* H = 0 ///< Optional handler for reader events
> );
>
> /// This is the main interface to bytecode parsing. It opens the file specified
> @@ -84,7 +84,7 @@
> bool GetBytecodeDependentLibraries(
> const std::string &fileName, ///< File name to read bytecode from
> Module::LibraryListType& deplibs, ///< List of dependent libraries extracted
> - std::string* ErrMsg ///< Optional error message holder
> + std::string* ErrMsg = 0 ///< Optional error message holder
> );
>
> /// This function will read only the necessary parts of a bytecode file in order
> @@ -96,7 +96,7 @@
> bool GetBytecodeSymbols(
> const sys::Path& fileName, ///< Filename to read bytecode from
> std::vector& syms, ///< Vector to return symbols in
> - std::string* ErrMsg ///< Optional error message holder
> + std::string* ErrMsg = 0 ///< Optional error message holder
> );
>
> /// This function will read only the necessary parts of a bytecode buffer in
> @@ -111,7 +111,7 @@
> unsigned Length, ///< The length of \p Buffer
> const std::string& ModuleID, ///< An identifier for the module
> std::vector& symbols, ///< The symbols defined in the module
> - std::string* ErrMsg ///< Optional error message holder
> + std::string* ErrMsg = 0 ///< Optional error message holder
> );
>
> } // End llvm namespace
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
From jlaskey at apple.com Wed Aug 30 15:57:05 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 15:57:05 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302057.k7UKv5qL011519@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.13 -> 1.14
---
Log message:
Debugging newly pass fail report attempt #5.
---
Diffs of the changes: (+42 -0)
ProgramResults.php | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.13 nightlytest-serverside/ProgramResults.php:1.14
--- nightlytest-serverside/ProgramResults.php:1.13 Wed Aug 30 14:41:33 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 15:56:51 2006
@@ -556,6 +556,27 @@
}
}
mysql_free_result($program_query);
+
+ $test_hash=array();
+ $query = "SELECT * FROM program WHERE night=$prev_id";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ if(strcmp("{$row['result']}", "PASS")!==0){
+ $test_hash["{$row['measure']} - {$row['program']}"]=$row['result'];
+ }
+ }
+ mysql_free_result($program_query);
+
+ $query = "SELECT * FROM program WHERE night=$cur_id";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ $test_key = "{$row['measure']} - {$row['program']}";
+ if(isset($test_hash[$test_key]) &&
+ strcmp($test_hash[$test_key], $row['result'])!==0){
+ $result .= $test_key . "
\n";
+ }
+ }
+ mysql_free_result($program_query);
}
return $result;
}
@@ -601,6 +622,27 @@
}
}
mysql_free_result($program_query);
+
+ $test_hash=array();
+ $query = "SELECT * FROM program WHERE night=$cur_id";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ if(strcmp("{$row['result']}", "PASS")!==0){
+ $test_hash["{$row['measure']} - {$row['program']}"]=$row['result'];
+ }
+ }
+ mysql_free_result($program_query);
+
+ $query = "SELECT * FROM program WHERE night=$prev_id";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ $test_key = "{$row['measure']} - {$row['program']}";
+ if(isset($test_hash[$test_key]) &&
+ strcmp($test_hash[$test_key], $row['result'])!==0){
+ $result .= $test_key . "
\n";
+ }
+ }
+ mysql_free_result($program_query);
}
return $result;
}
From sabre at nondot.org Wed Aug 30 16:38:34 2006
From: sabre at nondot.org (Chris Lattner)
Date: Wed, 30 Aug 2006 14:38:34 -0700 (PDT)
Subject: [llvm-commits] CVS: llvm/include/llvm/Bytecode/Reader.h
In-Reply-To: <1156971214.2694.41.camel@bashful.x10sys.com>
References: <200608302048.k7UKm2BI011323@zion.cs.uiuc.edu>
<1156971214.2694.41.camel@bashful.x10sys.com>
Message-ID:
On Wed, 30 Aug 2006, Reid Spencer wrote:
> Personally, I consider this "compatibility" to be wrong since it allows
> callers to avoid the error message. We should report errors that occur.
Depends on the client. In this case, it was a gratuitous source-level
incompatibility...
-Chris
> On Wed, 2006-08-30 at 15:48 -0500, Chris Lattner wrote:
>>
>> Changes in directory llvm/include/llvm/Bytecode:
>>
>> Reader.h updated: 1.26 -> 1.27
>> ---
>> Log message:
>>
>> Restore source-level compatibility with clients of these functions.
>>
>>
>> ---
>> Diffs of the changes: (+6 -6)
>>
>> Reader.h | 12 ++++++------
>> 1 files changed, 6 insertions(+), 6 deletions(-)
>>
>>
>> Index: llvm/include/llvm/Bytecode/Reader.h
>> diff -u llvm/include/llvm/Bytecode/Reader.h:1.26 llvm/include/llvm/Bytecode/Reader.h:1.27
>> --- llvm/include/llvm/Bytecode/Reader.h:1.26 Fri Aug 25 12:43:11 2006
>> +++ llvm/include/llvm/Bytecode/Reader.h Wed Aug 30 15:47:48 2006
>> @@ -36,7 +36,7 @@
>> /// @brief Get a ModuleProvide for a bytecode file.
>> ModuleProvider *getBytecodeModuleProvider(
>> const std::string &Filename, ///< Name of file to be read
>> - std::string* ErrMsg, ///< Optional error message holder
>> + std::string* ErrMsg = 0, ///< Optional error message holder
>> BytecodeHandler* H = 0 ///< Optional handler for reader events
>> );
>>
>> @@ -49,8 +49,8 @@
>> const unsigned char *Buffer, ///< Start of buffer to parse
>> unsigned BufferSize, ///< Size of the buffer
>> const std::string &ModuleID, ///< Name to give the module
>> - std::string* ErrMsg, ///< Optional place to return an error message
>> - BytecodeHandler* H ///< Optional handler for reader events
>> + std::string* ErrMsg = 0, ///< Optional place to return an error message
>> + BytecodeHandler* H = 0 ///< Optional handler for reader events
>> );
>>
>> /// This is the main interface to bytecode parsing. It opens the file specified
>> @@ -84,7 +84,7 @@
>> bool GetBytecodeDependentLibraries(
>> const std::string &fileName, ///< File name to read bytecode from
>> Module::LibraryListType& deplibs, ///< List of dependent libraries extracted
>> - std::string* ErrMsg ///< Optional error message holder
>> + std::string* ErrMsg = 0 ///< Optional error message holder
>> );
>>
>> /// This function will read only the necessary parts of a bytecode file in order
>> @@ -96,7 +96,7 @@
>> bool GetBytecodeSymbols(
>> const sys::Path& fileName, ///< Filename to read bytecode from
>> std::vector& syms, ///< Vector to return symbols in
>> - std::string* ErrMsg ///< Optional error message holder
>> + std::string* ErrMsg = 0 ///< Optional error message holder
>> );
>>
>> /// This function will read only the necessary parts of a bytecode buffer in
>> @@ -111,7 +111,7 @@
>> unsigned Length, ///< The length of \p Buffer
>> const std::string& ModuleID, ///< An identifier for the module
>> std::vector& symbols, ///< The symbols defined in the module
>> - std::string* ErrMsg ///< Optional error message holder
>> + std::string* ErrMsg = 0 ///< Optional error message holder
>> );
>>
>> } // End llvm namespace
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
From jlaskey at apple.com Wed Aug 30 16:00:19 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:00:19 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302100.k7UL0JwE011633@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.14 -> 1.15
---
Log message:
Debugging newly pass fail report attempt #6.
---
Diffs of the changes: (+6 -6)
ProgramResults.php | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.14 nightlytest-serverside/ProgramResults.php:1.15
--- nightlytest-serverside/ProgramResults.php:1.14 Wed Aug 30 15:56:51 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:00:05 2006
@@ -546,7 +546,7 @@
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$cur_id";
+ $query = "SELECT * FROM tests WHERE night=$cur_id ORDER BY program ASC" ;
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
@@ -567,7 +567,7 @@
}
mysql_free_result($program_query);
- $query = "SELECT * FROM program WHERE night=$cur_id";
+ $query = "SELECT * FROM program WHERE night=$cur_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
@@ -612,7 +612,7 @@
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$prev_id";
+ $query = "SELECT * FROM tests WHERE night=$prev_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
@@ -628,15 +628,15 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
if(strcmp("{$row['result']}", "PASS")!==0){
- $test_hash["{$row['measure']} - {$row['program']}"]=$row['result'];
+ $test_hash["{$row['program']}"]=$row['result'];
}
}
mysql_free_result($program_query);
- $query = "SELECT * FROM program WHERE night=$prev_id";
+ $query = "SELECT * FROM program WHERE night=$prev_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- $test_key = "{$row['measure']} - {$row['program']}";
+ $test_key = "{$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
$result .= $test_key . "
\n";
From jlaskey at apple.com Wed Aug 30 16:08:21 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:08:21 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302108.k7UL8LFO011863@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.15 -> 1.16
---
Log message:
Debugging newly pass fail report attempt #7.
---
Diffs of the changes: (+8 -6)
ProgramResults.php | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.15 nightlytest-serverside/ProgramResults.php:1.16
--- nightlytest-serverside/ProgramResults.php:1.15 Wed Aug 30 16:00:05 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:08:06 2006
@@ -460,7 +460,7 @@
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$cur_id";
+ $query = "SELECT * FROM tests WHERE night=$cur_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
@@ -502,7 +502,7 @@
}
mysql_free_result($program_query);
- $query = "SELECT * FROM tests WHERE night=$prev_id";
+ $query = "SELECT * FROM tests WHERE night=$prev_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
@@ -562,7 +562,7 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
if(strcmp("{$row['result']}", "PASS")!==0){
- $test_hash["{$row['measure']} - {$row['program']}"]=$row['result'];
+ $test_hash["{$row['program']}"]=$row['result'];
}
}
mysql_free_result($program_query);
@@ -570,10 +570,11 @@
$query = "SELECT * FROM program WHERE night=$cur_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- $test_key = "{$row['measure']} - {$row['program']}";
+ $test_key = "{$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
- $result .= $test_key . "
\n";
+ // $result .= $test_key . "
\n";
+ $result .= $row['result'] . ":" . $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -639,7 +640,8 @@
$test_key = "{$row['program']}";
if(isset($test_hash[$test_key]) &&
strcmp($test_hash[$test_key], $row['result'])!==0){
- $result .= $test_key . "
\n";
+ // $result .= $test_key . "
\n";
+ $result .= $row['result'] . ":" . $test_key . "
\n";
}
}
mysql_free_result($program_query);
From jlaskey at apple.com Wed Aug 30 16:20:15 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:20:15 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302120.k7ULKFts012120@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.16 -> 1.17
---
Log message:
Debugging newly pass fail report attempt #8.
---
Diffs of the changes: (+7 -11)
ProgramResults.php | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.16 nightlytest-serverside/ProgramResults.php:1.17
--- nightlytest-serverside/ProgramResults.php:1.16 Wed Aug 30 16:08:06 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:20:01 2006
@@ -561,7 +561,7 @@
$query = "SELECT * FROM program WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strcmp("{$row['result']}", "PASS")!==0){
+ if("{$row['result']}" !~ \\*\){
$test_hash["{$row['program']}"]=$row['result'];
}
}
@@ -571,10 +571,8 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) &&
- strcmp($test_hash[$test_key], $row['result'])!==0){
- // $result .= $test_key . "
\n";
- $result .= $row['result'] . ":" . $test_key . "
\n";
+ if(isset($test_hash[$test_key]) && "{$row['result']}" =~ \\*\){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -628,8 +626,8 @@
$query = "SELECT * FROM program WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strcmp("{$row['result']}", "PASS")!==0){
- $test_hash["{$row['program']}"]=$row['result'];
+ if("{$row['result']}" =~ \\*\){
+ $test_hash["{$row['program']}"]=1;
}
}
mysql_free_result($program_query);
@@ -638,10 +636,8 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) &&
- strcmp($test_hash[$test_key], $row['result'])!==0){
- // $result .= $test_key . "
\n";
- $result .= $row['result'] . ":" . $test_key . "
\n";
+ if(isset($test_hash[$test_key]) && "{$row['result']}" !~ \\*\){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
From jlaskey at apple.com Wed Aug 30 16:29:46 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:29:46 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302129.k7ULTkg6012312@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.17 -> 1.18
---
Log message:
Debugging newly pass fail report attempt #9.
---
Diffs of the changes: (+4 -4)
ProgramResults.php | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.17 nightlytest-serverside/ProgramResults.php:1.18
--- nightlytest-serverside/ProgramResults.php:1.17 Wed Aug 30 16:20:01 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:29:31 2006
@@ -561,7 +561,7 @@
$query = "SELECT * FROM program WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if("{$row['result']}" !~ \\*\){
+ if(strpos("{$row['result']}", "*") !== false) {
$test_hash["{$row['program']}"]=$row['result'];
}
}
@@ -571,7 +571,7 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) && "{$row['result']}" =~ \\*\){
+ if(isset($test_hash[$test_key]) && strpos("{$row['result']}", "*") === false){
$result .= $test_key . "
\n";
}
}
@@ -626,7 +626,7 @@
$query = "SELECT * FROM program WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if("{$row['result']}" =~ \\*\){
+ if(strpos("{$row['result']}", "*") === false) {
$test_hash["{$row['program']}"]=1;
}
}
@@ -636,7 +636,7 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) && "{$row['result']}" !~ \\*\){
+ if(isset($test_hash[$test_key]) && strpos("{$row['result']}", "*") !== false){
$result .= $test_key . "
\n";
}
}
From jlaskey at apple.com Wed Aug 30 16:36:38 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:36:38 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302136.k7ULacVS012493@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.18 -> 1.19
---
Log message:
Debugging newly pass fail report attempt #10.
---
Diffs of the changes: (+2 -2)
ProgramResults.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.18 nightlytest-serverside/ProgramResults.php:1.19
--- nightlytest-serverside/ProgramResults.php:1.18 Wed Aug 30 16:29:31 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:36:23 2006
@@ -561,7 +561,7 @@
$query = "SELECT * FROM program WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strpos("{$row['result']}", "*") !== false) {
+ if(!(strpos("{$row['result']}", "*") === false)) {
$test_hash["{$row['program']}"]=$row['result'];
}
}
@@ -636,7 +636,7 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) && strpos("{$row['result']}", "*") !== false){
+ if(isset($test_hash[$test_key]) && !(strpos("{$row['result']}", "*") === false)){
$result .= $test_key . "
\n";
}
}
From jlaskey at apple.com Wed Aug 30 16:39:05 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:39:05 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302139.k7ULd5Md012597@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.19 -> 1.20
---
Log message:
Debugging newly pass fail report attempt #11.
---
Diffs of the changes: (+2 -2)
ProgramResults.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.19 nightlytest-serverside/ProgramResults.php:1.20
--- nightlytest-serverside/ProgramResults.php:1.19 Wed Aug 30 16:36:23 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:38:51 2006
@@ -507,7 +507,7 @@
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
if(!isset($test_hash[$test_key])){
- $result .= $test_key . "
\n";
+ $result .= "{$row['result']}" . ":" . $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -572,7 +572,7 @@
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['program']}";
if(isset($test_hash[$test_key]) && strpos("{$row['result']}", "*") === false){
- $result .= $test_key . "
\n";
+ $result .= "{$row['result']}" . ":" . $test_key . "
\n";
}
}
mysql_free_result($program_query);
From jlaskey at apple.com Wed Aug 30 16:50:20 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:50:20 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302150.k7ULoKAJ012845@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.20 -> 1.21
---
Log message:
Debugging newly pass fail report attempt #12.
---
Diffs of the changes: (+11 -11)
ProgramResults.php | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.20 nightlytest-serverside/ProgramResults.php:1.21
--- nightlytest-serverside/ProgramResults.php:1.20 Wed Aug 30 16:38:51 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:50:06 2006
@@ -507,7 +507,7 @@
while($row = mysql_fetch_array($program_query)){
$test_key = "{$row['measure']} - {$row['program']}";
if(!isset($test_hash[$test_key])){
- $result .= "{$row['result']}" . ":" . $test_key . "
\n";
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -561,8 +561,8 @@
$query = "SELECT * FROM program WHERE night=$prev_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(!(strpos("{$row['result']}", "*") === false)) {
- $test_hash["{$row['program']}"]=$row['result'];
+ if(!(strpos($row['result'], "*") === false)) {
+ $test_hash[$row['program']]=$row['result'];
}
}
mysql_free_result($program_query);
@@ -570,9 +570,9 @@
$query = "SELECT * FROM program WHERE night=$cur_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- $test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) && strpos("{$row['result']}", "*") === false){
- $result .= "{$row['result']}" . ":" . $test_key . "
\n";
+ $test_key = $row['program'];
+ if(isset($test_hash[$test_key]) && strpos($row['result'], "*") === false){
+ $result .= $row['result'] . ":" . $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -626,8 +626,8 @@
$query = "SELECT * FROM program WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strpos("{$row['result']}", "*") === false) {
- $test_hash["{$row['program']}"]=1;
+ if(strpos($row['result'], "*") === false) {
+ $test_hash[$row['program']]=1;
}
}
mysql_free_result($program_query);
@@ -635,9 +635,9 @@
$query = "SELECT * FROM program WHERE night=$prev_id ORDER BY program ASC";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- $test_key = "{$row['program']}";
- if(isset($test_hash[$test_key]) && !(strpos("{$row['result']}", "*") === false)){
- $result .= $test_key . "
\n";
+ $test_key = $row['program'];
+ if(isset($test_hash[$test_key]) && !(strpos($row['result'], "*") === false)){
+ $result .= $row['result'] . ":" . $test_key . "
\n";
}
}
mysql_free_result($program_query);
From jlaskey at apple.com Wed Aug 30 16:55:09 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 16:55:09 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302155.k7ULt9DJ012972@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.21 -> 1.22
---
Log message:
Debugging newly pass fail report attempt #13.
---
Diffs of the changes: (+4 -4)
ProgramResults.php | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.21 nightlytest-serverside/ProgramResults.php:1.22
--- nightlytest-serverside/ProgramResults.php:1.21 Wed Aug 30 16:50:06 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 16:54:55 2006
@@ -572,7 +572,7 @@
while($row = mysql_fetch_array($program_query)){
$test_key = $row['program'];
if(isset($test_hash[$test_key]) && strpos($row['result'], "*") === false){
- $result .= $row['result'] . ":" . $test_key . "
\n";
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
@@ -626,7 +626,7 @@
$query = "SELECT * FROM program WHERE night=$cur_id";
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
- if(strpos($row['result'], "*") === false) {
+ if(!(strpos($row['result'], "*") === false)) {
$test_hash[$row['program']]=1;
}
}
@@ -636,8 +636,8 @@
$program_query = mysql_query($query) or die (mysql_error());
while($row = mysql_fetch_array($program_query)){
$test_key = $row['program'];
- if(isset($test_hash[$test_key]) && !(strpos($row['result'], "*") === false)){
- $result .= $row['result'] . ":" . $test_key . "
\n";
+ if(isset($test_hash[$test_key]) && strpos($row['result'], "*") === false){
+ $result .= $test_key . "
\n";
}
}
mysql_free_result($program_query);
From jlaskey at apple.com Wed Aug 30 17:08:56 2006
From: jlaskey at apple.com (Jim Laskey)
Date: Wed, 30 Aug 2006 17:08:56 -0500
Subject: [llvm-commits] CVS: nightlytest-serverside/ProgramResults.php
Message-ID: <200608302208.k7UM8uWJ013249@zion.cs.uiuc.edu>
Changes in directory nightlytest-serverside:
ProgramResults.php updated: 1.22 -> 1.23
---
Log message:
New/Dropped/Pass/Fail working for llvm-test.
---
Diffs of the changes: (+36 -0)
ProgramResults.php | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+)
Index: nightlytest-serverside/ProgramResults.php
diff -u nightlytest-serverside/ProgramResults.php:1.22 nightlytest-serverside/ProgramResults.php:1.23
--- nightlytest-serverside/ProgramResults.php:1.22 Wed Aug 30 16:54:55 2006
+++ nightlytest-serverside/ProgramResults.php Wed Aug 30 17:08:42 2006
@@ -469,6 +469,24 @@
}
}
mysql_free_result($program_query);
+
+ $test_hash=array();
+ $query = "SELECT * FROM program WHERE night=$prev_id";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ $test_hash[$row['program']]=1;
+ }
+ mysql_free_result($program_query);
+
+ $query = "SELECT * FROM program WHERE night=$cur_id ORDER BY program ASC";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ $test_key = $row['program'];
+ if(!isset($test_hash[$test_key])){
+ $result .= $test_key . "
\n";
+ }
+ }
+ mysql_free_result($program_query);
}
return $result;
}
@@ -511,6 +529,24 @@
}
}
mysql_free_result($program_query);
+
+ $test_hash=array();
+ $query = "SELECT * FROM program WHERE night=$cur_id";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ $test_hash[$row['program']]=1;
+ }
+ mysql_free_result($program_query);
+
+ $query = "SELECT * FROM program WHERE night=$prev_id ORDER BY program ASC";
+ $program_query = mysql_query($query) or die (mysql_error());
+ while($row = mysql_fetch_array($program_query)){
+ $test_key = $row['program'];
+ if(!isset($test_hash[$test_key])){
+ $result .= $test_key . "
\n";
+ }
+ }
+ mysql_free_result($program_query);
}
return $result;
}
From lattner at cs.uiuc.edu Wed Aug 30 18:02:43 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Aug 2006 18:02:43 -0500
Subject: [llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Message-ID: <200608302302.k7UN2hEK014163@zion.cs.uiuc.edu>
Changes in directory llvm/lib/CodeGen:
LiveIntervalAnalysis.cpp updated: 1.172 -> 1.173
---
Log message:
Fix a compiler crash bootstrapping llvm-gcc.
---
Diffs of the changes: (+6 -2)
LiveIntervalAnalysis.cpp | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.172 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.173
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.172 Tue Aug 29 18:18:15 2006
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Wed Aug 30 18:02:29 2006
@@ -570,7 +570,7 @@
else if (allocatableRegs_[reg]) {
handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(reg));
for (const unsigned* AS = mri_->getAliasSet(reg); *AS; ++AS)
- handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(*AS));
+ handlePhysicalRegisterDef(MBB, MI, getOrCreateInterval(*AS), true);
}
}
@@ -684,7 +684,11 @@
if (ValLR+1 != BLR) return false;
DEBUG(std::cerr << "\nExtending: "; IntB.print(std::cerr, mri_));
-
+
+ // We are about to delete CopyMI, so need to remove it as the 'instruction
+ // that defines this value #'.
+ IntB.setInstDefiningValNum(BValNo, ~0U);
+
// Okay, we can merge them. We need to insert a new liverange:
// [ValLR.end, BLR.begin) of either value number, then we merge the
// two value numbers.
From lattner at cs.uiuc.edu Wed Aug 30 18:03:49 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Aug 2006 18:03:49 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/CodeGen/Generic/2006-08-30-CoallescerCrash.ll
Message-ID: <200608302303.k7UN3nMv014236@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/CodeGen/Generic:
2006-08-30-CoallescerCrash.ll added (r1.1)
---
Log message:
Bugfix for recent coallescer crash
---
Diffs of the changes: (+115 -0)
2006-08-30-CoallescerCrash.ll | 115 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 115 insertions(+)
Index: llvm/test/Regression/CodeGen/Generic/2006-08-30-CoallescerCrash.ll
diff -c /dev/null llvm/test/Regression/CodeGen/Generic/2006-08-30-CoallescerCrash.ll:1.1
*** /dev/null Wed Aug 30 18:03:45 2006
--- llvm/test/Regression/CodeGen/Generic/2006-08-30-CoallescerCrash.ll Wed Aug 30 18:03:35 2006
***************
*** 0 ****
--- 1,115 ----
+ ; RUN: llvm-as < %s | llc
+
+ %struct.CUMULATIVE_ARGS = type { int, int, int, int, int, int, int, int, int, int, int, int, int, int }
+ %struct.VEC_edge = type { uint, uint, [1 x %struct.edge_def*] }
+ %struct._obstack_chunk = type { sbyte*, %struct._obstack_chunk*, [4 x sbyte] }
+ %struct.basic_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.tree_node*, %struct.VEC_edge*, %struct.VEC_edge*, %struct.bitmap_head_def*, %struct.bitmap_head_def*, sbyte*, %struct.loop*, [2 x %struct.et_node*], %struct.basic_block_def*, %struct.basic_block_def*, %struct.reorder_block_def*, %struct.bb_ann_d*, long, int, int, int, int }
+ %struct.bb_ann_d = type { %struct.tree_node*, ubyte, %struct.edge_prediction* }
+ %struct.bitmap_element_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, uint, [4 x uint] }
+ %struct.bitmap_head_def = type { %struct.bitmap_element_def*, %struct.bitmap_element_def*, uint, %struct.bitmap_obstack* }
+ %struct.bitmap_obstack = type { %struct.bitmap_element_def*, %struct.bitmap_head_def*, %struct.obstack }
+ %struct.cost_pair = type { %struct.iv_cand*, uint, %struct.bitmap_head_def* }
+ %struct.dataflow_d = type { %struct.varray_head_tag*, [2 x %struct.tree_node*] }
+ %struct.def_operand_ptr = type { %struct.tree_node** }
+ %struct.def_optype_d = type { uint, [1 x %struct.def_operand_ptr] }
+ %struct.edge_def = type { %struct.basic_block_def*, %struct.basic_block_def*, %struct.edge_def_insns, sbyte*, %struct.location_t*, int, int, long, uint }
+ %struct.edge_def_insns = type { %struct.rtx_def* }
+ %struct.edge_prediction = type { %struct.edge_prediction*, %struct.edge_def*, uint, int }
+ %struct.eh_status = type opaque
+ %struct.emit_status = type { int, int, %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack*, int, %struct.location_t, int, ubyte*, %struct.rtx_def** }
+ %struct.et_node = type opaque
+ %struct.expr_status = type { int, int, int, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def* }
+ %struct.function = type { %struct.eh_status*, %struct.expr_status*, %struct.emit_status*, %struct.varasm_status*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.function*, int, int, int, int, %struct.rtx_def*, %struct.CUMULATIVE_ARGS, %struct.rtx_def*, %struct.rtx_def*, %struct.initial_value_struct*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, ubyte, int, long, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, %struct.varray_head_tag*, %struct.temp_slot*, int, %struct.var_refs_queue*, int, int, %struct.rtvec_def*, %struct.tree_node*, int, int, int, %struct.machine_function*, uint, uint, bool, bool, %struct.language_function*, %struct.rtx_def*, uint, int, int, int, %struct.location_t, %struct.varray_head_tag*, %struct.tree_node*, ubyte, ubyte, ubyte }
+ %struct.htab = type { uint (sbyte*)*, int (sbyte*, sbyte*)*, void (sbyte*)*, sbyte**, uint, uint, uint, uint, uint, sbyte* (uint, uint)*, void (sbyte*)*, sbyte*, sbyte* (sbyte*, uint, uint)*, void (sbyte*, sbyte*)*, uint }
+ %struct.initial_value_struct = type opaque
+ %struct.iv = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, bool, bool, uint }
+ %struct.iv_cand = type { uint, bool, uint, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.iv*, uint }
+ %struct.iv_use = type { uint, uint, %struct.iv*, %struct.tree_node*, %struct.tree_node**, %struct.bitmap_head_def*, uint, %struct.cost_pair*, %struct.iv_cand* }
+ %struct.ivopts_data = type { %struct.loop*, %struct.htab*, uint, %struct.version_info*, %struct.bitmap_head_def*, uint, %struct.varray_head_tag*, %struct.varray_head_tag*, %struct.bitmap_head_def*, bool }
+ %struct.lang_decl = type opaque
+ %struct.language_function = type opaque
+ %struct.location_t = type { sbyte*, int }
+ %struct.loop = type { int, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.lpt_decision, uint, uint, %struct.edge_def**, int, %struct.basic_block_def*, %struct.basic_block_def*, uint, %struct.edge_def**, int, %struct.edge_def**, int, %struct.simple_bitmap_def*, int, %struct.loop**, int, %struct.loop*, %struct.loop*, %struct.loop*, %struct.loop*, int, sbyte*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, %struct.rtx_def*, int, %struct.tree_node*, %struct.tree_node*, %struct.nb_iter_bound*, %struct.edge_def*, bool }
+ %struct.lpt_decision = type { uint, uint }
+ %struct.machine_function = type { %struct.stack_local_entry*, sbyte*, %struct.rtx_def*, int, int, int, int, int }
+ %struct.nb_iter_bound = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.nb_iter_bound* }
+ %struct.obstack = type { int, %struct._obstack_chunk*, sbyte*, sbyte*, sbyte*, int, int, %struct._obstack_chunk* (sbyte*, int)*, void (sbyte*, %struct._obstack_chunk*)*, sbyte*, ubyte }
+ %struct.reorder_block_def = type { %struct.rtx_def*, %struct.rtx_def*, %struct.basic_block_def*, %struct.basic_block_def*, %struct.basic_block_def*, int, int, int }
+ %struct.rtvec_def = type { int, [1 x %struct.rtx_def*] }
+ %struct.rtx_def = type { ushort, ubyte, ubyte, %struct.u }
+ %struct.sequence_stack = type { %struct.rtx_def*, %struct.rtx_def*, %struct.sequence_stack* }
+ %struct.simple_bitmap_def = type { uint, uint, uint, [1 x ulong] }
+ %struct.stack_local_entry = type opaque
+ %struct.stmt_ann_d = type { %struct.tree_ann_common_d, ubyte, %struct.basic_block_def*, %struct.stmt_operands_d, %struct.dataflow_d*, %struct.bitmap_head_def*, uint }
+ %struct.stmt_operands_d = type { %struct.def_optype_d*, %struct.def_optype_d*, %struct.v_may_def_optype_d*, %struct.vuse_optype_d*, %struct.v_may_def_optype_d* }
+ %struct.temp_slot = type opaque
+ %struct.tree_ann_common_d = type { uint, sbyte*, %struct.tree_node* }
+ %struct.tree_ann_d = type { %struct.stmt_ann_d }
+ %struct.tree_common = type { %struct.tree_node*, %struct.tree_node*, %struct.tree_ann_d*, ubyte, ubyte, ubyte, ubyte, ubyte }
+ %struct.tree_decl = type { %struct.tree_common, %struct.location_t, uint, %struct.tree_node*, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, ubyte, uint, %struct.tree_decl_u1, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.tree_node*, %struct.rtx_def*, int, %struct.tree_decl_u2, %struct.tree_node*, %struct.tree_node*, long, %struct.lang_decl* }
+ %struct.tree_decl_u1 = type { long }
+ %struct.tree_decl_u2 = type { %struct.function* }
+ %struct.tree_node = type { %struct.tree_decl }
+ %struct.u = type { [1 x long] }
+ %struct.v_def_use_operand_type_t = type { %struct.tree_node*, %struct.tree_node* }
+ %struct.v_may_def_optype_d = type { uint, [1 x %struct.v_def_use_operand_type_t] }
+ %struct.var_refs_queue = type { %struct.rtx_def*, uint, int, %struct.var_refs_queue* }
+ %struct.varasm_status = type opaque
+ %struct.varray_head_tag = type { uint, uint, uint, sbyte*, %struct.u }
+ %struct.version_info = type { %struct.tree_node*, %struct.iv*, bool, uint, bool }
+ %struct.vuse_optype_d = type { uint, [1 x %struct.tree_node*] }
+
+ implementation ; Functions:
+
+ bool %determine_use_iv_cost(%struct.ivopts_data* %data, %struct.iv_use* %use, %struct.iv_cand* %cand) {
+ entry:
+ switch uint 0, label %bb91 [
+ uint 0, label %bb
+ uint 1, label %bb6
+ uint 3, label %cond_next135
+ ]
+
+ bb: ; preds = %entry
+ ret bool false
+
+ bb6: ; preds = %entry
+ br bool false, label %bb87, label %cond_next27
+
+ cond_next27: ; preds = %bb6
+ br bool false, label %cond_true30, label %cond_next55
+
+ cond_true30: ; preds = %cond_next27
+ br bool false, label %cond_next41, label %cond_true35
+
+ cond_true35: ; preds = %cond_true30
+ ret bool false
+
+ cond_next41: ; preds = %cond_true30
+ %tmp44 = call uint %force_var_cost( %struct.ivopts_data* %data, %struct.tree_node* null, %struct.bitmap_head_def** null ) ; [#uses=2]
+ %tmp46 = div uint %tmp44, 5 ; [#uses=1]
+ call void %set_use_iv_cost( %struct.ivopts_data* %data, %struct.iv_use* %use, %struct.iv_cand* %cand, uint %tmp46, %struct.bitmap_head_def* null )
+ %tmp44.off = add uint %tmp44, 4244967296 ; [#uses=1]
+ %tmp52 = setgt uint %tmp44.off, 4 ; [#uses=1]
+ %tmp52 = cast bool %tmp52 to int ; [#uses=1]
+ br label %bb87
+
+ cond_next55: ; preds = %cond_next27
+ ret bool false
+
+ bb87: ; preds = %cond_next41, %bb6
+ %tmp2.0 = phi int [ %tmp52, %cond_next41 ], [ 1, %bb6 ] ; [#uses=0]
+ ret bool false
+
+ bb91: ; preds = %entry
+ ret bool false
+
+ cond_next135: ; preds = %entry
+ %tmp193 = call bool %determine_use_iv_cost_generic( %struct.ivopts_data* %data, %struct.iv_use* %use, %struct.iv_cand* %cand ) ; [#uses=0]
+ ret bool false
+ }
+
+ declare void %set_use_iv_cost(%struct.ivopts_data*, %struct.iv_use*, %struct.iv_cand*, uint, %struct.bitmap_head_def*)
+
+ declare uint %force_var_cost(%struct.ivopts_data*, %struct.tree_node*, %struct.bitmap_head_def**)
+
+ declare bool %determine_use_iv_cost_generic(%struct.ivopts_data*, %struct.iv_use*, %struct.iv_cand*)
From nicholas at mxc.ca Wed Aug 30 19:39:31 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Wed, 30 Aug 2006 19:39:31 -0500
Subject: [llvm-commits]
CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Message-ID: <200608310039.k7V0dVjv015998@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Transforms/Scalar:
PredicateSimplifier.cpp updated: 1.2 -> 1.3
---
Log message:
Properties where both Values weren't in the union (as being equal to
another Value) weren't being found by findProperties.
This fixes predsimplify.ll test6, a missed optimization opportunity.
---
Diffs of the changes: (+18 -24)
PredicateSimplifier.cpp | 42 ++++++++++++++++++------------------------
1 files changed, 18 insertions(+), 24 deletions(-)
Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.2 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.3
--- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.2 Tue Aug 29 21:46:48 2006
+++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Wed Aug 30 19:39:16 2006
@@ -121,21 +121,8 @@
void addNotEqual(Value *V1, Value *V2) {
DEBUG(std::cerr << "not equal: " << *V1 << " and " << *V2 << "\n");
- V1 = canonicalize(V1);
- V2 = canonicalize(V2);
-
- // Does the property already exist?
- for (PropertyIterator I = Properties.begin(), E = Properties.end();
- I != E; ++I) {
- if (I->Opcode != NE) continue;
-
- I->V1 = canonicalize(I->V1);
- I->V2 = canonicalize(I->V2);
- if ((I->V1 == V1 && I->V2 == V2) ||
- (I->V1 == V2 && I->V2 == V1)) {
- return; // Found.
- }
- }
+ if (findProperty(NE, V1, V2) != Properties.end())
+ return; // found.
// Add the property.
Properties.push_back(Property(NE, V1, V2));
@@ -146,9 +133,8 @@
assert(Opcode != EQ && "Can't findProperty on EQ."
"Use the lookup method instead.");
- V1 = lookup(V1);
- V2 = lookup(V2);
- if (!V1 || !V2) return Properties.end();
+ V1 = canonicalize(V1);
+ V2 = canonicalize(V2);
// Does the property already exist?
for (PropertyIterator I = Properties.begin(), E = Properties.end();
@@ -170,18 +156,16 @@
assert(Opcode != EQ && "Can't findProperty on EQ."
"Use the lookup method instead.");
- V1 = lookup(V1);
- V2 = lookup(V2);
- if (!V1 || !V2) return Properties.end();
+ V1 = canonicalize(V1);
+ V2 = canonicalize(V2);
// Does the property already exist?
for (ConstPropertyIterator I = Properties.begin(),
E = Properties.end(); I != E; ++I) {
if (I->Opcode != Opcode) continue;
- Value *v1 = lookup(I->V1),
- *v2 = lookup(I->V2);
- if (!v1 || !v2) continue;
+ Value *v1 = canonicalize(I->V1),
+ *v2 = canonicalize(I->V2);
if ((v1 == V1 && v2 == V2) ||
(v1 == V2 && v2 == V1)) {
return I; // Found.
@@ -291,6 +275,14 @@
public:
void debug(std::ostream &os) const {
+ for (EquivalenceClasses::iterator I = union_find.begin(),
+ E = union_find.end(); I != E; ++I) {
+ if (!I->isLeader()) continue;
+ for (EquivalenceClasses::member_iterator MI =
+ union_find.member_begin(I); MI != union_find.member_end(); ++MI)
+ std::cerr << **MI << " ";
+ std::cerr << "\n--\n";
+ }
}
std::vector Properties;
@@ -571,8 +563,10 @@
PropertySet TrueProperties(KP), FalseProperties(KP);
DEBUG(std::cerr << "true set:\n");
TrueProperties.addEqual(ConstantBool::True, Condition);
+ DEBUG(TrueProperties.debug(std::cerr));
DEBUG(std::cerr << "false set:\n");
FalseProperties.addEqual(ConstantBool::False, Condition);
+ DEBUG(FalseProperties.debug(std::cerr));
PropertySet KPcopy(KP);
proceedToSuccessor(KP, TrueProperties, Node, DT->getNode(TrueDest));
From llvm at cs.uiuc.edu Wed Aug 30 19:40:42 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:40:42 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/
Message-ID: <200608310040.k7V0egu6016036@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006 added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:40:42 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:40:42 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/
Message-ID: <200608310040.k7V0egaZ016039@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006 added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:02 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:02 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/403.gcc/
Message-ID: <200608310041.k7V0f2jQ016083@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/403.gcc:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/403.gcc added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits]
CVS: llvm-test/External/SPEC/CINT2006/462.libquantum/
Message-ID: <200608310041.k7V0f36N016104@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/462.libquantum:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/462.libquantum added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/429.mcf/
Message-ID: <200608310041.k7V0f3qB016086@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/429.mcf:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/429.mcf added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/483.xalancbmk/
Message-ID: <200608310041.k7V0f3Lf016124@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/483.xalancbmk:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/483.xalancbmk added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:02 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:02 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/401.bzip2/
Message-ID: <200608310041.k7V0f2TL016081@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/401.bzip2:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/401.bzip2 added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/473.astar/
Message-ID: <200608310041.k7V0f3pK016119@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/473.astar:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/473.astar added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/445.gobmk/
Message-ID: <200608310041.k7V0f3De016091@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/445.gobmk:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/445.gobmk added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/456.hmmer/
Message-ID: <200608310041.k7V0f3Uw016096@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/456.hmmer:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/456.hmmer added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/464.h264ref/
Message-ID: <200608310041.k7V0f3mW016109@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/464.h264ref:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/464.h264ref added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/471.omnetpp/
Message-ID: <200608310041.k7V0f3xp016114@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/471.omnetpp:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/471.omnetpp added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:03 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:03 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/458.sjeng/
Message-ID: <200608310041.k7V0f3nY016101@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/458.sjeng:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/458.sjeng added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:41:02 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:41:02 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CINT2006/400.perlbench/
Message-ID: <200608310041.k7V0f2h9016078@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CINT2006/400.perlbench:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CINT2006/400.perlbench added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/410.bwaves/
Message-ID: <200608310042.k7V0gvTJ016200@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/410.bwaves:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/410.bwaves added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/416.gamess/
Message-ID: <200608310042.k7V0gvMC016203@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/416.gamess:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/416.gamess added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/433.milc/
Message-ID: <200608310042.k7V0gvIi016206@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/433.milc:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/433.milc added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/437.leslie3d/
Message-ID: <200608310042.k7V0gvhr016223@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/437.leslie3d:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/437.leslie3d added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/436.cactusADM/
Message-ID: <200608310042.k7V0gvlC016218@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/436.cactusADM:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/436.cactusADM added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/454.calculix/
Message-ID: <200608310042.k7V0gvWf016246@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/454.calculix:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/454.calculix added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/447.dealII/
Message-ID: <200608310042.k7V0gv45016231@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/447.dealII:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/447.dealII added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/444.namd/
Message-ID: <200608310042.k7V0gv2o016226@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/444.namd:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/444.namd added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/434.zeusmp/
Message-ID: <200608310042.k7V0gvc0016209@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/434.zeusmp:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/434.zeusmp added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/465.tonto/
Message-ID: <200608310042.k7V0gvvh016254@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/465.tonto:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/465.tonto added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/470.lbm/
Message-ID: <200608310042.k7V0gv5L016259@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/470.lbm:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/470.lbm added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/459.GemsFDTD/
Message-ID: <200608310042.k7V0gvNr016251@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/459.GemsFDTD:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/459.GemsFDTD added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/435.gromacs/
Message-ID: <200608310042.k7V0gv6K016213@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/435.gromacs:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/435.gromacs added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/450.soplex/
Message-ID: <200608310042.k7V0gv2D016236@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/450.soplex:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/450.soplex added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:57 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:57 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/453.povray/
Message-ID: <200608310042.k7V0gvO6016241@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/453.povray:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/453.povray added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:58 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:58 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/482.sphinx3/
Message-ID: <200608310042.k7V0gwcD016269@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/482.sphinx3:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/482.sphinx3 added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From llvm at cs.uiuc.edu Wed Aug 30 19:42:58 2006
From: llvm at cs.uiuc.edu (LLVM)
Date: Wed, 30 Aug 2006 19:42:58 -0500
Subject: [llvm-commits] CVS: llvm-test/External/SPEC/CFP2006/481.wrf/
Message-ID: <200608310042.k7V0gwCO016264@zion.cs.uiuc.edu>
Changes in directory llvm-test/External/SPEC/CFP2006/481.wrf:
---
Log message:
Directory /var/cvs/llvm/llvm-test/External/SPEC/CFP2006/481.wrf added to the repository
---
Diffs of the changes: (+0 -0)
0 files changed
From nicholas at mxc.ca Wed Aug 30 22:13:19 2006
From: nicholas at mxc.ca (Nick Lewycky)
Date: Wed, 30 Aug 2006 22:13:19 -0500
Subject: [llvm-commits]
CVS: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg4.ll
Message-ID: <200608310313.k7V3DJ3B018899@zion.cs.uiuc.edu>
Changes in directory llvm/test/Regression/Transforms/PredicateSimplifier:
predsimplify.reg4.ll added (r1.1)
---
Log message:
This program crashes the PredicateSimplifier. Not marked XFAIL because
the PredicateSimplifier is skipped in make check anyways.
---
Diffs of the changes: (+36 -0)
predsimplify.reg4.ll | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+)
Index: llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg4.ll
diff -c /dev/null llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg4.ll:1.1
*** /dev/null Wed Aug 30 22:13:15 2006
--- llvm/test/Regression/Transforms/PredicateSimplifier/predsimplify.reg4.ll Wed Aug 30 22:13:05 2006
***************
*** 0 ****
--- 1,36 ----
+ ; RUN: llvm-as < %s | opt -predsimplify -disable-output
+
+ ; ModuleID = ''
+ target endian = little
+ target pointersize = 32
+ target triple = "i686-pc-linux-gnu"
+
+ implementation ; Functions:
+
+ void %f(int %x, int %y) {
+ entry:
+ %tmp = seteq int %x, 10 ; [#uses=1]
+ %tmp.not = xor bool %tmp, true ; [#uses=1]
+ %tmp3 = seteq int %x, %y ; [#uses=1]
+ %bothcond = and bool %tmp.not, %tmp3 ; [#uses=1]
+ br bool %bothcond, label %cond_true4, label %return
+
+ cond_true4: ; preds = %entry
+ switch int %y, label %return [
+ int 9, label %bb
+ int 10, label %bb6
+ ]
+
+ bb: ; preds = %cond_true4
+ call void %g( int 9 )
+ ret void
+
+ bb6: ; preds = %cond_true4
+ call void %g( int 10 )
+ ret void
+
+ return: ; preds = %cond_true4, %entry
+ ret void
+ }
+
+ declare void %g(int)
From lattner at cs.uiuc.edu Wed Aug 30 23:26:46 2006
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Wed, 30 Aug 2006 23:26:46 -0500
Subject: [llvm-commits] CVS: llvm/docs/FAQ.html
Message-ID: <200608310426.k7V4QkHI020075@zion.cs.uiuc.edu>
Changes in directory llvm/docs:
FAQ.html updated: 1.39 -> 1.40
---
Log message:
Add a note about C++ -> C with libstdc++
---
Diffs of the changes: (+12 -3)
FAQ.html | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
Index: llvm/docs/FAQ.html
diff -u llvm/docs/FAQ.html:1.39 llvm/docs/FAQ.html:1.40
--- llvm/docs/FAQ.html:1.39 Mon Aug 14 19:43:35 2006
+++ llvm/docs/FAQ.html Wed Aug 30 23:26:31 2006
@@ -541,8 +541,8 @@
or:
- llvm-g++ a.cpp -c
- llvm-g++ b.cpp -c
+ llvm-g++ a.cpp -c
+ llvm-g++ b.cpp -c
llvm-g++ a.o b.o -o program
@@ -566,6 +566,15 @@
use setjmp/longjmp to implement exception support that is correct but
relatively slow.
+
+Also note: this specific sequence of commands won't work if you use a
+function defined in the C++ runtime library (or any other C++ library). To
+access an external C++ library, you must manually
+compile libstdc++ to LLVM bytecode, statically link it into your program, then
+use the commands above to convert the whole result into C code. Alternatively,
+you can compile the libraries and your application into two different chunks
+of C code and link them.
+
@@ -683,7 +692,7 @@
src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!">
LLVM Compiler Infrastructure
- Last modified: $Date: 2006/08/15 00:43:35 $
+ Last modified: $Date: 2006/08/31 04:26:31 $