[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/negConst.c negConst.reference_output
Changes in directory llvm-test/SingleSource/UnitTests/Integer: negConst.c added (r1.1) negConst.reference_output added (r1.1) --- Log message: A test of negative literal constant values with various bit sizes. --- Diffs of the changes: (+69 -0) negConst.c| 61 ++ negConst.reference_output |8 ++ 2 files changed, 69 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/negConst.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/negConst.c:1.1 *** /dev/null Mon May 14 02:30:47 2007 --- llvm-test/SingleSource/UnitTests/Integer/negConst.c Mon May 14 02:30:37 2007 *** *** 0 --- 1,61 + + #include "bits.h" + + + void test1(int69 x) + { + int63 y = -120; + int63 y2 = part_select(y, 0, 31); + int32 z = 0; + int32 z2 = 0; + int i = 0; + + // Compute the part_select manually using bit_select + for(i = 31; i >= 0; --i) { + z <<= 1; + if (bit_select(y, i)) + z |= 1; + } + + // Compute the part_select + z2 = y2; + + printf("Value1: %x = ", (int)y); + printBits(y); + printf("\n"); + printf("Value2: %x = ", (int)y2); + printBits(y2); + printf("\n"); + printf("Bits : %x = ", z); + printBits(z); + printf("\nPart : %x = ", z2); + printBits(z2); + printf("\n"); + + if (z != z2) + printf("Error: %x, %x\n", z, z2); + else + printf("OK.\n"); + } + + int main(int argc, char ** argv) + { + int69 n; + if (argc > 1) { + n = bitsFromString("987654321000", 69); + } + else + n = -1; + int54 n2 = n; + long long unsigned int U = n; + long long signed int S = n2; + + printf("Unsigned: %llu (%llx) = ", U, U); + printBits(n); + printf("\n"); + printf(" Signed: %lld (%llx) = ", S, S); + printBits(n2); + printf("\n"); + test1(n); + return 0; + } Index: llvm-test/SingleSource/UnitTests/Integer/negConst.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/negConst.reference_output:1.1 *** /dev/null Mon May 14 02:30:55 2007 --- llvm-test/SingleSource/UnitTests/Integer/negConst.reference_output Mon May 14 02:30:37 2007 *** *** 0 --- 1,8 + Unsigned: 987654321000 (2316a9e9a40e80) = 000100011000101101010100010011010010011101000 + Signed: -8137855299481984 (ffe316a9e9a40e80) = 100011000101101010100010011010010011101000 + Value1: ff88 = 0001000 + Value2: ff88 = 00010001000 + Bits : ff88 = 10001000 + Part : ff88 = 10001000 + OK. + exit 0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/union2.c union2.reference_output
Changes in directory llvm-test/SingleSource/UnitTests/Integer: union2.c updated: 1.6 -> 1.7 union2.reference_output updated: 1.2 -> 1.3 --- Log message: Update the output of this test slight and make it pass the union value through a function call. --- Diffs of the changes: (+13 -13) union2.c| 20 ++-- union2.reference_output |6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/union2.c diff -u llvm-test/SingleSource/UnitTests/Integer/union2.c:1.6 llvm-test/SingleSource/UnitTests/Integer/union2.c:1.7 --- llvm-test/SingleSource/UnitTests/Integer/union2.c:1.6 Wed Jan 24 14:39:44 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.c Mon May 14 02:38:23 2007 @@ -22,22 +22,18 @@ typedef union {short i; int9 i9; int31 i31;} myUnion; typedef struct myStruct {int9* ptr; short i;} myStruct; -myStruct test(myUnion u) +myStruct test(myUnion *u) { myStruct x; int9* ptr; - u.i31 = -1; - u.i = 0x0; - ptr = &(u.i9); + u->i31 = -1; + u->i = 0x0; + ptr = &(u->i9); *ptr= -1; - printf("u.i = %hd\n", u.i); - printf("u.i9 = %hd\n", u.i9); - printf("u.i31 = %d\n", u.i31); - x.ptr = ptr; - x.i = u.i; + x.i = u->i; return x; } @@ -46,7 +42,11 @@ int main() { - myStruct s = test(uu); + myStruct s = test(&uu); + printf("uu.i = %hd\n", uu.i); + printf("uu.i9 = %d\n", (int)uu.i9); + printf("uu.i31= %d\n", uu.i31); + if(s.i == 0x0) printf("error: s.i=%x\n", s.i); return 0; Index: llvm-test/SingleSource/UnitTests/Integer/union2.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.3 --- llvm-test/SingleSource/UnitTests/Integer/union2.reference_output:1.2 Wed Jan 24 14:39:44 2007 +++ llvm-test/SingleSource/UnitTests/Integer/union2.reference_outputMon May 14 02:38:23 2007 @@ -1,4 +1,4 @@ -u.i = 511 -u.i9 = -1 -u.i31 = -65025 +uu.i = 511 +uu.i9 = -1 +uu.i31= -65025 exit 0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/PassAnalysisSupport.h
Changes in directory llvm/include/llvm: PassAnalysisSupport.h updated: 1.30 -> 1.31 --- Log message: Add a addRequiredTransitiveID member function, which is to addRequiredTransitive as addRequiredID is to addRequired. --- Diffs of the changes: (+8 -6) PassAnalysisSupport.h | 14 -- 1 files changed, 8 insertions(+), 6 deletions(-) Index: llvm/include/llvm/PassAnalysisSupport.h diff -u llvm/include/llvm/PassAnalysisSupport.h:1.30 llvm/include/llvm/PassAnalysisSupport.h:1.31 --- llvm/include/llvm/PassAnalysisSupport.h:1.30Mon Apr 16 15:56:24 2007 +++ llvm/include/llvm/PassAnalysisSupport.h Mon May 14 09:21:46 2007 @@ -44,24 +44,26 @@ // for a pass. // AnalysisUsage &addRequiredID(AnalysisID ID) { +assert(ID && "Pass class not registered!"); Required.push_back(ID); return *this; } template AnalysisUsage &addRequired() { -assert(Pass::getClassPassInfo() && "Pass class not registered!"); -Required.push_back(Pass::getClassPassInfo()); -return *this; +return addRequiredID(Pass::getClassPassInfo()); } - template - AnalysisUsage &addRequiredTransitive() { -AnalysisID ID = Pass::getClassPassInfo(); + AnalysisUsage &addRequiredTransitiveID(AnalysisID ID) { assert(ID && "Pass class not registered!"); Required.push_back(ID); RequiredTransitive.push_back(ID); return *this; } + template + AnalysisUsage &addRequiredTransitive() { +AnalysisID ID = Pass::getClassPassInfo(); +return addRequiredTransitiveID(ID); + } // addPreserved - Add the specified ID to the set of analyses preserved by // this pass ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Support/DOTGraphTraits.h
Changes in directory llvm/include/llvm/Support: DOTGraphTraits.h updated: 1.15 -> 1.16 --- Log message: Use templates for the GraphType for DefaultDOTGraphTraits' members instead of just using void*. This allows it to be used with graph adapters like Inverse. --- Diffs of the changes: (+12 -7) DOTGraphTraits.h | 19 --- 1 files changed, 12 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Support/DOTGraphTraits.h diff -u llvm/include/llvm/Support/DOTGraphTraits.h:1.15 llvm/include/llvm/Support/DOTGraphTraits.h:1.16 --- llvm/include/llvm/Support/DOTGraphTraits.h:1.15 Mon Oct 2 07:26:53 2006 +++ llvm/include/llvm/Support/DOTGraphTraits.h Mon May 14 09:23:27 2007 @@ -30,12 +30,14 @@ /// getGraphName - Return the label for the graph as a whole. Printed at the /// top of the graph. /// - static std::string getGraphName(const void *Graph) { return ""; } + template + static std::string getGraphName(GraphType Graph) { return ""; } /// getGraphProperties - Return any custom properties that should be included /// in the top level graph structure for dot. /// - static std::string getGraphProperties(const void *Graph) { + template + static std::string getGraphProperties(GraphType Graph) { return ""; } @@ -48,19 +50,22 @@ /// getNodeLabel - Given a node and a pointer to the top level graph, return /// the label to print in the node. - static std::string getNodeLabel(const void *Node, const void *Graph) { + template + static std::string getNodeLabel(const void *Node, GraphType Graph) { return ""; } /// hasNodeAddressLabel - If this method returns true, the address of the node /// is added to the label of the node. - static bool hasNodeAddressLabel(const void *Node, const void *Graph) { + template + static bool hasNodeAddressLabel(const void *Node, GraphType Graph) { return false; } /// If you want to specify custom node attributes, this is the place to do so /// - static std::string getNodeAttributes(const void *Node, const void *Graph) { + template + static std::string getNodeAttributes(const void *Node, GraphType Graph) { return ""; } @@ -100,8 +105,8 @@ /// GraphType is passed in as an argument. You may call arbitrary methods on /// it to add things to the output graph. /// - template - static void addCustomGraphFeatures(const void *Graph, GraphWriter &GW) {} + template + static void addCustomGraphFeatures(GraphType Graph, GraphWriter &GW) {} }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/CFGPrinter.cpp
Changes in directory llvm/lib/Analysis: CFGPrinter.cpp updated: 1.26 -> 1.27 --- Log message: Add passes -view-cfg and -view-cfg-only that are like -print-cfg and -print-cfg-only except they use the ViewCFG function, which displays the CFG rendered with graphviz with gv. --- Diffs of the changes: (+42 -0) CFGPrinter.cpp | 42 ++ 1 files changed, 42 insertions(+) Index: llvm/lib/Analysis/CFGPrinter.cpp diff -u llvm/lib/Analysis/CFGPrinter.cpp:1.26 llvm/lib/Analysis/CFGPrinter.cpp:1.27 --- llvm/lib/Analysis/CFGPrinter.cpp:1.26 Sun May 6 08:37:16 2007 +++ llvm/lib/Analysis/CFGPrinter.cppMon May 14 09:25:08 2007 @@ -90,6 +90,48 @@ } namespace { + struct VISIBILITY_HIDDEN CFGViewer : public FunctionPass { +static char ID; // Pass identifcation, replacement for typeid +CFGViewer() : FunctionPass((intptr_t)&ID) {} + +virtual bool runOnFunction(Function &F) { + F.viewCFG(); + return false; +} + +void print(std::ostream &OS, const Module* = 0) const {} + +virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); +} + }; + + char CFGViewer::ID = 0; + RegisterPass V0("view-cfg", + "View CFG of function"); + + struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass { +static char ID; // Pass identifcation, replacement for typeid +CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {} + +virtual bool runOnFunction(Function &F) { + CFGOnly = true; + F.viewCFG(); + CFGOnly = false; + return false; +} + +void print(std::ostream &OS, const Module* = 0) const {} + +virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); +} + }; + + char CFGOnlyViewer::ID = 0; + RegisterPass V1("view-cfg-only", + "View CFG of function (with no function bodies)"); + struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass { static char ID; // Pass identification, replacement for typeid CFGPrinter() : FunctionPass((intptr_t)&ID) {} ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnroll.cpp
Changes in directory llvm/lib/Transforms/Scalar: LoopUnroll.cpp updated: 1.47 -> 1.48 --- Log message: Correct a few comments. --- Diffs of the changes: (+5 -5) LoopUnroll.cpp | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.47 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.48 --- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.47 Fri May 11 15:53:41 2007 +++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp Mon May 14 09:31:17 2007 @@ -168,7 +168,7 @@ LI->removeBlock(BB); BB->eraseFromParent(); - // Inherit predecessors name if it exists... + // Inherit predecessor's name if it exists... if (!OldName.empty() && !OnlyPred->hasName()) OnlyPred->setName(OldName); @@ -191,10 +191,10 @@ } /// Unroll the given loop by UnrollCount, or by a heuristically-determined -/// value if Count is zero. If Threshold is non-NULL, it points to -/// a Threshold value to limit code size expansion. If the loop size would -/// expand beyond the threshold value, unrolling is suppressed. The return -/// value is false if no transformations are performed. +/// value if Count is zero. If Threshold is not NoThreshold, it is a value +/// to limit code size expansion. If the loop size would expand beyond the +/// threshold value, unrolling is suppressed. The return value is true if +/// any transformations are performed. /// bool LoopUnroll::unrollLoop(Loop *L, unsigned Count, unsigned Threshold) { assert(L->isLCSSAForm()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.242 -> 1.243 --- Log message: Revise definition of part_select. The wrapping behavior is not useful so in the reverse case the only difference is that the bits are returned in reverse order. --- Diffs of the changes: (+6 -11) LangRef.html | 17 ++--- 1 files changed, 6 insertions(+), 11 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.242 llvm/docs/LangRef.html:1.243 --- llvm/docs/LangRef.html:1.242Sun Apr 29 13:35:00 2007 +++ llvm/docs/LangRef.html Mon May 14 11:14:57 2007 @@ -4655,16 +4655,11 @@ A mask of the retained bits is created by shifting a -1 value. The mask is ANDed with %val to produce the result. -In reverse mode, a similar computation is made except that: - - The bits selected wrap around to include both the highest and lowest bits. - For example, part.select(i16 X, 4, 7) selects bits from X with a mask of - 0x00F0 (forwards case) while part.select(i16 X, 8, 3) selects bits from X - with a mask of 0xFF0F. - The bits returned in the reverse case are reversed. So, if X has the value - 0x6ACF and we apply part.select(i16 X, 8, 3) to it, we get back the value - 0x0A6F. - +In reverse mode, a similar computation is made except that the bits are +returned in the reverse order. So, for example, if X has the value +i16 0x0ACF (10101100) and we apply +part.select(i16 X, 8, 3) to it, we get back the value +i16 0x0026 (00100110). @@ -4756,7 +4751,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/04/29 18:35:00 $ + Last modified: $Date: 2007/05/14 16:14:57 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.243 -> 1.244 --- Log message: The wrapping behavior of part_set is not desirable. Adjust the documentation to describe the desired behavior. --- Diffs of the changes: (+7 -7) LangRef.html | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.243 llvm/docs/LangRef.html:1.244 --- llvm/docs/LangRef.html:1.243Mon May 14 11:14:57 2007 +++ llvm/docs/LangRef.html Mon May 14 11:50:20 2007 @@ -4700,15 +4700,15 @@ are replaced with corresponding bits from %repl. That is the 0th bit in %repl replaces the %loth bit in %val and etc. up to the %hith bit. -In reverse mode, a similar computation is made except that the bits replaced -wrap around to include both the highest and lowest bits. For example, if a -16 bit value is being replaced then %lo=8 and %hi=4 would -cause these bits to be set: 0xFF1F. +In reverse mode, a similar computation is made except that the bits are +reversed. That is, the 0th bit in %repl replaces the +%hi bit in %val and etc. down to the %loth bit. Examples: llvm.part.set(0x, 0, 4, 7) -> 0xFF0F - llvm.part.set(0x, 0, 7, 4) -> 0x0060 - llvm.part.set(0x, 0, 8, 3) -> 0x00F0 + llvm.part.set(0x, 0, 7, 4) -> 0xFF0F + llvm.part.set(0x, 1, 7, 4) -> 0xFF8F + llvm.part.set(0x, F, 8, 3) -> 0xFFE7 llvm.part.set(0x, 0, 3, 8) -> 0xFE07 @@ -4751,7 +4751,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/05/14 16:14:57 $ + Last modified: $Date: 2007/05/14 16:50:20 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp
Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.82 -> 1.83 --- Log message: Give names to the final result values of the part_set computations. This just aids in readability and debugability of the output. No functional change. --- Diffs of the changes: (+2 -2) IntrinsicLowering.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.82 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.83 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.82 Sat May 12 06:07:40 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Mon May 14 12:21:17 2007 @@ -568,7 +568,7 @@ Value* nott2 = BinaryOperator::createXor(t2, ValMask, "", forward); Value* t3= BinaryOperator::createShl(Rep4, Lo, "", forward); Value* t4= BinaryOperator::createAnd(nott2, Val, "", forward); -Value* FRslt = BinaryOperator::createOr(t3, t4, "", forward); +Value* FRslt = BinaryOperator::createOr(t3, t4, "part_set_fwd", forward); new ReturnInst(FRslt, forward); // Block "reverse" @@ -587,7 +587,7 @@ Value* t11 = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse); Value* t13 = BinaryOperator::createLShr(Rep4, t11, "",reverse); Value* t14 = BinaryOperator::createOr(t10, t9, "", reverse); -Value* RRslt = BinaryOperator::createOr(t14, t13, "", reverse); +Value* RRslt = BinaryOperator::createOr(t14, t13, "part_set_rvrs", reverse); new ReturnInst(RRslt, reverse); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
Changes in directory llvm/test/CodeGen/CBackend: 2007-01-08-ParamAttr-ICmp.ll updated: 1.6 -> 1.7 --- Log message: Update this test to match the (corrected) output from the CBE. --- Diffs of the changes: (+2 -1) 2007-01-08-ParamAttr-ICmp.ll |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll diff -u llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.6 llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.7 --- llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.6 Sun Apr 15 14:21:54 2007 +++ llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll Mon May 14 12:56:39 2007 @@ -1,6 +1,7 @@ ; For PR1099 ; RUN: llvm-as < %s | llc -march=c | \ -; RUN: grep {return llvm_cbe_tmp2 == llvm_cbe_b_0_0_val)) ? (1) : (0)))} +; RUN: grep {return ((unsigned short )llvm_cbe_tmp2&65535U) == ((unsigned +short )llvm_cbe_b_0_0_val&65535U))) ? (1) : (0)))} target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll
Changes in directory llvm/test/CodeGen/CBackend: 2007-01-08-ParamAttr-ICmp.ll updated: 1.7 -> 1.8 --- Log message: Reverse last patch .. premature. Depends on uncommitted CBE patch. --- Diffs of the changes: (+1 -2) 2007-01-08-ParamAttr-ICmp.ll |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll diff -u llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.7 llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.8 --- llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.7 Mon May 14 12:56:39 2007 +++ llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll Mon May 14 12:58:52 2007 @@ -1,7 +1,6 @@ ; For PR1099 ; RUN: llvm-as < %s | llc -march=c | \ -; RUN: grep {return ((unsigned short )llvm_cbe_tmp2&65535U) == ((unsigned -short )llvm_cbe_b_0_0_val&65535U))) ? (1) : (0)))} +; RUN: grep {return llvm_cbe_tmp2 == llvm_cbe_b_0_0_val)) ? (1) : (0)))} target datalayout = "e-p:32:32" target triple = "i686-apple-darwin8" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/NewNightlyTest.pl
Changes in directory llvm/utils: NewNightlyTest.pl updated: 1.72 -> 1.73 --- Log message: Remove duplicated line. --- Diffs of the changes: (+0 -1) NewNightlyTest.pl |1 - 1 files changed, 1 deletion(-) Index: llvm/utils/NewNightlyTest.pl diff -u llvm/utils/NewNightlyTest.pl:1.72 llvm/utils/NewNightlyTest.pl:1.73 --- llvm/utils/NewNightlyTest.pl:1.72 Thu May 3 09:05:07 2007 +++ llvm/utils/NewNightlyTest.plMon May 14 13:03:45 2007 @@ -182,7 +182,6 @@ shift; next; } if (/^-compileflags/){ $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; } if (/^-use-gmake/) { $MAKECMD = "gmake"; shift; next; } - if (/^-compileflags/){ $MAKEOPTS = "$MAKEOPTS $ARGV[0]"; shift; next; } if (/^-extraflags/) { $CONFIGUREARGS .= " --with-extra-options=\'$ARGV[0]\'"; shift; next;} if (/^-noexternals$/){ $NOEXTERNALS = 1; next; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/reductions.c reductions.reference_output
Changes in directory llvm-test/SingleSource/UnitTests/Integer: reductions.c added (r1.1) reductions.reference_output added (r1.1) --- Log message: Add test cases for bitwise reduction operators. --- Diffs of the changes: (+68 -0) reductions.c| 59 reductions.reference_output |9 ++ 2 files changed, 68 insertions(+) Index: llvm-test/SingleSource/UnitTests/Integer/reductions.c diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/reductions.c:1.1 *** /dev/null Mon May 14 13:04:18 2007 --- llvm-test/SingleSource/UnitTests/Integer/reductions.c Mon May 14 13:04:08 2007 *** *** 0 --- 1,59 + #include "bits.h" + #include + + int test_reduce_or(uint68 x) + { + unsigned result = reduce(or, x) != 0; + printf("reduce(or, x) = %d\n", result); + return result; + } + + int test_reduce_nor(uint68 x) + { + unsigned result = reduce(nor, x) != 0; + printf("reduce(nor, x) = %d\n", result); + return result; + } + + int test_reduce_xor(uint68 x) + { + unsigned result = reduce(xor, x) != 0; + printf("reduce(xor, x) = %d\n", result); + return result; + } + + int test_reduce_nxor(uint68 x) + { + unsigned result = reduce(nxor, x) != 0; + printf("reduce(nxor, x) = %d\n", result); + return result; + } + + int test_reduce_and(uint68 x) + { + unsigned result = reduce(and, x) != 0; + printf("reduce(and, x) = %d\n", result); + return result; + } + + int test_reduce_nand(uint68 x) + { + unsigned result = reduce(nand, x) != 0; + printf("reduce(nand, x) = %d\n", result); + return result; + } + + + int main(int argc, char** argv) { + uint68 x = 0xF0F0F0F0F0F0F0F0ULL; + int result = 0; + printf("x = "); + printBits(x); + printf("\n"); + result = + test_reduce_or(x) + test_reduce_nor(x) + + test_reduce_xor(x) + test_reduce_nxor(x) + + test_reduce_and(x) + test_reduce_nand(x); + printf("Sum of reductions of x = %d\n", result); + return result; + } Index: llvm-test/SingleSource/UnitTests/Integer/reductions.reference_output diff -c /dev/null llvm-test/SingleSource/UnitTests/Integer/reductions.reference_output:1.1 *** /dev/null Mon May 14 13:04:29 2007 --- llvm-test/SingleSource/UnitTests/Integer/reductions.reference_output Mon May 14 13:04:08 2007 *** *** 0 --- 1,9 + x = + reduce(or, x) = 1 + reduce(nor, x) = 0 + reduce(xor, x) = 0 + reduce(nxor, x) = 1 + reduce(and, x) = 0 + reduce(nand, x) = 1 + Sum of reductions of x = 3 + exit 3 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/ARM/aliases.ll
Changes in directory llvm/test/CodeGen/ARM: aliases.ll added (r1.1) --- Log message: Enable aliases on arm-linux. --- Diffs of the changes: (+32 -0) aliases.ll | 32 1 files changed, 32 insertions(+) Index: llvm/test/CodeGen/ARM/aliases.ll diff -c /dev/null llvm/test/CodeGen/ARM/aliases.ll:1.1 *** /dev/null Mon May 14 13:33:06 2007 --- llvm/test/CodeGen/ARM/aliases.llMon May 14 13:32:56 2007 *** *** 0 --- 1,32 + ; RUN: llvm-as < %s | \ + ; RUN: llc -mtriple=arm-linux-gnueabi -o %t -f + ; RUN: grep -c set %t | grep 5 + ; RUN: grep -c globl %t | grep 4 + ; RUN: grep -c weak %t | grep 1 + + @bar = external global i32 + @foo1 = alias i32* @bar + @foo2 = alias i32* @bar + + %FunTy = type i32() + + declare i32 @foo_f() + @bar_f = alias weak %FunTy* @foo_f + + @bar_i = alias internal i32* @bar + + @A = alias bitcast (i32* @bar to i64*) + + define i32 @test() { + entry: +%tmp = load i32* @foo1 +%tmp1 = load i32* @foo2 +%tmp0 = load i32* @bar_i +%tmp2 = call i32 @foo_f() +%tmp3 = add i32 %tmp, %tmp2 +%tmp4 = call %FunTy* @bar_f() +%tmp5 = add i32 %tmp3, %tmp4 +%tmp6 = add i32 %tmp1, %tmp5 +%tmp7 = add i32 %tmp6, %tmp0 +ret i32 %tmp7 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp
Changes in directory llvm/lib/Target/ARM: ARMTargetAsmInfo.cpp updated: 1.20 -> 1.21 --- Log message: Enable aliases on arm-linux. --- Diffs of the changes: (+1 -0) ARMTargetAsmInfo.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp diff -u llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.20 llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.21 --- llvm/lib/Target/ARM/ARMTargetAsmInfo.cpp:1.20 Thu May 3 15:28:35 2007 +++ llvm/lib/Target/ARM/ARMTargetAsmInfo.cppMon May 14 13:32:55 2007 @@ -69,6 +69,7 @@ ReadOnlySection = "\t.section\t.rodata\n"; PrivateGlobalPrefix = ".L"; WeakRefDirective = "\t.weak\t"; +SetDirective = "\t.set\t"; DwarfRequiresFrameSection = false; DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",%progbits"; DwarfInfoSection ="\t.section\t.debug_info,\"\",%progbits"; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bigint.c bigint.reference_output
Changes in directory llvm-test/SingleSource/UnitTests/Integer: bigint.c updated: 1.8 -> 1.9 bigint.reference_output updated: 1.2 -> 1.3 --- Log message: Make the output of this test case easier to verify. --- Diffs of the changes: (+42 -19) bigint.c| 46 +- bigint.reference_output | 15 +-- 2 files changed, 42 insertions(+), 19 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bigint.c diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.8 llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.9 --- llvm-test/SingleSource/UnitTests/Integer/bigint.c:1.8 Wed Apr 18 00:40:12 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.c Mon May 14 13:43:28 2007 @@ -17,37 +17,49 @@ const uint10 bnd = 1023; -int500 x = 0xULL; +int500 x = -1; int169 y = -0xabcdefdeULL; int my_test() { + printf("Initially:\n"); + printf("int500 x = "); + printBits(x); + printf("\n"); + printf("int169 y = "); + printBits(y); + printf("\n"); + uint10 i = 0; int169 result; int32 l_result; long long rem; long long rem2; - { -; -for ( ; ; ) { - bool ssdm_tmp_1 = (i < bnd); - if (!ssdm_tmp_1) break; - if (i % 2 == 0) -x = x + 1; - else -y = y - x; - - ++i; -} + for ( i = 0 ; i < bnd ; ++i) { +if (i % 2 == 0) + x = x + 1; +else + y = y - x; } + + printf("\nAfter modification:\n"); + printf("int500 x = "); + printBits(x); + printf("\n"); + printf("int169 y = "); + printBits(y); + printf("\n"); + + printf("\nresult = x * y = "); result = x*y; + printBits(result); + printf("\n"); + l_result = result % 0x37015; - rem = l_result; - printf("rem = %lld\n", rem); + printf("\nresult %% 0x37015 = %d\n", l_result); l_result = result % -198721; - rem2 = l_result; - printf("rem2 = %lld\n", rem2); + printf("\nresult %% -198721 = %d\n", l_result); return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output:1.2 llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output:1.3 --- llvm-test/SingleSource/UnitTests/Integer/bigint.reference_output:1.2 Wed Apr 18 00:40:12 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bigint.reference_outputMon May 14 13:43:28 2007 @@ -1,3 +1,14 @@ -rem = 54392 -rem2 = 143376 +Initially: +int500 x = +int169 y = 101010111001100100010 + +After modification: +int500 x = 0001 +int169 y = 101010111000100110011 + +result = x * y = 01010100110110110001011101101 + +result % 0x37015 = -221497 + +result % -198721 = -187511 exit 0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp
Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.50 -> 1.51 --- Log message: Optimize PIC implementation. GOTOFF can be used when the symbol is defined and used in the same module. --- Diffs of the changes: (+1 -1) ARMISelLowering.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.51 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50Thu May 3 19:26:58 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon May 14 13:46:23 2007 @@ -792,7 +792,7 @@ GlobalValue *GV = cast(Op)->getGlobal(); Reloc::Model RelocM = getTargetMachine().getRelocationModel(); if (RelocM == Reloc::PIC_) { -bool UseGOTOFF = GV->hasInternalLinkage(); +bool UseGOTOFF = !GV->isDeclaration(); ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT"); SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] Regalloc Refactoring
Unless Chris has any comments, please fix the createRegisterCoalescer () issue and then check it in (or send the patch). I am fixing a coalescer bug at this point. Please merge in my changes if I happen to get that in before you do. Thanks, Evan On May 9, 2007, at 4:54 PM, David A. Greene wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Evan Cheng wrote: >> Hi, >> >> The patch seems pretty safe to me. The only thing I am not sure >> about is: > > [snip] > >> It's not clear to me if this is the right way to model this pass. >> After >> all, this is not an analysis pass. Perhaps the right thing to do >> is to >> model this after the register allocator. Add a >> createRegisterCoalescer() >> to Passes.cpp which would allow us to choose the one we want. Then >> register the pass in LLVMTargetMachine.cpp. Chris? What do you say? > > Yeah, I wasn't sure about that either. I modeled it after the way > that > out-of-ssa conversion is done since LinearScan assumes that coalescing > has been done. > > I think your suggestion of createRegisterCoalescer() is the right > solution in the long run. My goal here was to submit the first phase > of a larger refactoring effort that separated coalescing from > live interval analysis but tried not to do anything else dramatic. > > -Dave > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.6 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFGQl9DgQsI8xjTYs8RAm5mAJ9mOWIQKNX63QHhh46SZDkx2HIW5QCaAtl5 > 3jHR+bEO1bQ2PGs6W52rhGA= > =ctF+ > -END PGP SIGNATURE- > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/bits.h
Changes in directory llvm-test/SingleSource/UnitTests/Integer: bits.h updated: 1.6 -> 1.7 --- Log message: Add needed integer bit widths. Make signed things actually signed .. duh. --- Diffs of the changes: (+6 -4) bits.h | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/bits.h diff -u llvm-test/SingleSource/UnitTests/Integer/bits.h:1.6 llvm-test/SingleSource/UnitTests/Integer/bits.h:1.7 --- llvm-test/SingleSource/UnitTests/Integer/bits.h:1.6 Sat May 12 13:44:37 2007 +++ llvm-test/SingleSource/UnitTests/Integer/bits.h Mon May 14 14:11:08 2007 @@ -41,6 +41,8 @@ typedef unsigned int __attribute__((bitwidth(68))) uint68; typedef unsigned int __attribute__((bitwidth(69))) uint69; typedef unsigned int __attribute__((bitwidth(128))) uint128; +typedef unsigned int __attribute__((bitwidth(250))) uint250; +typedef unsigned int __attribute__((bitwidth(256))) uint256; typedef int __attribute__((bitwidth(9))) int9; typedef int __attribute__((bitwidth(10))) int10; @@ -49,13 +51,13 @@ typedef int __attribute__((bitwidth(32))) int32; typedef int __attribute__((bitwidth(33))) int33; typedef int __attribute__((bitwidth(54))) int54; +typedef int __attribute__((bitwidth(63))) int63; typedef int __attribute__((bitwidth(68))) int68; typedef int __attribute__((bitwidth(69))) int69; - typedef int __attribute__((bitwidth(169))) int169; -typedef unsigned int __attribute__((bitwidth(250))) int250; -typedef unsigned int __attribute__((bitwidth(256))) int256; -typedef unsigned int __attribute__((bitwidth(256))) int500; +typedef int __attribute__((bitwidth(250))) int250; +typedef int __attribute__((bitwidth(256))) int256; +typedef int __attribute__((bitwidth(256))) int500; #define bitwidthof(TORV) (__bitwidthof__(typeof(TORV))) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp
> Optimize PIC implementation. GOTOFF can be used when the symbol is > defined > and used in the same module. Does this work for weak symbols? -Chris > > --- > Diffs of the changes: (+1 -1) > > ARMISelLowering.cpp |2 +- > 1 files changed, 1 insertion(+), 1 deletion(-) > > > Index: llvm/lib/Target/ARM/ARMISelLowering.cpp > diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50 llvm/lib/ > Target/ARM/ARMISelLowering.cpp:1.51 > --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50 Thu May 3 > 19:26:58 2007 > +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon May 14 13:46:23 2007 > @@ -792,7 +792,7 @@ >GlobalValue *GV = cast(Op)->getGlobal(); >Reloc::Model RelocM = getTargetMachine().getRelocationModel(); >if (RelocM == Reloc::PIC_) { > -bool UseGOTOFF = GV->hasInternalLinkage(); > +bool UseGOTOFF = !GV->isDeclaration(); > ARMConstantPoolValue *CPV = >new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? > "GOTOFF":"GOT"); > SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] Regalloc Refactoring
On May 9, 2007, at 4:54 PM, David A. Greene wrote: > Evan Cheng wrote: >> Hi, >> >> The patch seems pretty safe to me. The only thing I am not sure >> about is: > > [snip] > >> It's not clear to me if this is the right way to model this pass. >> After >> all, this is not an analysis pass. Perhaps the right thing to do >> is to >> model this after the register allocator. Add a >> createRegisterCoalescer() >> to Passes.cpp which would allow us to choose the one we want. Then >> register the pass in LLVMTargetMachine.cpp. Chris? What do you say? > > Yeah, I wasn't sure about that either. I modeled it after the way > that > out-of-ssa conversion is done since LinearScan assumes that coalescing > has been done. > > I think your suggestion of createRegisterCoalescer() is the right > solution in the long run. My goal here was to submit the first phase > of a larger refactoring effort that separated coalescing from > live interval analysis but tried not to do anything else dramatic. I think this part of the patch is right-minded. I took a quick look at the patch and it looks good to me! -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/LiveVariables.cpp
Changes in directory llvm/lib/CodeGen: LiveVariables.cpp updated: 1.83 -> 1.84 --- Log message: When marking a register as being implicitly defined, make sure to clear its partial use info as well. --- Diffs of the changes: (+2 -0) LiveVariables.cpp |2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/CodeGen/LiveVariables.cpp diff -u llvm/lib/CodeGen/LiveVariables.cpp:1.83 llvm/lib/CodeGen/LiveVariables.cpp:1.84 --- llvm/lib/CodeGen/LiveVariables.cpp:1.83 Tue May 8 14:00:00 2007 +++ llvm/lib/CodeGen/LiveVariables.cpp Mon May 14 15:39:18 2007 @@ -314,6 +314,7 @@ } PhysRegInfo[SubReg] = MI; PhysRegUsed[SubReg] = false; +PhysRegPartUse[SubReg] = NULL; } if (MI) @@ -328,6 +329,7 @@ MI->addRegOperand(SuperReg, true/*IsDef*/,true/*IsImp*/); PhysRegInfo[SuperReg] = MI; PhysRegUsed[SuperReg] = false; +PhysRegPartUse[SuperReg] = NULL; } else { // Remember this partial def. PhysRegPartDef[SuperReg].push_back(MI); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll 2007-02-19-LiveIntervalAssert.cpp
Changes in directory llvm/test/CodeGen/X86: 2007-02-19-LiveIntervalAssert.ll added (r1.1) 2007-02-19-LiveIntervalAssert.cpp (r1.1) removed --- Log message: Doh. .cpp -> .ll --- Diffs of the changes: (+21 -0) 2007-02-19-LiveIntervalAssert.ll | 21 + 1 files changed, 21 insertions(+) Index: llvm/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll diff -c /dev/null llvm/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll:1.1 *** /dev/null Mon May 14 15:43:38 2007 --- llvm/test/CodeGen/X86/2007-02-19-LiveIntervalAssert.ll Mon May 14 15:43:28 2007 *** *** 0 --- 1,21 + ; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu -relocation-model=pic + ; PR1027 + + %struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } + %struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 } + @stderr = external global %struct._IO_FILE* + + define void @__eprintf(i8* %string, i8* %expression, i32 %line, i8* %filename) { + %tmp = load %struct._IO_FILE** @stderr + %tmp5 = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf( %struct._IO_FILE* %tmp, i8* %string, i8* %expression, i32 %line, i8* %filename ) + %tmp6 = load %struct._IO_FILE** @stderr + %tmp7 = tail call i32 @fflush( %struct._IO_FILE* %tmp6 ) + tail call void @abort( ) + unreachable + } + + declare i32 @fprintf(%struct._IO_FILE*, i8*, ...) + + declare i32 @fflush(%struct._IO_FILE*) + + declare void @abort() ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll
Changes in directory llvm/test/CodeGen/X86: 2007-05-14-LiveIntervalAssert.ll added (r1.1) --- Log message: New test. --- Diffs of the changes: (+27 -0) 2007-05-14-LiveIntervalAssert.ll | 27 +++ 1 files changed, 27 insertions(+) Index: llvm/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll diff -c /dev/null llvm/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll:1.1 *** /dev/null Mon May 14 15:47:31 2007 --- llvm/test/CodeGen/X86/2007-05-14-LiveIntervalAssert.ll Mon May 14 15:47:21 2007 *** *** 0 --- 1,27 + ; RUN: llvm-as < %s | llc -march=x86-64 + + %struct.XDesc = type <{ i32, %struct.OpaqueXDataStorageType** }> + %struct.OpaqueXDataStorageType = type opaque + + declare i16 @GetParamDesc(%struct.XDesc*, i32, i32, %struct.XDesc*) sext + + declare void @r_raise(i64, i8*, ...) + + define i64 @app_send_event(i64 %self, i64 %event_class, i64 %event_id, i64 %params, i64 %need_retval) { + entry: + br i1 false, label %cond_true109, label %bb83.preheader + + bb83.preheader: ; preds = %entry + ret i64 0 + + cond_true109: ; preds = %entry + br i1 false, label %cond_next164, label %cond_true239 + + cond_next164: ; preds = %cond_true109 + %tmp176 = call i16 @GetParamDesc( %struct.XDesc* null, i32 1701999219, i32 1413830740, %struct.XDesc* null ) sext ; [#uses=0] + call void (i64, i8*, ...)* @r_raise( i64 0, i8* null ) + unreachable + + cond_true239: ; preds = %cond_true109 + ret i64 0 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/188.ammp/Makefile
Changes in directory llvm-test/External/SPEC/CFP2000/188.ammp: Makefile updated: 1.6 -> 1.7 --- Log message: Fix SMALL_PROBLEM_SIZE. --- Diffs of the changes: (+4 -0) Makefile |4 1 files changed, 4 insertions(+) Index: llvm-test/External/SPEC/CFP2000/188.ammp/Makefile diff -u llvm-test/External/SPEC/CFP2000/188.ammp/Makefile:1.6 llvm-test/External/SPEC/CFP2000/188.ammp/Makefile:1.7 --- llvm-test/External/SPEC/CFP2000/188.ammp/Makefile:1.6 Mon Sep 6 22:41:18 2004 +++ llvm-test/External/SPEC/CFP2000/188.ammp/Makefile Mon May 14 16:05:09 2007 @@ -7,11 +7,15 @@ # override RUN_TYPE (this is a long running test): ifndef RUN_TYPE +ifdef SMALL_PROBLEM_SIZE +RUN_TYPE=test +else ifdef LARGE_PROBLEM_SIZE RUN_TYPE := ref else RUN_TYPE := train endif endif +endif include ../../Makefile.spec2000 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.243 -> 1.244 --- Log message: Fix for PR1406: http://llvm.org/PR1406 : v1 = r2 = move v1 = op r2 ... r2 = move v1 = op r2 Clear the first r2 kill if v1 and r2 are joined. --- Diffs of the changes: (+35 -2) LiveIntervalAnalysis.cpp | 37 +++-- 1 files changed, 35 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.243 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.244 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.243 Wed May 2 20:11:53 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Mon May 14 16:10:05 2007 @@ -977,7 +977,7 @@ isDead = false; } else { MachineOperand *MOU; - MachineInstr *LastUse= lastRegisterUse(repSrcReg, SrcStart, CopyIdx, MOU); + MachineInstr *LastUse= lastRegisterUse(SrcStart, CopyIdx, repSrcReg, MOU); if (LastUse) { // Shorten the liveinterval to the end of last use. MOU->setIsKill(); @@ -1072,6 +1072,11 @@ // we have to update any aliased register's live ranges to indicate that they // have clobbered values for this range. if (MRegisterInfo::isPhysicalRegister(repDstReg)) { +// Unset unnecessary kills. +for (LiveInterval::Ranges::const_iterator I = SrcInt.begin(), + E = SrcInt.end(); I != E; ++I) + unsetRegisterKills(I->start, I->end, repDstReg); + // Update the liveintervals of sub-registers. for (const unsigned *AS = mri_->getSubRegisters(repDstReg); *AS; ++AS) getInterval(*AS).MergeInClobberRanges(SrcInt); @@ -1632,7 +1637,7 @@ /// cycles Start and End. It also returns the use operand by reference. It /// returns NULL if there are no uses. MachineInstr * -LiveIntervals::lastRegisterUse(unsigned Reg, unsigned Start, unsigned End, +LiveIntervals::lastRegisterUse(unsigned Start, unsigned End, unsigned Reg, MachineOperand *&MOU) { int e = (End-1) / InstrSlots::NUM * InstrSlots::NUM; int s = Start; @@ -1685,6 +1690,34 @@ } } +/// unsetRegisterKills - Unset IsKill property of all uses of specific register +/// between cycles Start and End. +void LiveIntervals::unsetRegisterKills(unsigned Start, unsigned End, + unsigned Reg) { + int e = (End-1) / InstrSlots::NUM * InstrSlots::NUM; + int s = Start; + while (e >= s) { +// Skip deleted instructions +MachineInstr *MI = getInstructionFromIndex(e); +while ((e - InstrSlots::NUM) >= s && !MI) { + e -= InstrSlots::NUM; + MI = getInstructionFromIndex(e); +} +if (e < s || MI == NULL) + return; + +for (unsigned i = 0, NumOps = MI->getNumOperands(); i != NumOps; ++i) { + MachineOperand &MO = MI->getOperand(i); + if (MO.isReg() && MO.isUse() && MO.isKill() && MO.getReg() && + mri_->regsOverlap(rep(MO.getReg()), Reg)) { +MO.unsetIsKill(); + } +} + +e -= InstrSlots::NUM; + } +} + /// hasRegisterDef - True if the instruction defines the specific register. /// bool LiveIntervals::hasRegisterDef(MachineInstr *MI, unsigned Reg) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
Changes in directory llvm/include/llvm/CodeGen: LiveIntervalAnalysis.h updated: 1.84 -> 1.85 --- Log message: Fix for PR1406: http://llvm.org/PR1406 : v1 = r2 = move v1 = op r2 ... r2 = move v1 = op r2 Clear the first r2 kill if v1 and r2 are joined. --- Diffs of the changes: (+5 -1) LiveIntervalAnalysis.h |6 +- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h diff -u llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.84 llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.85 --- llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h:1.84 Sun May 6 08:37:16 2007 +++ llvm/include/llvm/CodeGen/LiveIntervalAnalysis.hMon May 14 16:10:05 2007 @@ -271,7 +271,7 @@ /// lastRegisterUse - Returns the last use of the specific register between /// cycles Start and End. It also returns the use operand by reference. It /// returns NULL if there are no uses. -MachineInstr *lastRegisterUse(unsigned Reg, unsigned Start, unsigned End, +MachineInstr *lastRegisterUse(unsigned Start, unsigned End, unsigned Reg, MachineOperand *&MOU); /// findDefOperand - Returns the MachineOperand that is a def of the specific @@ -282,6 +282,10 @@ /// register of the specific instruction. void unsetRegisterKill(MachineInstr *MI, unsigned Reg); +/// unsetRegisterKills - Unset IsKill property of all uses of specific register +/// between cycles Start and End. +void unsetRegisterKills(unsigned Start, unsigned End, unsigned Reg); + /// hasRegisterDef - True if the instruction defines the specific register. /// bool hasRegisterDef(MachineInstr *MI, unsigned Reg); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll
Changes in directory llvm/test/CodeGen/ARM: 2007-05-14-RegScavengerAssert.ll added (r1.1) --- Log message: Test for PR1406: http://llvm.org/PR1406 . --- Diffs of the changes: (+30 -0) 2007-05-14-RegScavengerAssert.ll | 30 ++ 1 files changed, 30 insertions(+) Index: llvm/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll diff -c /dev/null llvm/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll:1.1 *** /dev/null Mon May 14 16:12:53 2007 --- llvm/test/CodeGen/ARM/2007-05-14-RegScavengerAssert.ll Mon May 14 16:12:43 2007 *** *** 0 --- 1,30 + ; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi + ; PR1406 + + %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* } + %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVRational*, i32* } + %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i3! 2, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 } + %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] } + %struct.AVOption = type opaque + %struct.AVPaletteControl = type { i32, [256 x i32] } + %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] } + %struct.AVRational = type { i32, i32 } + %struct.RcOverride = type { i32, i32, i32, float } + + define i32 @decode_init(%struct.AVCodecContext* %avctx) { + entry: + br i1 false, label %bb, label %cond_next789 + + bb: ; preds = %bb, %entry + br i1 false, label %bb59, label %bb + + bb59: ; preds = %bb + %tmp68 = sdiv i64 0, 0 ; [#uses=1] + %tmp6869 = trunc i64 %tmp68 to i32 ; [#uses=2] + %tmp81 = call i32 asm "smull $0, $1, $2, $3 \0A\09mov $0, $0, lsr $4\0A\09add $1, $0, $1, lsl $5\0A\09", "=&r,=*&r,r,r,i,i"( i32* null, i32 %tmp6869, i32 13316085, i32 23, i32 9 ) ; [#uses=0] + %tmp90 = call i32 asm "smull $0, $1, $2, $3 \0A\09mov $0, $0, lsr $4\0A\09add $1, $0, $1, lsl $5\0A\09", "=&r,=*&r,r,r,i,i"( i32* null, i32 %tmp6869, i32 10568984, i32 23, i32 9 ) ; [#uses=0] + unreachable + + cond_next789: ; preds = %entry + ret i32 0 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.139 -> 1.140 --- Log message: last minute trip, can't make it --- Diffs of the changes: (+2 -3) DevMtgMay2007.html |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.139 llvm-www/DevMtgMay2007.html:1.140 --- llvm-www/DevMtgMay2007.html:1.139 Sat May 12 05:37:03 2007 +++ llvm-www/DevMtgMay2007.html Mon May 14 16:14:57 2007 @@ -325,7 +325,6 @@ Jeff PoznanovicCray Inc. Ron PriceApple Inc. Chuck RoseAdobe Systems Incorporated. -Alex RosenbergSony Mark SchimmelWind River Reid SpencerIndependent Raju SubbianWind River @@ -339,7 +338,7 @@ - Total confirmed: 46 + Total confirmed: 45 Unconfirmed Attendees NameOrganization @@ -358,6 +357,6 @@ src="http://jigsaw.w3.org/css-validator/images/vcss"; alt="Valid CSS!"> http://validator.w3.org/check/referer";>http://www.w3.org/Icons/valid-html401"; alt="Valid HTML 4.01!"> -Last modified: $Date: 2007/05/12 10:37:03 $ +Last modified: $Date: 2007/05/14 21:14:57 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.244 -> 1.245 --- Log message: Only worry about intervening kill if there are more than one live ranges in the interval. --- Diffs of the changes: (+5 -3) LiveIntervalAnalysis.cpp |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.244 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.245 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.244 Mon May 14 16:10:05 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Mon May 14 16:23:51 2007 @@ -1073,9 +1073,11 @@ // have clobbered values for this range. if (MRegisterInfo::isPhysicalRegister(repDstReg)) { // Unset unnecessary kills. -for (LiveInterval::Ranges::const_iterator I = SrcInt.begin(), - E = SrcInt.end(); I != E; ++I) - unsetRegisterKills(I->start, I->end, repDstReg); +if (!DstInt.containsOneValue()) { + for (LiveInterval::Ranges::const_iterator I = SrcInt.begin(), + E = SrcInt.end(); I != E; ++I) +unsetRegisterKills(I->start, I->end, repDstReg); +} // Update the liveintervals of sub-registers. for (const unsigned *AS = mri_->getSubRegisters(repDstReg); *AS; ++AS) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/PowerPC/fneg.ll
Changes in directory llvm/test/CodeGen/PowerPC: fneg.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+12 -0) fneg.ll | 12 1 files changed, 12 insertions(+) Index: llvm/test/CodeGen/PowerPC/fneg.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/fneg.ll:1.1 *** /dev/null Mon May 14 17:04:26 2007 --- llvm/test/CodeGen/PowerPC/fneg.ll Mon May 14 17:04:16 2007 *** *** 0 --- 1,12 + ; RUN: llvm-as < %s | llc -march=ppc32 | not grep fneg + + define double @test1(double %a, double %b, double %c, double %d) { + entry: + %tmp2 = sub double -0.00e+00, %c; [#uses=1] + %tmp4 = mul double %tmp2, %d; [#uses=1] + %tmp7 = mul double %a, %b ; [#uses=1] + %tmp9 = sub double %tmp7, %tmp4 ; [#uses=1] + ret double %tmp9 + } + + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: DAGCombiner.cpp updated: 1.302 -> 1.303 --- Log message: implement a simple fneg optimization/propagation thing. This compiles: CodeGen/PowerPC/fneg.ll into: _t4: fmul f0, f3, f4 fmadd f1, f1, f2, f0 blr instead of: _t4: fneg f0, f3 fmul f0, f0, f4 fmsub f1, f1, f2, f0 blr --- Diffs of the changes: (+144 -7) DAGCombiner.cpp | 151 +--- 1 files changed, 144 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp diff -u llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.302 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.303 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:1.302 Wed May 9 16:49:47 2007 +++ llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon May 14 17:04:50 2007 @@ -344,9 +344,114 @@ } +//===--===// +// Helper Functions +//===--===// +/// isNegatibleForFree - Return 1 if we can compute the negated form of the +/// specified expression for the same cost as the expression itself, or 2 if we +/// can compute the negated form more cheaply than the expression itself. +static char isNegatibleForFree(SDOperand Op) { + // fneg is removable even if it has multiple uses. + if (Op.getOpcode() == ISD::FNEG) return 2; + + // Don't allow anything with multiple uses. + if (!Op.hasOneUse()) return 0; + + switch (Op.getOpcode()) { + default: return false; + case ISD::ConstantFP: +return 1; + case ISD::FADD: +// FIXME: determine better conditions for this xform. +if (!UnsafeFPMath) return 0; + +// -(A+B) -> -A - B +if (char V = isNegatibleForFree(Op.getOperand(0))) + return V; +// -(A+B) -> -B - A +return isNegatibleForFree(Op.getOperand(1)); + case ISD::FSUB: +// We can't turn -(A-B) into B-A when we honor signed zeros. +if (!UnsafeFPMath) return 0; + +// -(A-B) -> B-A +return 1; + + case ISD::FMUL: + case ISD::FDIV: +if (HonorSignDependentRoundingFPMath()) return 0; + +// -(X*Y) -> (-X * Y) or (X*-Y) +if (char V = isNegatibleForFree(Op.getOperand(0))) + return V; + +return isNegatibleForFree(Op.getOperand(1)); + + case ISD::FP_EXTEND: + case ISD::FP_ROUND: + case ISD::FSIN: +return isNegatibleForFree(Op.getOperand(0)); + } +} -//===--===// +/// GetNegatedExpression - If isNegatibleForFree returns true, this function +/// returns the newly negated expression. +static SDOperand GetNegatedExpression(SDOperand Op, SelectionDAG &DAG) { + // fneg is removable even if it has multiple uses. + if (Op.getOpcode() == ISD::FNEG) return Op.getOperand(0); + + // Don't allow anything with multiple uses. + assert(Op.hasOneUse() && "Unknown reuse!"); + + switch (Op.getOpcode()) { + default: assert(0 && "Unknown code"); + case ISD::ConstantFP: +return DAG.getConstantFP(-cast(Op)->getValue(), + Op.getValueType()); + case ISD::FADD: +// FIXME: determine better conditions for this xform. +assert(UnsafeFPMath); + +// -(A+B) -> -A - B +if (isNegatibleForFree(Op.getOperand(0))) + return DAG.getNode(ISD::FSUB, Op.getValueType(), + GetNegatedExpression(Op.getOperand(0), DAG), + Op.getOperand(1)); +// -(A+B) -> -B - A +return DAG.getNode(ISD::FSUB, Op.getValueType(), + GetNegatedExpression(Op.getOperand(1), DAG), + Op.getOperand(0)); + case ISD::FSUB: +// We can't turn -(A-B) into B-A when we honor signed zeros. +assert(UnsafeFPMath); + +// -(A-B) -> B-A +return DAG.getNode(ISD::FSUB, Op.getValueType(), Op.getOperand(1), + Op.getOperand(0)); + + case ISD::FMUL: + case ISD::FDIV: +assert(!HonorSignDependentRoundingFPMath()); + +// -(X*Y) -> -X * Y +if (isNegatibleForFree(Op.getOperand(0))) + return DAG.getNode(Op.getOpcode(), Op.getValueType(), + GetNegatedExpression(Op.getOperand(0), DAG), + Op.getOperand(1)); + +// -(X*Y) -> X * -Y +return DAG.getNode(Op.getOpcode(), Op.getValueType(), + Op.getOperand(0), + GetNegatedExpression(Op.getOperand(1), DAG)); + + case ISD::FP_EXTEND: + case ISD::FP_ROUND: + case ISD::FSIN: +return DAG.getNode(Op.getOpcode(), Op.getValueType(), + GetNegatedExpression(Op, DAG)); + } +} // isSetCCEquivalent - Return true if this node is a setcc, or is a select_cc @@ -416,6 +521,10 @@ return SDOperand(); } +//===--===// +// Ma
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp
Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.51 -> 1.52 --- Log message: Fix previous patch. GOTOFF can be used only when the symbol has internal linkage or hidden visibility. --- Diffs of the changes: (+1 -1) ARMISelLowering.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.51 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.52 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.51Mon May 14 13:46:23 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Mon May 14 18:20:21 2007 @@ -792,7 +792,7 @@ GlobalValue *GV = cast(Op)->getGlobal(); Reloc::Model RelocM = getTargetMachine().getRelocationModel(); if (RelocM == Reloc::PIC_) { -bool UseGOTOFF = !GV->isDeclaration(); +bool UseGOTOFF = GV->hasInternalLinkage() || GV->hasHiddenVisibility(); ARMConstantPoolValue *CPV = new ARMConstantPoolValue(GV, ARMCP::CPValue, UseGOTOFF ? "GOTOFF":"GOT"); SDOperand CPAddr = DAG.getTargetConstantPool(CPV, PtrVT, 2); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [llvm-gcc patch] enable pic codegen for arm-linux
This patch enables pic codegen for arm-linux. Lauro Index: gcc/config/arm/linux-elf.h === --- gcc/config/arm/linux-elf.h (revision 336) +++ gcc/config/arm/linux-elf.h (working copy) @@ -149,3 +149,17 @@ #ifdef HAVE_LD_AS_NEEDED #define USE_LD_AS_NEEDED 1 #endif + +/* APPLE LOCAL begin LLVM */ +#ifdef ENABLE_LLVM + +/* PIC codegen for ARM-Linux-ELF target */ +#define LLVM_SET_TARGET_OPTIONS(argvec) \ + if (flag_pic) \ +argvec.push_back ("--relocation-model=pic"); \ + else \ +argvec.push_back ("--relocation-model=static"); + +/* APPLE LOCAL end LLVM */ + +#endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/InstCombine/2007-05-14-Crash.ll
Changes in directory llvm/test/Transforms/InstCombine: 2007-05-14-Crash.ll added (r1.1) --- Log message: New testcase that crashes instcombine --- Diffs of the changes: (+18 -0) 2007-05-14-Crash.ll | 18 ++ 1 files changed, 18 insertions(+) Index: llvm/test/Transforms/InstCombine/2007-05-14-Crash.ll diff -c /dev/null llvm/test/Transforms/InstCombine/2007-05-14-Crash.ll:1.1 *** /dev/null Mon May 14 19:15:59 2007 --- llvm/test/Transforms/InstCombine/2007-05-14-Crash.llMon May 14 19:15:49 2007 *** *** 0 --- 1,18 + ; RUN: llvm-as < %s | opt -instcombine -disable-output + + target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" + target triple = "powerpc-apple-darwin8.8.0" + + %struct.abc = type { i32, [32 x i8] } + %struct.def = type { i8**, %struct.abc } + %struct.anon = type <{ }> + + define i8* @foo(%struct.anon* %deviceRef, %struct.abc* %pCap) { + entry: + %tmp1 = bitcast %struct.anon* %deviceRef to %struct.def* + %tmp3 = getelementptr %struct.def* %tmp1, i32 0, i32 1 + %tmp35 = bitcast %struct.abc* %tmp3 to i8* + ret i8* %tmp35 + } + + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.765 -> 1.766 --- Log message: Fix Transforms/InstCombine/2007-05-14-Crash.ll --- Diffs of the changes: (+16 -7) InstructionCombining.cpp | 23 --- 1 files changed, 16 insertions(+), 7 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.765 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.766 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.765 Fri May 11 16:10:54 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon May 14 19:16:00 2007 @@ -6454,16 +6454,25 @@ while (Offset) { if (const StructType *STy = dyn_cast(GEPIdxTy)) { const StructLayout *SL = TD->getStructLayout(STy); - unsigned Elt = SL->getElementContainingOffset(Offset); - NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt)); + if (Offset < (int64_t)SL->getSizeInBytes()) { +unsigned Elt = SL->getElementContainingOffset(Offset); +NewIndices.push_back(ConstantInt::get(Type::Int32Ty, Elt)); - Offset -= SL->getElementOffset(Elt); - GEPIdxTy = STy->getElementType(Elt); +Offset -= SL->getElementOffset(Elt); +GEPIdxTy = STy->getElementType(Elt); + } else { +// Otherwise, we can't index into this, bail out. +Offset = 0; +OrigBase = 0; + } } else if (isa(GEPIdxTy) || isa(GEPIdxTy)) { const SequentialType *STy = cast(GEPIdxTy); - uint64_t EltSize = TD->getTypeSize(STy->getElementType()); - NewIndices.push_back(ConstantInt::get(IntPtrTy, Offset/EltSize)); - Offset %= EltSize; + if (uint64_t EltSize = TD->getTypeSize(STy->getElementType())) { + NewIndices.push_back(ConstantInt::get(IntPtrTy,Offset/EltSize)); +Offset %= EltSize; + } else { +NewIndices.push_back(ConstantInt::get(IntPtrTy, 0)); + } GEPIdxTy = STy->getElementType(); } else { // Otherwise, we can't index into this, bail out. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/CodeGen/SelectionDAGNodes.h
Changes in directory llvm/include/llvm/CodeGen: SelectionDAGNodes.h updated: 1.189 -> 1.190 --- Log message: Correct a comment. --- Diffs of the changes: (+1 -1) SelectionDAGNodes.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/CodeGen/SelectionDAGNodes.h diff -u llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.189 llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.190 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1.189 Sun Apr 22 18:15:29 2007 +++ llvm/include/llvm/CodeGen/SelectionDAGNodes.h Mon May 14 19:20:13 2007 @@ -302,7 +302,7 @@ /// Simple abstract vector operators. Unlike the integer and floating point /// binary operators, these nodes also take two additional operands: /// a constant element count, and a value type node indicating the type of -/// the elements. The order is count, type, op0, op1. All vector opcodes, +/// the elements. The order is op0, op1, count, type. All vector opcodes, /// including VLOAD and VConstant must currently have count and type as /// their last two operands. VADD, VSUB, VMUL, VSDIV, VUDIV, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [127254] Lauro's patch to enable PIC codegen for arm-linux.
Revision: 127254 Author: echeng Date: 2007-05-14 18:11:39 -0700 (Mon, 14 May 2007) Log Message: --- Lauro's patch to enable PIC codegen for arm-linux. Modified Paths: -- apple-local/branches/llvm/gcc/config/arm/linux-elf.h Modified: apple-local/branches/llvm/gcc/config/arm/linux-elf.h === --- apple-local/branches/llvm/gcc/config/arm/linux-elf.h2007-05-14 22:03:51 UTC (rev 127253) +++ apple-local/branches/llvm/gcc/config/arm/linux-elf.h2007-05-15 01:11:39 UTC (rev 127254) @@ -149,3 +149,17 @@ #ifdef HAVE_LD_AS_NEEDED #define USE_LD_AS_NEEDED 1 #endif + +/* APPLE LOCAL begin LLVM */ +#ifdef ENABLE_LLVM + +/* PIC codegen for ARM-Linux-ELF target */ +#define LLVM_SET_TARGET_OPTIONS(argvec) \ + if (flag_pic) \ +argvec.push_back ("--relocation-model=pic"); \ + else \ +argvec.push_back ("--relocation-model=static"); + +/* APPLE LOCAL end LLVM */ + +#endif ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll
Changes in directory llvm/test/CodeGen/ARM: 2007-05-14-InlineAsmCstCrash.ll added (r1.1) --- Log message: testcase that crashes llc --- Diffs of the changes: (+6 -0) 2007-05-14-InlineAsmCstCrash.ll |6 ++ 1 files changed, 6 insertions(+) Index: llvm/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll diff -c /dev/null llvm/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll:1.1 *** /dev/null Mon May 14 20:13:52 2007 --- llvm/test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll Mon May 14 20:13:42 2007 *** *** 0 --- 1,6 + ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 + + define i32 @test3() { + tail call void asm sideeffect "/* number: ${0:c} */", "i"( i32 1 ) + ret i32 11 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.295 -> 1.296 --- Log message: PredicateOperand related bug fix. --- Diffs of the changes: (+3 -1) DAGISelEmitter.cpp |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.295 llvm/utils/TableGen/DAGISelEmitter.cpp:1.296 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.295Tue May 8 16:04:07 2007 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Mon May 14 20:19:51 2007 @@ -2799,6 +2799,7 @@ // in the 'execute always' values. Match up the node operands to the // instruction operands to do this. std::vector AllOps; + unsigned NumEAInputs = 0; // # of synthesized 'execute always' inputs. for (unsigned ChildNo = 0, InstOpNo = NumResults; InstOpNo != II.OperandList.size(); ++InstOpNo) { std::vector Ops; @@ -2821,6 +2822,7 @@ Ops = EmitResultCode(Pred.AlwaysOps[i], RetSelected, InFlagDecled, ResNodeDecled); AllOps.insert(AllOps.end(), Ops.begin(), Ops.end()); +NumEAInputs += Ops.size(); } } } @@ -2899,7 +2901,7 @@ else if (NodeHasOptInFlag) EndAdjust = "-(HasInFlag?1:0)"; // May have a flag. - emitCode("for (unsigned i = " + utostr(NumInputs) + + emitCode("for (unsigned i = " + utostr(NumInputs - NumEAInputs) + ", e = N.getNumOperands()" + EndAdjust + "; i != e; ++i) {"); emitCode(" AddToISelQueue(N.getOperand(i));"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/InstrInfoEmitter.cpp
Changes in directory llvm/utils/TableGen: InstrInfoEmitter.cpp updated: 1.57 -> 1.58 --- Log message: Mark all (not just the first) predicate operand M_PREDICATE_OPERAND. --- Diffs of the changes: (+1 -1) InstrInfoEmitter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/utils/TableGen/InstrInfoEmitter.cpp diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.57 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.58 --- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.57 Mon Mar 19 01:20:37 2007 +++ llvm/utils/TableGen/InstrInfoEmitter.cppMon May 14 20:20:36 2007 @@ -107,7 +107,7 @@ // Predicate operands. Check to see if the original unexpanded operand // was of type PredicateOperand. - if (j == 0 && Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand")) + if (Inst.OperandList[i].Rec->isSubClassOf("PredicateOperand")) Res += "|M_PREDICATE_OPERAND"; // Fill in constraint info. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Target/TargetInstrInfo.h
Changes in directory llvm/include/llvm/Target: TargetInstrInfo.h updated: 1.114 -> 1.115 --- Log message: All operands that made up of the predicate operands are maked M_PREDICATE_OPERAND. --- Diffs of the changes: (+2 -2) TargetInstrInfo.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.114 llvm/include/llvm/Target/TargetInstrInfo.h:1.115 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.114Mon Mar 19 01:19:16 2007 +++ llvm/include/llvm/Target/TargetInstrInfo.h Mon May 14 20:21:27 2007 @@ -88,8 +88,8 @@ // requires a callback to look up its register class. const unsigned M_LOOK_UP_PTR_REG_CLASS = 1 << 0; -/// M_PREDICATE_OPERAND - Set if this is the first operand of a predicate -/// operand that controls an M_PREDICATED instruction. +/// M_PREDICATE_OPERAND - Set if this is one of the operands that made up of the +/// predicate operand that controls an M_PREDICATED instruction. const unsigned M_PREDICATE_OPERAND = 1 << 1; namespace TOI { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/FileLexer.cpp.cvs FileLexer.l FileLexer.l.cvs FileParser.y FileParser.y.cvs Record.cpp Record.h
Changes in directory llvm/utils/TableGen: FileLexer.cpp.cvs updated: 1.11 -> 1.12 FileLexer.l updated: 1.35 -> 1.36 FileLexer.l.cvs updated: 1.10 -> 1.11 FileParser.y updated: 1.48 -> 1.49 FileParser.y.cvs updated: 1.9 -> 1.10 Record.cpp updated: 1.58 -> 1.59 Record.h updated: 1.62 -> 1.63 --- Log message: Added \!con(a,b) syntax to concatnate two dag fragments. --- Diffs of the changes: (+227 -180) FileLexer.cpp.cvs | 358 +++--- FileLexer.l |1 FileLexer.l.cvs |1 FileParser.y |4 FileParser.y.cvs |4 Record.cpp| 35 + Record.h |4 7 files changed, 227 insertions(+), 180 deletions(-) Index: llvm/utils/TableGen/FileLexer.cpp.cvs diff -u llvm/utils/TableGen/FileLexer.cpp.cvs:1.11 llvm/utils/TableGen/FileLexer.cpp.cvs:1.12 --- llvm/utils/TableGen/FileLexer.cpp.cvs:1.11 Tue Feb 6 12:20:07 2007 +++ llvm/utils/TableGen/FileLexer.cpp.cvs Mon May 14 20:23:24 2007 @@ -21,7 +21,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /var/cvs/llvm/llvm/utils/TableGen/FileLexer.cpp.cvs,v 1.11 2007/02/06 18:20:07 jlaskey Exp $ + * $Header: /var/cvs/llvm/llvm/utils/TableGen/FileLexer.cpp.cvs,v 1.12 2007/05/15 01:23:24 evancheng Exp $ */ #define FLEX_SCANNER @@ -306,43 +306,44 @@ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 34 -#define YY_END_OF_BUFFER 35 -static yyconst short int yy_acclist[145] = +#define YY_NUM_RULES 35 +#define YY_END_OF_BUFFER 36 +static yyconst short int yy_acclist[146] = { 0, - 28, 28, 35, 33, 34, 26, 33, 34, 26, 34, - 33, 34, 33, 34, 33, 34, 33, 34, 33, 34, - 25, 33, 34, 25, 33, 34, 22, 33, 34, 33, - 34, 22, 33, 34, 22, 33, 34, 22, 33, 34, - 22, 33, 34, 22, 33, 34, 22, 33, 34, 22, - 33, 34, 22, 33, 34, 28, 34, 29, 34, 31, - 34, 26, 24, 23, 25, 27,1, 22, 22, 22, - 22, 22, 22, 22, 17, 22, 22, 22, 22, 22, - 28, 29, 29, 32, 31, 30, 31, 23,1, 25, - 25,5, 22, 22, 22, 10, 22, 12, 22, 22, - - 22,4, 22, 16, 22, 22, 22, 22, 20, 18, - 19,3,6, 22, 22,9, 22, 13, 22, 22, - 22,8, 22, 22, 22, 11, 22, 15, 22, 22, - 22, 22, 22, 22,7, 22, 22, 22, 22, 22, - 21,2, 14, 22 + 29, 29, 36, 34, 35, 27, 34, 35, 27, 35, + 34, 35, 34, 35, 34, 35, 34, 35, 34, 35, + 26, 34, 35, 26, 34, 35, 23, 34, 35, 34, + 35, 23, 34, 35, 23, 34, 35, 23, 34, 35, + 23, 34, 35, 23, 34, 35, 23, 34, 35, 23, + 34, 35, 23, 34, 35, 29, 35, 30, 35, 32, + 35, 27, 25, 24, 26, 28,1, 23, 23, 23, + 23, 23, 23, 23, 17, 23, 23, 23, 23, 23, + 29, 30, 30, 33, 32, 31, 32, 24,1, 26, + 26,5, 23, 23, 23, 10, 23, 12, 23, 23, + + 23,4, 23, 16, 23, 23, 23, 23, 18, 21, + 19, 20,3,6, 23, 23,9, 23, 13, 23, + 23, 23,8, 23, 23, 23, 11, 23, 15, 23, + 23, 23, 23, 23, 23,7, 23, 23, 23, 23, + 23, 22,2, 14, 23 } ; -static yyconst short int yy_accept[120] = +static yyconst short int yy_accept[123] = { 0, 1,1,1,2,3,4,6,9, 11, 13, 15, 17, 19, 21, 24, 27, 30, 32, 35, 38, 41, 44, 47, 50, 53, 56, 58, 60, 62, 63, - 63, 63, 64, 65, 66, 67, 68, 68, 68, 69, - 69, 70, 71, 72, 73, 74, 75, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 88, - 88, 88, 89, 90, 91, 92, 92, 92, 94, 95, - 96, 98, 100, 101, 102, 104, 106, 107, 108, 109, - 110, 111, 112, 112, 112, 113, 115, 116, 118, 120, - 121, 122, 124, 125, 126, 126, 128, 130, 131, 132, - - 133, 133, 134, 135, 137, 137, 138, 139, 139, 139, - 140, 140, 140, 141, 142, 142, 143, 145, 145 + 63, 63, 63, 64, 65, 66, 67, 68, 68, 68, + 69, 69, 70, 71, 72, 73, 74, 75, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 88, 88, 88, 88, 89, 90, 91, 92, 92, 92, + 94, 95, 96, 98, 100, 101, 102, 104, 106, 107, + 108, 109, 110, 111, 112, 113, 113, 113, 114, 116, + 117, 119, 121, 122, 123, 125, 126, 127, 127, 129, + + 131, 132, 133, 134, 134, 135, 136, 138, 138, 139, + 140, 140, 140, 141, 141
[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h
Changes in directory llvm/include/llvm/CodeGen: MachineInstr.h updated: 1.218 -> 1.219 --- Log message: Added getNumExplicitOperands and findFirstPredOperand. --- Diffs of the changes: (+10 -0) MachineInstr.h | 10 ++ 1 files changed, 10 insertions(+) Index: llvm/include/llvm/CodeGen/MachineInstr.h diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.218 llvm/include/llvm/CodeGen/MachineInstr.h:1.219 --- llvm/include/llvm/CodeGen/MachineInstr.h:1.218 Tue May 1 00:57:01 2007 +++ llvm/include/llvm/CodeGen/MachineInstr.hMon May 14 20:25:06 2007 @@ -378,6 +378,9 @@ return Operands[i]; } + /// getNumExplicitOperands - Returns the number of non-implicit operands. + /// + unsigned getNumExplicitOperands() const; /// isIdenticalTo - Return true if this instruction is identical to (same /// opcode and same operands as) the specified instruction. @@ -413,11 +416,18 @@ /// findRegisterDefOperand() - Returns the MachineOperand that is a def of /// the specific register or NULL if it is not found. MachineOperand *findRegisterDefOperand(unsigned Reg); + + /// findFirstPredOperand() - Find the first operand in the operand list that + // is used to represent the predicate. + MachineOperand *findFirstPredOperand(); /// copyKillDeadInfo - Copies kill / dead operand properties from MI. /// void copyKillDeadInfo(const MachineInstr *MI); + /// copyPredicates - Copies predicate operand(s) from MI. + void copyPredicates(const MachineInstr *MI); + // // Debugging support // ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/MachineInstr.cpp
Changes in directory llvm/lib/CodeGen: MachineInstr.cpp updated: 1.148 -> 1.149 --- Log message: Added getNumExplicitOperands and findFirstPredOperand. --- Diffs of the changes: (+46 -0) MachineInstr.cpp | 46 ++ 1 files changed, 46 insertions(+) Index: llvm/lib/CodeGen/MachineInstr.cpp diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.148 llvm/lib/CodeGen/MachineInstr.cpp:1.149 --- llvm/lib/CodeGen/MachineInstr.cpp:1.148 Tue May 1 00:57:02 2007 +++ llvm/lib/CodeGen/MachineInstr.cpp Mon May 14 20:26:09 2007 @@ -141,6 +141,21 @@ return false; } +/// getNumExplicitOperands - Returns the number of non-implicit operands. +/// +unsigned MachineInstr::getNumExplicitOperands() const { + unsigned NumOperands = TID->numOperands; + if ((TID->Flags & M_VARIABLE_OPS) == 0) +return NumOperands; + + for (unsigned e = getNumOperands(); NumOperands != e; ++NumOperands) { +const MachineOperand &MO = getOperand(NumOperands); +if (!MO.isRegister() || !MO.isImplicit()) + NumOperands++; + } + return NumOperands; +} + /// isIdenticalTo - Return true if this operand is identical to the specified /// operand. bool MachineOperand::isIdenticalTo(const MachineOperand &Other) const { @@ -192,6 +207,19 @@ } return NULL; } + +/// findFirstPredOperand() - Find the first operand in the operand list that +// is used to represent the predicate. +MachineOperand *MachineInstr::findFirstPredOperand() { + const TargetInstrDescriptor *TID = getInstrDescriptor(); + if (TID->Flags & M_PREDICATED) { +for (unsigned i = 0, e = getNumOperands(); i != e; ++i) + if ((TID->OpInfo[i].Flags & M_PREDICATE_OPERAND)) +return &getOperand(i); + } + + return NULL; +} /// copyKillDeadInfo - Copies kill / dead operand properties from MI. /// @@ -213,6 +241,24 @@ } } +/// copyPredicates - Copies predicate operand(s) from MI. +void MachineInstr::copyPredicates(const MachineInstr *MI) { + const TargetInstrDescriptor *TID = MI->getInstrDescriptor(); + if (TID->Flags & M_PREDICATED) { +for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { + if ((TID->OpInfo[i].Flags & M_PREDICATE_OPERAND)) { +const MachineOperand &MO = MI->getOperand(i); +// Predicated operands must be last operands. +if (MO.isReg()) + addRegOperand(MO.getReg(), false); +else { + addImmOperand(MO.getImm()); +} + } +} + } +} + void MachineInstr::dump() const { cerr << " " << *this; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.399 -> 1.400 --- Log message: fix subtle bugs in inline asm operand selection --- Diffs of the changes: (+4 -3) X86ISelLowering.cpp |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.399 llvm/lib/Target/X86/X86ISelLowering.cpp:1.400 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.399 Thu May 3 11:52:29 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon May 14 20:28:08 2007 @@ -4725,18 +4725,19 @@ case 'I': if (ConstantSDNode *C = dyn_cast(Op)) { if (C->getValue() <= 31) -return Op; +return DAG.getTargetConstant(C->getValue(), Op.getValueType()); } return SDOperand(0,0); case 'N': if (ConstantSDNode *C = dyn_cast(Op)) { if (C->getValue() <= 255) -return Op; +return DAG.getTargetConstant(C->getValue(), Op.getValueType()); } return SDOperand(0,0); case 'i': { // Literal immediates are always ok. -if (isa(Op)) return Op; +if (ConstantSDNode *CST = dyn_cast(Op)) + return DAG.getTargetConstant(CST->getValue(), Op.getValueType()); // If we are in non-pic codegen mode, we allow the address of a global (with // an optional displacement) to be used with 'i'. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] [llvm-gcc patch] enable pic codegen for arm-linux
Applied. Thanks. Evan On May 14, 2007, at 4:25 PM, Lauro Ramos Venancio wrote: > This patch enables pic codegen for arm-linux. > > Lauro > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.269 -> 1.270 --- Log message: fix some subtle inline asm selection issues --- Diffs of the changes: (+17 -9) PPCISelLowering.cpp | 26 +- 1 files changed, 17 insertions(+), 9 deletions(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.270 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.269 Mon Apr 9 17:10:05 2007 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon May 14 20:31:05 2007 @@ -3326,31 +3326,39 @@ case 'N': case 'O': case 'P': { -if (!isa(Op)) return SDOperand(0,0);// Must be an immediate. -unsigned Value = cast(Op)->getValue(); +ConstantSDNode *CST = dyn_cast(Op); +if (!CST) return SDOperand(0, 0); // Must be an immediate to match. +unsigned Value = CST->getValue(); switch (Letter) { default: assert(0 && "Unknown constraint letter!"); case 'I': // "I" is a signed 16-bit constant. - if ((short)Value == (int)Value) return Op; + if ((short)Value == (int)Value) +return DAG.getTargetConstant(Value, Op.getValueType()); break; case 'J': // "J" is a constant with only the high-order 16 bits nonzero. case 'L': // "L" is a signed 16-bit constant shifted left 16 bits. - if ((short)Value == 0) return Op; + if ((short)Value == 0) +return DAG.getTargetConstant(Value, Op.getValueType()); break; case 'K': // "K" is a constant with only the low-order 16 bits nonzero. - if ((Value >> 16) == 0) return Op; + if ((Value >> 16) == 0) +return DAG.getTargetConstant(Value, Op.getValueType()); break; case 'M': // "M" is a constant that is greater than 31. - if (Value > 31) return Op; + if (Value > 31) +return DAG.getTargetConstant(Value, Op.getValueType()); break; case 'N': // "N" is a positive constant that is an exact power of two. - if ((int)Value > 0 && isPowerOf2_32(Value)) return Op; + if ((int)Value > 0 && isPowerOf2_32(Value)) +return DAG.getTargetConstant(Value, Op.getValueType()); break; case 'O': // "O" is the constant zero. - if (Value == 0) return Op; + if (Value == 0) +return DAG.getTargetConstant(Value, Op.getValueType()); break; case 'P': // "P" is a constant whose negation is a signed 16-bit constant. - if ((short)-Value == (int)-Value) return Op; + if ((short)-Value == (int)-Value) +return DAG.getTargetConstant(Value, Op.getValueType()); break; } break; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll
Changes in directory llvm/test/CodeGen/PowerPC: 2007-05-14-InlineAsmSelectCrash.ll added (r1.1) --- Log message: new testcase that crashes llc --- Diffs of the changes: (+25 -0) 2007-05-14-InlineAsmSelectCrash.ll | 25 + 1 files changed, 25 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll:1.1 *** /dev/null Mon May 14 20:33:22 2007 --- llvm/test/CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.llMon May 14 20:33:12 2007 *** *** 0 --- 1,25 + ; RUN: llvm-as < %s | llc -march=ppc32 + target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" + target triple = "powerpc-apple-darwin8.8.0" + %struct..0anon = type { i32 } + %struct.A = type { %struct.anon } + %struct.anon = type <{ }> + + define void @bork(%struct.A* %In0P) { + entry: + %tmp56 = bitcast %struct.A* %In0P to float* ; [#uses=1] + br label %bb + + bb: ; preds = %bb, %entry + %i.035.0 = phi i32 [ 0, %entry ], [ %indvar.next, %bb ] ; [#uses=2] + %tmp8 = getelementptr float* %tmp56, i32 %i.035.0 ; [#uses=2] + %tmp101112 = bitcast float* %tmp8 to i8*; [#uses=1] + %tmp1617 = bitcast float* %tmp8 to i32* ; [#uses=1] + %tmp21 = tail call i32 asm "lwbrx $0, $2, $1", "=r,r,bO,*m"( i8* %tmp101112, i32 0, i32* %tmp1617 ) ; [#uses=0] + %indvar.next = add i32 %i.035.0, 1 ; [#uses=2] + %exitcond = icmp eq i32 %indvar.next, 4 ; [#uses=1] + br i1 %exitcond, label %return, label %bb + + return: ; preds = %bb + ret void + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.450 -> 1.451 --- Log message: Fix some subtle issues handling immediate values. This fixes test/CodeGen/ARM/2007-05-14-InlineAsmCstCrash.ll --- Diffs of the changes: (+6 -3) SelectionDAGISel.cpp |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.450 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.451 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.450Wed May 9 15:07:09 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Mon May 14 20:33:58 2007 @@ -3448,7 +3448,8 @@ // Add information to the INLINEASM node to know about this output. unsigned ResOpType = 4/*MEM*/ | (1 << 3); -AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32)); +AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, +TLI.getPointerTy())); AsmNodeOperands.push_back(OpInfo.CallOperand); break; } @@ -3540,7 +3541,8 @@ // Add information to the INLINEASM node to know about this input. unsigned ResOpType = 3 /*IMM*/ | (1 << 3); -AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32)); +AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, +TLI.getPointerTy())); AsmNodeOperands.push_back(InOperandVal); break; } else if (OpInfo.ConstraintType == TargetLowering::C_Memory) { @@ -3550,7 +3552,8 @@ // Add information to the INLINEASM node to know about this input. unsigned ResOpType = 4/*MEM*/ | (1 << 3); -AsmNodeOperands.push_back(DAG.getConstant(ResOpType, MVT::i32)); +AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType, +TLI.getPointerTy())); AsmNodeOperands.push_back(InOperandVal); break; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
Changes in directory llvm/utils/TableGen: DAGISelEmitter.cpp updated: 1.296 -> 1.297 --- Log message: Fix CodeGen/PowerPC/2007-05-14-InlineAsmSelectCrash.ll, the other recent patches are also needed. --- Diffs of the changes: (+7 -5) DAGISelEmitter.cpp | 12 +++- 1 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/utils/TableGen/DAGISelEmitter.cpp diff -u llvm/utils/TableGen/DAGISelEmitter.cpp:1.296 llvm/utils/TableGen/DAGISelEmitter.cpp:1.297 --- llvm/utils/TableGen/DAGISelEmitter.cpp:1.296Mon May 14 20:19:51 2007 +++ llvm/utils/TableGen/DAGISelEmitter.cpp Mon May 14 20:36:44 2007 @@ -3685,11 +3685,12 @@ // Emit boilerplate. OS << "SDNode *Select_INLINEASM(SDOperand N) {\n" << " std::vector Ops(N.Val->op_begin(), N.Val->op_end());\n" - << " AddToISelQueue(N.getOperand(0)); // Select the chain.\n\n" - << " // Select the flag operand.\n" - << " if (Ops.back().getValueType() == MVT::Flag)\n" - << "AddToISelQueue(Ops.back());\n" - << " SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n" + << " SelectInlineAsmMemoryOperands(Ops, *CurDAG);\n\n" + + << " // Ensure that the asm operands are themselves selected.\n" + << " for (unsigned j = 0, e = Ops.size(); j != e; ++j)\n" + << "AddToISelQueue(Ops[j]);\n\n" + << " std::vector VTs;\n" << " VTs.push_back(MVT::Other);\n" << " VTs.push_back(MVT::Flag);\n" @@ -3725,6 +3726,7 @@ << " case ISD::TargetConstant:\n" << " case ISD::TargetConstantPool:\n" << " case ISD::TargetFrameIndex:\n" + << " case ISD::TargetExternalSymbol:\n" << " case ISD::TargetJumpTable:\n" << " case ISD::TargetGlobalTLSAddress:\n" << " case ISD::TargetGlobalAddress: {\n" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp
Changes in directory llvm/lib/CodeGen: IntrinsicLowering.cpp updated: 1.83 -> 1.84 --- Log message: Un-brain-dead-ify the lowering of part set for the reverse case. --- Diffs of the changes: (+72 -98) IntrinsicLowering.cpp | 170 +- 1 files changed, 72 insertions(+), 98 deletions(-) Index: llvm/lib/CodeGen/IntrinsicLowering.cpp diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.83 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.84 --- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.83 Mon May 14 12:21:17 2007 +++ llvm/lib/CodeGen/IntrinsicLowering.cpp Mon May 14 21:26:52 2007 @@ -442,57 +442,6 @@ // If we haven't defined the impl function yet, do so now if (F->isDeclaration()) { -// Note: the following code is based on code generated by llvm2cpp with -// the following input. This is just *one* example of a generated function. -// The functions vary by bit width of result and first two arguments. -// The generated code has been changed to deal with any bit width not just -// the 32/64 bitwidths used in the above sample. -// -// define i64 @part_set(i64 %Val, i32 %Rep, i32 %Lo, i32 %Hi) { -// entry: -// %is_forward = icmp ult i32 %Lo, %Hi -// %Lo.pn = select i1 %is_forward, i32 %Hi, i32 %Lo -// %Hi.pn = select i1 %is_forward, i32 %Lo, i32 %Hi -// %iftmp.16.0 = sub i32 %Lo.pn, %Hi.pn -// icmp ult i32 %iftmp.16.0, 32 -// br i1 %1, label %cond_true11, label %cond_next19 -// cond_true11: -// %tmp13 = sub i32 32, %iftmp.16.0 -// %tmp14 = lshr i32 -1, %tmp13 -// %tmp16 = and i32 %tmp14, %Rep -// br label %cond_next19 -// cond_next19: -// %iftmp.17.0 = phi i32 [ %tmp16, %cond_true11 ], [ %Rep, %entry ] -// %tmp2021 = zext i32 %iftmp.17.0 to i64 -// icmp ugt i32 %Lo, %Hi -// br i1 %2, label %cond_next60, label %cond_true24 -// cond_true24: -// %tmp25.cast = zext i32 %Hi to i64 -// %tmp26 = lshr i64 -1, %tmp25.cast -// %tmp27.cast = zext i32 %Lo to i64 -// %tmp28 = shl i64 %tmp26, %tmp27.cast -// %tmp28not = xor i64 %tmp28, -1 -// %tmp31 = shl i64 %tmp2021, %tmp27.cast -// %tmp34 = and i64 %tmp28not, %Val -// %Val_addr.064 = or i64 %tmp31, %tmp34 -// ret i64 %Val_addr.064 -// cond_next60: -// %tmp39.cast = zext i32 %Lo to i64 -// %tmp40 = shl i64 -1, %tmp39.cast -// %tmp41.cast = zext i32 %Hi to i64 -// %tmp42 = shl i64 -1, %tmp41.cast -// %tmp45.demorgan = or i64 %tmp42, %tmp40 -// %tmp45 = xor i64 %tmp45.demorgan, -1 -// %tmp47 = and i64 %tmp45, %Val -// %tmp50 = shl i64 %tmp2021, %tmp39.cast -// %tmp52 = sub i32 32, %Hi -// %tmp52.cast = zext i32 %tmp52 to i64 -// %tmp54 = lshr i64 %tmp2021, %tmp52.cast -// %tmp57 = or i64 %tmp50, %tmp47 -// %Val_addr.0 = or i64 %tmp57, %tmp54 -// ret i64 %Val_addr.0 -// } - // Get the arguments for the function. Function::arg_iterator args = F->arg_begin(); Value* Val = args++; Val->setName("Val"); @@ -510,27 +459,31 @@ ConstantInt* RepBitWidth = ConstantInt::get(Type::Int32Ty, RepBits); ConstantInt* RepMask = ConstantInt::getAllOnesValue(RepTy); ConstantInt* ValMask = ConstantInt::getAllOnesValue(ValTy); +ConstantInt* One = ConstantInt::get(Type::Int32Ty, 1); +ConstantInt* ValOne = ConstantInt::get(ValTy, 1); +ConstantInt* Zero = ConstantInt::get(Type::Int32Ty, 0); +ConstantInt* ValZero = ConstantInt::get(ValTy, 0); + +// Basic blocks we fill in below. +BasicBlock* entry = new BasicBlock("entry", F, 0); +BasicBlock* large = new BasicBlock("large", F, 0); +BasicBlock* small = new BasicBlock("small", F, 0); +BasicBlock* reverse = new BasicBlock("reverse", F, 0); +BasicBlock* result = new BasicBlock("result", F, 0); -BasicBlock* entry = new BasicBlock("entry",F,0); -BasicBlock* large = new BasicBlock("large",F,0); -BasicBlock* small = new BasicBlock("small",F,0); -BasicBlock* forward = new BasicBlock("forward",F,0); -BasicBlock* reverse = new BasicBlock("reverse",F,0); - -// Block entry (entry) +// BASIC BLOCK: entry // First, get the number of bits that we're placing as an i32 ICmpInst* is_forward = new ICmpInst(ICmpInst::ICMP_ULT, Lo, Hi, "", entry); -SelectInst* Lo_pn = new SelectInst(is_forward, Hi, Lo, "", entry); -SelectInst* Hi_pn = new SelectInst(is_forward, Lo, Hi, "", entry); -BinaryOperator* NumBits = BinaryOperator::createSub(Lo_pn, Hi_pn, "",entry); +SelectInst* Hi_pn = new SelectInst(is_forward, Hi, Lo, "", entry); +SelectInst* Lo_pn = new SelectInst(is_forward, Lo, Hi, "", entry); +BinaryOperator* NumBits = BinaryOperator::createSub(Hi_pn, Lo_pn, "",entry); +NumBits = BinaryOperator::createAdd(NumBits, One, "", entry); // Now, convert Lo and Hi to ValTy bit width if (ValBits > 32) { -
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/Integer/test_part_set.c test_part_set.reference_output
Changes in directory llvm-test/SingleSource/UnitTests/Integer: test_part_set.c updated: 1.1 -> 1.2 test_part_set.reference_output updated: 1.1 -> 1.2 --- Log message: Test additional cases. --- Diffs of the changes: (+31 -8) test_part_set.c| 32 +--- test_part_set.reference_output |7 ++- 2 files changed, 31 insertions(+), 8 deletions(-) Index: llvm-test/SingleSource/UnitTests/Integer/test_part_set.c diff -u llvm-test/SingleSource/UnitTests/Integer/test_part_set.c:1.1 llvm-test/SingleSource/UnitTests/Integer/test_part_set.c:1.2 --- llvm-test/SingleSource/UnitTests/Integer/test_part_set.c:1.1Sat May 12 06:14:00 2007 +++ llvm-test/SingleSource/UnitTests/Integer/test_part_set.cMon May 14 21:29:32 2007 @@ -1,19 +1,37 @@ #include "bits.h" +#include uint68 test_part_set(uint68 x, uint60 y) { -return part_set(x, y, 0, (bitwidthof(y)-1)); -} + printf("uint68 x = "); + printBits(x); + printf("\n"); -uint1 test_reduce(uint68 x) -{ -return reduce(or, x); + printf("uint60 y = "); + printBits(y); + printf("\n"); + + printf("part_set(x,y,0,59) = "); + uint68 z = part_set(x, y, 0, (bitwidthof(y)-1)); + printBits(z); + printf("\n"); + + printf("part_set(x,y,59,0) = "); + z = part_set(x, y, (bitwidthof(y)-1), 0); + printBits(z); + printf("\n"); + + printf("part_set(x,0,0,31) = "); + z = part_set(x, 0, 0, 31); + printBits(z); + printf("\n"); + + return z; } int main(int argc, char** argv) { uint68 A = 0xF0F0F0F0F0F0F0F0ULL; uint60 B = 0x0F0F0F0F0F0F0F0FULL; uint68 X = test_part_set(A, B); - uint1 Y = test_reduce(X); - return (int) Y; + return 0; } Index: llvm-test/SingleSource/UnitTests/Integer/test_part_set.reference_output diff -u llvm-test/SingleSource/UnitTests/Integer/test_part_set.reference_output:1.1 llvm-test/SingleSource/UnitTests/Integer/test_part_set.reference_output:1.2 --- llvm-test/SingleSource/UnitTests/Integer/test_part_set.reference_output:1.1 Sat May 12 06:14:00 2007 +++ llvm-test/SingleSource/UnitTests/Integer/test_part_set.reference_output Mon May 14 21:29:32 2007 @@ -1 +1,6 @@ -exit 1 +uint68 x = +uint60 y = +part_set(x,y,0,59) = +part_set(x,y,59,0) = +part_set(x,0,0,31) = +exit 0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/lib/Target/CBackend/CBackend.cpp
Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.343 -> 1.343.2.1 --- Log message: Merge from mainline PR1413: http://llvm.org/PR1413 --- Diffs of the changes: (+5 -0) CBackend.cpp |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.343 llvm/lib/Target/CBackend/CBackend.cpp:1.343.2.1 --- llvm/lib/Target/CBackend/CBackend.cpp:1.343 Wed May 2 21:57:13 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Mon May 14 23:57:33 2007 @@ -1398,6 +1398,11 @@ << "#define __ATTRIBUTE_DTOR__\n" << "#define LLVM_ASM(X)\n" << "#endif\n\n"; + + Out << "#if __GNUC__ < 4 /* Old GCC's, or compilers not GCC */ \n" + << "#define __builtin_stack_save() 0 /* not implemented */\n" + << "#define __builtin_stack_restore(X) /* noop */\n" + << "#endif\n\n"; // Output target-specific code that should be inserted into main. Out << "#define CODE_FOR_MAIN() /* Any target-specific code for main()*/\n"; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/lib/Support/APInt.cpp
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.79 -> 1.79.2.1 --- Log message: Merge from mainline. --- Diffs of the changes: (+6 -0) APInt.cpp |6 ++ 1 files changed, 6 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.79 llvm/lib/Support/APInt.cpp:1.79.2.1 --- llvm/lib/Support/APInt.cpp:1.79 Thu May 3 13:15:36 2007 +++ llvm/lib/Support/APInt.cpp Tue May 15 00:00:54 2007 @@ -1199,6 +1199,12 @@ if (shiftAmt == BitWidth) return APInt(BitWidth, 0); + // If none of the bits are shifted out, the result is *this. This avoids a + // lshr by the words size in the loop below which can produce incorrect + // results. It also avoids the expensive computation below for a common case. + if (shiftAmt == 0) +return *this; + // Create some space for the result. uint64_t * val = new uint64_t[getNumWords()]; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/docs/GettingStarted.html
Changes in directory llvm/docs: GettingStarted.html updated: 1.158 -> 1.158.2.1 --- Log message: Merging from mainline. --- Diffs of the changes: (+10 -3) GettingStarted.html | 13 ++--- 1 files changed, 10 insertions(+), 3 deletions(-) Index: llvm/docs/GettingStarted.html diff -u llvm/docs/GettingStarted.html:1.158 llvm/docs/GettingStarted.html:1.158.2.1 --- llvm/docs/GettingStarted.html:1.158 Wed Apr 11 16:28:31 2007 +++ llvm/docs/GettingStarted.html Tue May 15 00:08:55 2007 @@ -499,8 +499,8 @@ LLVM is very demanding of the host C++ compiler, and as such tends to expose bugs in the compiler. In particular, several versions of GCC crash when trying to compile LLVM. We routinely use GCC 3.3.3, 3.4.0, and Apple 4.0.1 -successfully with them (however, see below). Other versions of GCC will -probably work as well. GCC versions listed +successfully with them (however, see important notes below). Other versions +of GCC will probably work as well. GCC versions listed here are known to not work. If you are using one of these versions, please try to upgrade your GCC to something more recent. If you run into a problem with a version of GCC not listed here, please mailto:[EMAIL PROTECTED]">let @@ -525,6 +525,13 @@ possibly others) does not compile LLVM correctly (it appears that exception handling is broken in some cases). Please download the FSF 3.3.3 or upgrade to a newer version of GCC. +GCC 3.4.0 on linux/x86 (32-bit): GCC miscompiles portions of the + code generator, causing an infinite loop in the llvm-gcc build when built + with optimizations enabled (i.e. a release build). +GCC 3.4.2 on linux/x86 (32-bit): GCC miscompiles portions of the + code generator at -O3, as with 3.4.0. However gcc 3.4.2 (unlike 3.4.0) + correctly compiles LLVM at -O2. A work around is to build release LLVM + builds with "make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION=-O2 ..." GCC 3.4.x on X86-64/amd64: GCC http://llvm.org/PR1056";> miscompiles portions of LLVM. IA-64 GCC 4.0.0: The IA-64 version of GCC 4.0.0 is known to @@ -1615,7 +1622,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.x10sys.com/rspencer/";>Reid Spencer http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/04/11 21:28:31 $ + Last modified: $Date: 2007/05/15 05:08:55 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/lib/System/Unix/MappedFile.inc
Changes in directory llvm/lib/System/Unix: MappedFile.inc updated: 1.19 -> 1.19.2.1 --- Log message: Merge from mainline. --- Diffs of the changes: (+1 -0) MappedFile.inc |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/System/Unix/MappedFile.inc diff -u llvm/lib/System/Unix/MappedFile.inc:1.19 llvm/lib/System/Unix/MappedFile.inc:1.19.2.1 --- llvm/lib/System/Unix/MappedFile.inc:1.19Thu Mar 29 14:11:22 2007 +++ llvm/lib/System/Unix/MappedFile.inc Tue May 15 00:15:10 2007 @@ -78,6 +78,7 @@ if (options_ & WRITE_ACCESS) ::msync(base_, info_->Size, MS_SYNC); ::munmap(base_, info_->Size); +base_ = 0; // Mark this as non-mapped. } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [release_20] CVS: llvm/test/Feature/llvm2cpp.ll
Changes in directory llvm/test/Feature: llvm2cpp.ll (r1.4) removed --- Log message: Remove from release. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/utils/TableGen/DAGISelEmitter.cpp
> PredicateOperand related bug fix. > @@ -2899,7 +2901,7 @@ >else if (NodeHasOptInFlag) > EndAdjust = "-(HasInFlag?1:0)"; // May have a flag. > > - emitCode("for (unsigned i = " + utostr(NumInputs) + > + emitCode("for (unsigned i = " + utostr(NumInputs - > NumEAInputs) + > ", e = N.getNumOperands()" + EndAdjust + "; i ! > = e; ++i) {"); > Out of curiousity, why is this needed? Did you hit a bug with something when it got selected? If the bug was with ISD::Constant's, this is a serious bug and this is not the right fix. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Bitcode/Reader/BitcodeReader.cpp BitcodeReader.h
Changes in directory llvm/lib/Bitcode/Reader: BitcodeReader.cpp updated: 1.48 -> 1.49 BitcodeReader.h updated: 1.19 -> 1.20 --- Log message: implement the ModuleProvider::dematerializeFunction hook --- Diffs of the changes: (+21 -9) BitcodeReader.cpp | 27 +++ BitcodeReader.h |3 ++- 2 files changed, 21 insertions(+), 9 deletions(-) Index: llvm/lib/Bitcode/Reader/BitcodeReader.cpp diff -u llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.48 llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.49 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:1.48 Tue May 8 00:38:01 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.cpp Tue May 15 01:29:44 2007 @@ -1114,7 +1114,6 @@ // restore the real linkage type for the function. Stream.JumpToBit(DFII->second.first); F->setLinkage((GlobalValue::LinkageTypes)DFII->second.second); - DeferredFunctionInfo.erase(DFII); if (ParseFunctionBody(F)) { if (ErrInfo) *ErrInfo = ErrorString; @@ -1124,14 +1123,26 @@ return false; } +void BitcodeReader::dematerializeFunction(Function *F) { + // If this function isn't materialized, or if it is a proto, this is a noop. + if (F->hasNotBeenReadFromBytecode() || F->isDeclaration()) +return; + + assert(DeferredFunctionInfo.count(F) && "No info to read function later?"); + + // Just forget the function body, we can remat it later. + F->deleteBody(); + F->setLinkage(GlobalValue::GhostLinkage); +} + + Module *BitcodeReader::materializeModule(std::string *ErrInfo) { - DenseMap >::iterator I = -DeferredFunctionInfo.begin(); - while (!DeferredFunctionInfo.empty()) { -Function *F = (*I++).first; -assert(F->hasNotBeenReadFromBytecode() && - "Deserialized function found in map!"); -if (materializeFunction(F, ErrInfo)) + for (DenseMap >::iterator I = + DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E; + ++I) { +Function *F = I->first; +if (F->hasNotBeenReadFromBytecode() && +materializeFunction(F, ErrInfo)) return 0; } return TheModule; Index: llvm/lib/Bitcode/Reader/BitcodeReader.h diff -u llvm/lib/Bitcode/Reader/BitcodeReader.h:1.19 llvm/lib/Bitcode/Reader/BitcodeReader.h:1.20 --- llvm/lib/Bitcode/Reader/BitcodeReader.h:1.19Sat May 5 22:23:14 2007 +++ llvm/lib/Bitcode/Reader/BitcodeReader.h Tue May 15 01:29:44 2007 @@ -123,7 +123,8 @@ virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0); virtual Module *materializeModule(std::string *ErrInfo = 0); - + virtual void dematerializeFunction(Function *F); + bool Error(const char *Str) { ErrorString = Str; return true; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp
Changes in directory llvm/lib/Transforms/IPO: GlobalOpt.cpp updated: 1.106 -> 1.107 --- Log message: selects can also reach here --- Diffs of the changes: (+3 -2) GlobalOpt.cpp |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.106 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.107 --- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.106 Sun May 13 16:28:07 2007 +++ llvm/lib/Transforms/IPO/GlobalOpt.cpp Tue May 15 01:42:04 2007 @@ -623,9 +623,10 @@ Loads.push_back(LI); Changed |= OptimizeAwayTrappingUsesOfValue(LI, LV); } else { - // If we get here we could have stores, loads, or phi nodes whose values + // If we get here we could have stores, selects, or phi nodes whose values // are loaded. - assert((isa(*GUI) || isa(*GUI)) && + assert((isa(*GUI) || isa(*GUI) || + isa(*GUI)) && "Only expect load and stores!"); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp
Changes in directory llvm/test/C++Frontend: 2007-05-15-FieldAccess.cpp added (r1.1) --- Log message: Add a test case for PR1420: http://llvm.org/PR1420 --- Diffs of the changes: (+35 -0) 2007-05-15-FieldAccess.cpp | 35 +++ 1 files changed, 35 insertions(+) Index: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp diff -c /dev/null llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp:1.1 *** /dev/null Tue May 15 01:52:25 2007 --- llvm/test/C++Frontend/2007-05-15-FieldAccess.cppTue May 15 01:52:15 2007 *** *** 0 --- 1,35 + // Test case for PR1420 + // RUN: %llvmgxx %s -O0 -o %t.exe + // RUN: %t.exe > %t.out + // RUN: grep {sizeof(bitFieldStruct) == 8} %t.out + // RUN: grep {Offset bitFieldStruct.i = 0} %t.out + // RUN: grep {Offset bitFieldStruct.c2 = 7} %t.out + // XFAIL: * + + #include + + class bitFieldStruct { + public: + int i; + unsigned char c:7; + int s:17; + char c2; + }; + + int main() + { + printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct)); + + if (sizeof(bitFieldStruct) != 2 * sizeof(int)) + printf("bitFieldStruct should be %d but is %d \n", + 2 * sizeof(int), sizeof(bitFieldStruct)); + + bitFieldStruct x; + + char* xip = (char*) &x.i; + char* xc2p = (char*) &x.c2; + printf("Offset bitFieldStruct.i = %d\n", xip - xip); + printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip); + + return 0; + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp
> Add a test case for PR1420: http://llvm.org/PR1420 Please don't check in xfailed tests, I just went through and cleaned these all out! Please attach this to the bug instead. When fixed, the testcase can be committed. -Chris > > --- > Diffs of the changes: (+35 -0) > > 2007-05-15-FieldAccess.cpp | 35 +++ > 1 files changed, 35 insertions(+) > > > Index: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp > diff -c /dev/null llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp:1.1 > *** /dev/null Tue May 15 01:52:25 2007 > --- llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp Tue May 15 > 01:52:15 2007 > *** > *** 0 > --- 1,35 > + // Test case for PR1420 > + // RUN: %llvmgxx %s -O0 -o %t.exe > + // RUN: %t.exe > %t.out > + // RUN: grep {sizeof(bitFieldStruct) == 8} %t.out > + // RUN: grep {Offset bitFieldStruct.i = 0} %t.out > + // RUN: grep {Offset bitFieldStruct.c2 = 7} %t.out > + // XFAIL: * > + > + #include > + > + class bitFieldStruct { > + public: > + int i; > + unsigned char c:7; > + int s:17; > + char c2; > + }; > + > + int main() > + { > + printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct)); > + > + if (sizeof(bitFieldStruct) != 2 * sizeof(int)) > + printf("bitFieldStruct should be %d but is %d \n", > + 2 * sizeof(int), sizeof(bitFieldStruct)); > + > + bitFieldStruct x; > + > + char* xip = (char*) &x.i; > + char* xc2p = (char*) &x.c2; > + printf("Offset bitFieldStruct.i = %d\n", xip - xip); > + printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip); > + > + return 0; > + } > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp
> Add a test case for PR1420: http://llvm.org/PR1420 Further, execution tests should go in llvm-test, not in llvm/test. -Chris > > --- > Diffs of the changes: (+35 -0) > > 2007-05-15-FieldAccess.cpp | 35 +++ > 1 files changed, 35 insertions(+) > > > Index: llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp > diff -c /dev/null llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp:1.1 > *** /dev/null Tue May 15 01:52:25 2007 > --- llvm/test/C++Frontend/2007-05-15-FieldAccess.cpp Tue May 15 > 01:52:15 2007 > *** > *** 0 > --- 1,35 > + // Test case for PR1420 > + // RUN: %llvmgxx %s -O0 -o %t.exe > + // RUN: %t.exe > %t.out > + // RUN: grep {sizeof(bitFieldStruct) == 8} %t.out > + // RUN: grep {Offset bitFieldStruct.i = 0} %t.out > + // RUN: grep {Offset bitFieldStruct.c2 = 7} %t.out > + // XFAIL: * > + > + #include > + > + class bitFieldStruct { > + public: > + int i; > + unsigned char c:7; > + int s:17; > + char c2; > + }; > + > + int main() > + { > + printf("sizeof(bitFieldStruct) == %d\n", sizeof(bitFieldStruct)); > + > + if (sizeof(bitFieldStruct) != 2 * sizeof(int)) > + printf("bitFieldStruct should be %d but is %d \n", > + 2 * sizeof(int), sizeof(bitFieldStruct)); > + > + bitFieldStruct x; > + > + char* xip = (char*) &x.i; > + char* xc2p = (char*) &x.c2; > + printf("Offset bitFieldStruct.i = %d\n", xip - xip); > + printf("Offset bitFieldStruct.c2 = %d\n", xc2p - xip); > + > + return 0; > + } > > > > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits