[llvm-commits] Fix objc front-end building with bison 1.28
The recent merge of new bits into the objc front-end broke building with old versions of bison, for example the one included with Mac OS 10.4. This fixes it: Index: c-parse.in === --- c-parse.in (revision 122351) +++ c-parse.in (working copy) @@ -3160,7 +3160,7 @@ /* APPLE LOCAL C* property (Radar 4436866) (in 4.2 x) */ | property_declaration /* APPLE LOCAL objc new property */ - | property_implementation + | property_implementation {} | AT_END { objc_finish_implementation (); Applied. -Chris___ 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.593 -> 1.594 --- Log message: Fix Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll, which is part of PR1107: http://llvm.org/PR1107 --- Diffs of the changes: (+13 -3) InstructionCombining.cpp | 16 +--- 1 files changed, 13 insertions(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.593 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.594 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.593 Fri Jan 12 01:05:14 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Jan 13 17:11:38 2007 @@ -5263,9 +5263,19 @@ RHSCIOp = CI->getOperand(0); if (RHSCIOp->getType() != LHSCIOp->getType()) return 0; -else - // Okay, just insert a compare of the reduced operands now! - return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); + +// If the signedness of the two compares doesn't agree (i.e. one is a sext +// and the other is a zext), then we can't handle this. +if (CI->getOpcode() != LHSCI->getOpcode()) + return 0; + +// Likewise, if the signedness of the [sz]exts and the compare don't match, +// then we can't handle this. +if (isSignedExt != isSignedCmp && !ICI.isEquality()) + return 0; + +// Okay, just insert a compare of the reduced operands now! +return new ICmpInst(ICI.getPredicate(), LHSCIOp, RHSCIOp); } // If we aren't dealing with a constant on the RHS, exit early ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: 2007-01-13-ExtCompareMiscompile.ll added (r1.1) --- Log message: testcase reduced from pr1107: http://llvm.org/PR1107 --- Diffs of the changes: (+9 -0) 2007-01-13-ExtCompareMiscompile.ll |9 + 1 files changed, 9 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll:1.1 *** /dev/null Sat Jan 13 17:11:55 2007 --- llvm/test/Regression/Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll Sat Jan 13 17:11:45 2007 *** *** 0 --- 1,9 + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep zext + ; PR1107 + + define i1 %test(i8 %A, i8 %B) { + %a = zext i8 %A to i32 + %b = zext i8 %B to i32 + %c = icmp sgt i32 %a, %b + ret i1 %c + } ___ 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/X86IntelAsmPrinter.cpp X86ATTAsmPrinter.cpp
Changes in directory llvm/lib/Target/X86: X86IntelAsmPrinter.cpp updated: 1.67 -> 1.68 X86ATTAsmPrinter.cpp updated: 1.84 -> 1.85 --- Log message: remove dead code, frameindices must be resolve before the asmprinter runs. --- Diffs of the changes: (+0 -16) X86ATTAsmPrinter.cpp |8 X86IntelAsmPrinter.cpp |8 2 files changed, 16 deletions(-) Index: llvm/lib/Target/X86/X86IntelAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.67 llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.68 --- llvm/lib/Target/X86/X86IntelAsmPrinter.cpp:1.67 Tue Dec 19 16:59:26 2006 +++ llvm/lib/Target/X86/X86IntelAsmPrinter.cpp Sat Jan 13 17:59:03 2007 @@ -199,14 +199,6 @@ const MachineOperand &IndexReg = MI->getOperand(Op+2); const MachineOperand &DispSpec = MI->getOperand(Op+3); - if (BaseReg.isFrameIndex()) { -O << "[frame slot #" << BaseReg.getFrameIndex(); -if (DispSpec.getImmedValue()) - O << " + " << DispSpec.getImmedValue(); -O << "]"; -return; - } - O << "["; bool NeedPlus = false; if (BaseReg.getReg()) { Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.84 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.85 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.84 Fri Jan 12 13:20:47 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSat Jan 13 17:59:03 2007 @@ -388,14 +388,6 @@ const MachineOperand &IndexReg = MI->getOperand(Op+2); const MachineOperand &DispSpec = MI->getOperand(Op+3); - if (BaseReg.isFrameIndex()) { -O << "[frame slot #" << BaseReg.getFrameIndex(); -if (DispSpec.getImmedValue()) - O << " + " << DispSpec.getImmedValue(); -O << "]"; -return; - } - bool NotRIPRel = IndexReg.getReg() || BaseReg.getReg(); if (DispSpec.isGlobalAddress() || DispSpec.isConstantPoolIndex() || ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll
Changes in directory llvm/test/Regression/CodeGen/X86: 2007-01-13-StackPtrIndex.ll added (r1.1) --- Log message: new testcase for pr1103: http://llvm.org/PR1103 --- Diffs of the changes: (+464 -0) 2007-01-13-StackPtrIndex.ll | 464 1 files changed, 464 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll:1.1 *** /dev/null Sat Jan 13 18:13:00 2007 --- llvm/test/Regression/CodeGen/X86/2007-01-13-StackPtrIndex.llSat Jan 13 18:12:50 2007 *** *** 0 --- 1,464 + ; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | grep leaq && + ; RUN: llvm-as < %s | llc -march=x86-64 -sched=none | not grep ',%rsp)' + ; PR1103 + + target datalayout = "e-p:64:64" + target endian = little + target pointersize = 64 + %i6000 = global [128 x i64] zeroinitializer, align 16 + + implementation + + define void %foo(i32* %a0, i32* %a1, i32* %a2, i32* %a3, i32* %a4, i32* %a5) { + b: + %r = load i32* %a0 + %r2 = load i32* %a1 + %r4 = load i32* %a2 + %r6 = load i32* %a3 + %r8 = load i32* %a4 + %r14 = load i32* %a5 + %r = sext i32 %r2 to i64 + %r9 = sext i32 %r to i64 + %r11 = add i64 %r, 0 + %r = icmp slt i64 %r11, 0 + %r12 = select i1 %r, i64 0, i64 %r11 + %r16 = sext i32 %r14 to i64 + %r17 = sext i32 %r8 to i64 + %r18 = sub i64 %r16, 0 + %r19 = add i64 %r18, 0 + %r20 = icmp slt i64 %r19, 0 + %r19h = add i64 %r18, 0 + %r22 = select i1 %r20, i64 1, i64 %r19h + %r23 = mul i64 %r22, 0 + %r23 = trunc i64 %r23 to i32 + %r24 = shl i32 %r23, i8 0 + %r25 = add i32 %r24, 0 + %r = alloca i8, i32 %r25, align 16 + %r28 = getelementptr i8* %r, i32 0 + %r38 = shl i64 %r12, i8 0 + %s2013 = add i64 %r38, 0 + %c22012 = getelementptr i8* %r, i64 %s2013 + %r42 = shl i64 %r12, i8 0 + %s2011 = add i64 %r42, 16 + %c22010 = getelementptr i8* %r, i64 %s2011 + %r50 = add i64 %r16, 0 + %r51 = icmp slt i64 %r50, 0 + %r50sh = shl i64 %r50, i8 0 + %r50j = add i64 %r50sh, 0 + %r54 = select i1 %r51, i64 0, i64 %r50j + %r56 = mul i64 %r54, %r12 + %r28s = add i64 %r56, 16 + %c2 = getelementptr i8* %r, i64 %r28s + %r60 = sub i32 %r2, %r + %r61 = icmp slt i32 %r60, 0 + br i1 %r61, label %a29b, label %b63 + a29b: + %r155 = sub i32 %r6, %r4 + %r156 = icmp slt i32 %r155, 0 + br i1 %r156, label %a109b, label %b158 + b63: + %r66 = sext i32 %r60 to i64 + %r67 = add i64 %r66, 0 + %r76 = mul i64 %r17, 0 + %r82 = add i64 %r76, 0 + %r84 = icmp slt i64 %r67, 0 + br i1 %r84, label %b85, label %a25b + b85: + %e641 = phi i64 [ 0, %b63 ], [ %r129, %a25b ] + %r137 = icmp slt i64 %e641, 0 + br i1 %r137, label %a25b140q, label %a29b + a25b140q: + br label %a25b140 + a25b: + %w1989 = phi i64 [ 0, %b63 ], [ %v1990, %a25b ] + %e642 = shl i64 %w1989, i8 0 + %r129 = add i64 %e642, 0 + %r132 = add i64 %e642, 0 + %r134 = icmp slt i64 %r132, 0 + %v1990 = add i64 %w1989, 0 + br i1 %r134, label %b85, label %a25b + a25b140: + %w1982 = phi i64 [ 0, %a25b140q ], [ %v1983, %a25b140 ] + %r145 = add i64 %r82, 0 + %v1983 = add i64 %w1982, 0 + %u1987 = icmp slt i64 %v1983, 0 + br i1 %u1987, label %a29b, label %a25b140 + b158: + %r161 = sext i32 %r to i64 + %r163 = sext i32 %r4 to i64 + br label %a29b173 + a29b173: + %w1964 = phi i64 [ 0, %b158 ], [ %v1973, %b1606 ] + %b1974 = mul i64 %r163, 0 + %b1975 = add i64 %r161, 0 + %b1976 = mul i64 %w1964, 0 + %b1977 = add i64 %b1976, 0 + %s761 = bitcast i64 %b1977 to i64 + %b1980 = mul i64 %w1964, 0 + %s661 = add i64 %b1980, 0 + br i1 %r61, label %a33b, label %b179 + a33b: + %r328 = icmp slt i32 %r14, 0 + %r335 = or i1 %r328, %r61 + br i1 %r335, label %a50b, label %b341 + b179: + %r182 = sext i32 %r60 to i64 + %r183 = add i64 %r182, 0 + %r187 = icmp slt i64 %r183, 0 + br i1 %r187, label %b188, label %a30b + b188: + %e653 = phi i64 [ 0, %b179 ], [ %r283, %a30b ] + %r291 = icmp slt i64 %e653, 0 + br i1 %r291, label %a30b294q, label %a33b + a30b294q: + br label %a30b294 + a30b: + %w = phi i64 [ 0, %b179 ], [ %v, %a30b ] + %b = shl i64 %w, i8 0 + %r283 = add i64 %b, 0 + %r286 = add i64 %b, 0 + %r288 = icmp slt i64 %r286, 0 + %v = add i64 %w, 0 + br i1 %r288, label %b188, label %a30b + a30b294: + %w1847 = phi i64 [ 0, %a30b294q ], [ %v1848, %a30b294 ] + %v1848 = add i64 %w1847, 0 + %u = icmp slt i64 %v1848, 0 + br i1 %u, label %a33b, label %a30b294 + a50b: + %r814 = add i32 %r14,
[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.85 -> 1.86 --- Log message: Fix PR1103: http://llvm.org/PR1103 and Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll --- Diffs of the changes: (+17 -9) X86ATTAsmPrinter.cpp | 26 +- 1 files changed, 17 insertions(+), 9 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.85 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.86 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.85 Sat Jan 13 17:59:03 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSat Jan 13 18:13:07 2007 @@ -382,10 +382,8 @@ void X86ATTAsmPrinter::printMemReference(const MachineInstr *MI, unsigned Op, const char *Modifier){ assert(isMem(MI, Op) && "Invalid memory reference!"); - - const MachineOperand &BaseReg = MI->getOperand(Op); - int ScaleVal = MI->getOperand(Op+1).getImmedValue(); - const MachineOperand &IndexReg = MI->getOperand(Op+2); + MachineOperand BaseReg = MI->getOperand(Op); + MachineOperand IndexReg = MI->getOperand(Op+2); const MachineOperand &DispSpec = MI->getOperand(Op+3); bool NotRIPRel = IndexReg.getReg() || BaseReg.getReg(); @@ -400,18 +398,28 @@ } if (IndexReg.getReg() || BaseReg.getReg()) { -O << "("; -if (BaseReg.getReg()) { - printOperand(MI, Op, Modifier); +unsigned ScaleVal = MI->getOperand(Op+1).getImmedValue(); +unsigned BaseRegOperand = 0, IndexRegOperand = 2; + +// There are cases where we can end up with ESP/RSP in the indexreg slot. +// If this happens, swap the base/index register to support assemblers that +// don't work when the index is *SP. +if (IndexReg.getReg() == X86::ESP || IndexReg.getReg() == X86::RSP) { + assert(ScaleVal == 1 && "Scale not supported for stack pointer!"); + std::swap(BaseReg, IndexReg); + std::swap(BaseRegOperand, IndexRegOperand); } + +O << "("; +if (BaseReg.getReg()) + printOperand(MI, Op+BaseRegOperand, Modifier); if (IndexReg.getReg()) { O << ","; - printOperand(MI, Op+2, Modifier); + printOperand(MI, Op+IndexRegOperand, Modifier); if (ScaleVal != 1) O << "," << ScaleVal; } - O << ")"; } } ___ 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.194 -> 1.195 --- Log message: add a global variable example --- Diffs of the changes: (+8 -1) LangRef.html |9 - 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.194 llvm/docs/LangRef.html:1.195 --- llvm/docs/LangRef.html:1.194Fri Jan 12 13:20:46 2007 +++ llvm/docs/LangRef.html Sat Jan 13 18:27:09 2007 @@ -616,6 +616,13 @@ global is forced to have at least that much alignment. All alignments must be a power of 2. +For example, the following defines a global with an initializer, section, + and alignment: + + + %G = constant float 1.0, section "foo", align 4 + + @@ -4480,7 +4487,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/01/12 19:20:46 $ + Last modified: $Date: 2007/01/14 00:27:09 $ ___ 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/X86ATTAsmPrinter.cpp
Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.86 -> 1.87 --- Log message: darwin doesn't use .hidden. Disable this until we fix it right. --- Diffs of the changes: (+1 -1) X86ATTAsmPrinter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.86 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.87 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.86 Sat Jan 13 18:13:07 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSat Jan 13 18:48:43 2007 @@ -125,7 +125,7 @@ } break; } - if (F->hasHiddenVisibility()) + if (F->hasHiddenVisibility() && !Subtarget->isTargetDarwin()) O << "\t.hidden " << CurrentFnName << "\n"; O << CurrentFnName << ":\n"; ___ 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/X86AsmPrinter.cpp
Changes in directory llvm/lib/Target/X86: X86AsmPrinter.cpp updated: 1.225 -> 1.226 --- Log message: darwin doesn't use .hidden. Disable this until we fix it right. --- Diffs of the changes: (+1 -1) X86AsmPrinter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.225 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.226 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.225 Fri Jan 12 13:20:47 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Sat Jan 13 18:50:56 2007 @@ -246,7 +246,7 @@ EmitGlobalConstant(C); O << '\n'; } -if (I->hasHiddenVisibility()) +if (I->hasHiddenVisibility() && !Subtarget->isTargetDarwin()) O << "\t.hidden " << name << "\n"; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Analysis/ScalarEvolution/
Changes in directory llvm/test/Regression/Analysis/ScalarEvolution: --- Log message: Directory /home/vadve/shared/PublicCVS/llvm/test/Regression/Analysis/ScalarEvolution added to the repository --- 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
[llvm-commits] CVS: llvm/test/Regression/Analysis/ScalarEvolution/dg.exp trip-count.ll
Changes in directory llvm/test/Regression/Analysis/ScalarEvolution: dg.exp added (r1.1) trip-count.ll added (r1.1) --- Log message: new testcase for pr1101: http://llvm.org/PR1101 --- Diffs of the changes: (+34 -0) dg.exp|3 +++ trip-count.ll | 31 +++ 2 files changed, 34 insertions(+) Index: llvm/test/Regression/Analysis/ScalarEvolution/dg.exp diff -c /dev/null llvm/test/Regression/Analysis/ScalarEvolution/dg.exp:1.1 *** /dev/null Sat Jan 13 19:23:53 2007 --- llvm/test/Regression/Analysis/ScalarEvolution/dg.expSat Jan 13 19:23:43 2007 *** *** 0 --- 1,3 + load_lib llvm-dg.exp + + llvm-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.ll]] $objdir $srcdir $subdir $target_triplet $llvmgcc $llvmgxx $prcontext $llvmgcc_version Index: llvm/test/Regression/Analysis/ScalarEvolution/trip-count.ll diff -c /dev/null llvm/test/Regression/Analysis/ScalarEvolution/trip-count.ll:1.1 *** /dev/null Sat Jan 13 19:23:58 2007 --- llvm/test/Regression/Analysis/ScalarEvolution/trip-count.ll Sat Jan 13 19:23:43 2007 *** *** 0 --- 1,31 + ; RUN: llvm-as < %s | opt -analyze -scalar-evolution 2>&1 | grep '1 iterations' + ; PR1101 + + %A = weak global [1000 x i32] zeroinitializer, align 32 + + implementation ; Functions: + + define void %test(i32 %N) { + entry: + "alloca point" = bitcast i32 0 to i32 ; [#uses=0] + br label %bb3 + + bb: ; preds = %bb3 + %tmp = getelementptr [1000 x i32]* %A, i32 0, i32 %i.0 ; [#uses=1] + store i32 123, i32* %tmp + %tmp2 = add i32 %i.0, 1 ; [#uses=1] + br label %bb3 + + bb3:; preds = %bb, %entry + %i.0 = phi i32 [ 0, %entry ], [ %tmp2, %bb ]; [#uses=3] + %tmp = icmp sle i32 %i.0, ; [#uses=1] + br i1 %tmp, label %bb, label %bb5 + + bb5:; preds = %bb3 + br label %return + + return: ; preds = %bb5 + 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/Analysis/ScalarEvolution.cpp
Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.85 -> 1.86 --- Log message: Fix PR1101: http://llvm.org/PR1101 and Analysis/ScalarEvolution/trip-count.ll --- Diffs of the changes: (+5 -3) ScalarEvolution.cpp |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.85 llvm/lib/Analysis/ScalarEvolution.cpp:1.86 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.85 Fri Jan 12 12:28:58 2007 +++ llvm/lib/Analysis/ScalarEvolution.cpp Sat Jan 13 19:24:47 2007 @@ -1506,10 +1506,12 @@ // // Currently we check for this by checking to see if the Exit branch goes to // the loop header. If so, we know it will always execute the same number of - // times as the loop. More extensive analysis could be done to handle more - // cases here. + // times as the loop. We also handle the case where the exit block *is* the + // loop header. This is common for un-rotated loops. More extensive analysis + // could be done to handle more cases here. if (ExitBr->getSuccessor(0) != L->getHeader() && - ExitBr->getSuccessor(1) != L->getHeader()) + ExitBr->getSuccessor(1) != L->getHeader() && + ExitBr->getParent() != L->getHeader()) return UnknownValue; ICmpInst *ExitCond = dyn_cast(ExitBr->getCondition()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll
Changes in directory llvm/test/Regression/Analysis/BasicAA: 2007-01-13-BasePointerBadNoAlias.ll added (r1.1) --- Log message: testcase for pr1109: http://llvm.org/PR1109 --- Diffs of the changes: (+35 -0) 2007-01-13-BasePointerBadNoAlias.ll | 35 +++ 1 files changed, 35 insertions(+) Index: llvm/test/Regression/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll diff -c /dev/null llvm/test/Regression/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll:1.1 *** /dev/null Sat Jan 13 23:56:56 2007 --- llvm/test/Regression/Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll Sat Jan 13 23:56:45 2007 *** *** 0 --- 1,35 + ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'sub i32' && + ; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | not grep 'ret i32 0' + ; PR1109 + + target datalayout = "e-p:32:32" + target endian = little + target pointersize = 32 + target triple = "i686-apple-darwin8" + %struct.CONSTRAINT = type { i32, i32, i32, i32 } + %struct.FILE_POS = type { i8, i8, i16, i32 } + %struct.FIRST_UNION = type { %struct.FILE_POS } + %struct.FOURTH_UNION = type { %struct.CONSTRAINT } + %struct.GAP = type { i8, i8, i16 } + %struct.LIST = type { %struct.rec*, %struct.rec* } + %struct.SECOND_UNION = type { { i16, i8, i8 } } + %struct.STYLE = type { { %struct.GAP }, { %struct.GAP }, i16, i16, i16, i8, i8 } + %struct.THIRD_UNION = type { { [2 x i32], [2 x i32] } } + %struct.closure_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* } } + %struct.head_type = type { [2 x %struct.LIST], %struct.FIRST_UNION, %struct.SECOND_UNION, %struct.THIRD_UNION, %struct.FOURTH_UNION, %struct.rec*, { %struct.rec* }, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, %struct.rec*, i32 } + %struct.rec = type { %struct.head_type } + + implementation ; Functions: + + define i32 %test(%struct.closure_type* %tmp18169) { + %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; [#uses=2] + %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1] + %A = load i32* %tmp18174; [#uses=1] + + %tmp18272 = getelementptr %struct.STYLE* %tmp18269, i32 0, i32 0, i32 0, i32 2 ; [#uses=1] + store i16 123, i16* %tmp18272 + + %Q = load i32* %tmp18174; [#uses=1] + %Z = sub i32 %A, %Q ; [#uses=1] + ret i32 %Z + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/BasicAliasAnalysis.cpp
Changes in directory llvm/lib/Analysis: BasicAliasAnalysis.cpp updated: 1.100 -> 1.101 --- Log message: fit to 80 cols. Remove now-extraneous checks for ptr->ptr bitcasts. Fix PR1109: http://llvm.org/PR1109 and Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll. We need to consider arbitrary sized objects when checking for nested GEP offsets. --- Diffs of the changes: (+6 -8) BasicAliasAnalysis.cpp | 14 ++ 1 files changed, 6 insertions(+), 8 deletions(-) Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.100 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.101 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.100 Fri Jan 12 12:20:48 2007 +++ llvm/lib/Analysis/BasicAliasAnalysis.cppSat Jan 13 23:57:53 2007 @@ -104,7 +104,7 @@ bool pointsToConstantMemory(const Value *P); virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, - std::vector *Info); + std::vector *Info); private: // CheckGEPInstructions - Check two GEP instructions with known @@ -274,11 +274,9 @@ // Strip off cast instructions... if (const BitCastInst *I = dyn_cast(V1)) -if (isa(I->getOperand(0)->getType())) - return alias(I->getOperand(0), V1Size, V2, V2Size); +return alias(I->getOperand(0), V1Size, V2, V2Size); if (const BitCastInst *I = dyn_cast(V2)) -if (isa(I->getOperand(0)->getType())) - return alias(V1, V1Size, I->getOperand(0), V2Size); +return alias(V1, V1Size, I->getOperand(0), V2Size); // Figure out what objects these things are pointing to if we can... const Value *O1 = getUnderlyingObject(V1); @@ -363,7 +361,7 @@ Constant::getNullValue(cast(BasePtr2)->getOperand(1)->getType())); // Do the base pointers alias? -AliasResult BaseAlias = alias(BasePtr1, V1Size, BasePtr2, V2Size); +AliasResult BaseAlias = alias(BasePtr1, ~0U, BasePtr2, ~0U); if (BaseAlias == NoAlias) return NoAlias; if (BaseAlias == MustAlias) { // If the base pointers alias each other exactly, check to see if we can @@ -694,9 +692,9 @@ // value possible. // if (const ArrayType *AT = dyn_cast(BasePtr1Ty)) -GEP1Ops[i] = ConstantInt::get(Type::Int64Ty, AT->getNumElements()-1); +GEP1Ops[i] = ConstantInt::get(Type::Int64Ty,AT->getNumElements()-1); else if (const PackedType *PT = dyn_cast(BasePtr1Ty)) -GEP1Ops[i] = ConstantInt::get(Type::Int64Ty, PT->getNumElements()-1); +GEP1Ops[i] = ConstantInt::get(Type::Int64Ty,PT->getNumElements()-1); } } ___ 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/X86ATTAsmPrinter.cpp
Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.87 -> 1.88 --- Log message: add a missing else. This caused globals to be printed as: movq [EMAIL PROTECTED](%rip)(%rip), %rsi instead of: movq [EMAIL PROTECTED](%rip), %rsi --- Diffs of the changes: (+1 -1) X86ATTAsmPrinter.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.87 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.88 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.87 Sat Jan 13 18:48:43 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSun Jan 14 00:08:14 2007 @@ -310,7 +310,7 @@ O << "@GOT"; } else if (Subtarget->isPICStyleRIPRel()) { O << "@GOTPCREL(%rip)"; -} if (Subtarget->is64Bit() && !NotRIPRel) +} else if (Subtarget->is64Bit() && !NotRIPRel) // Use rip when possible to reduce code size, except when // index or base register are also part of the address. e.g. // foo(%rip)(%rcx,%rax,4) is not legal ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/TargetAsmInfo.cpp
Changes in directory llvm/lib/Target: TargetAsmInfo.cpp updated: 1.11 -> 1.12 --- Log message: add a new HiddenDirective member for handling visibility. --- Diffs of the changes: (+1 -0) TargetAsmInfo.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/TargetAsmInfo.cpp diff -u llvm/lib/Target/TargetAsmInfo.cpp:1.11 llvm/lib/Target/TargetAsmInfo.cpp:1.12 --- llvm/lib/Target/TargetAsmInfo.cpp:1.11 Fri Dec 1 14:47:11 2006 +++ llvm/lib/Target/TargetAsmInfo.cpp Sun Jan 14 00:27:21 2007 @@ -62,6 +62,7 @@ HasDotTypeDotSizeDirective(true), UsedDirective(0), WeakRefDirective(0), + HiddenDirective("\t.hidden\t"), HasLEB128(false), HasDotLoc(false), HasDotFile(false), ___ 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/TargetAsmInfo.h
Changes in directory llvm/include/llvm/Target: TargetAsmInfo.h updated: 1.18 -> 1.19 --- Log message: add a new HiddenDirective member for handling visibility. --- Diffs of the changes: (+7 -0) TargetAsmInfo.h |7 +++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/Target/TargetAsmInfo.h diff -u llvm/include/llvm/Target/TargetAsmInfo.h:1.18 llvm/include/llvm/Target/TargetAsmInfo.h:1.19 --- llvm/include/llvm/Target/TargetAsmInfo.h:1.18 Thu Dec 21 15:24:35 2006 +++ llvm/include/llvm/Target/TargetAsmInfo.hSun Jan 14 00:27:21 2007 @@ -216,6 +216,10 @@ /// global as being a weak undefined symbol. const char *WeakRefDirective; // Defaults to null. +/// HiddenDirective - This directive, if non-null, is used to declare a +/// global or function as having hidden visibility. +const char *HiddenDirective; // Defaults to "\t.hidden\t". + //===--- Dwarf Emission Directives ---===// /// HasLEB128 - True if target asm supports leb128 directives. @@ -429,6 +433,9 @@ const char *getWeakRefDirective() const { return WeakRefDirective; } +const char *getHiddenDirective() const { + return HiddenDirective; +} bool hasLEB128() const { return HasLEB128; } ___ 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/X86ATTAsmPrinter.cpp X86AsmPrinter.cpp X86TargetAsmInfo.cpp
Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.88 -> 1.89 X86AsmPrinter.cpp updated: 1.226 -> 1.227 X86TargetAsmInfo.cpp updated: 1.21 -> 1.22 --- Log message: add support for hidden visibility to darwin/x86 --- Diffs of the changes: (+7 -4) X86ATTAsmPrinter.cpp |5 +++-- X86AsmPrinter.cpp|5 +++-- X86TargetAsmInfo.cpp |1 + 3 files changed, 7 insertions(+), 4 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.88 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.89 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.88 Sun Jan 14 00:08:14 2007 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSun Jan 14 00:29:53 2007 @@ -125,8 +125,9 @@ } break; } - if (F->hasHiddenVisibility() && !Subtarget->isTargetDarwin()) -O << "\t.hidden " << CurrentFnName << "\n"; + if (F->hasHiddenVisibility()) +if (const char *Directive = TAI->getHiddenDirective()) + O << Directive << CurrentFnName << "\n"; O << CurrentFnName << ":\n"; // Add some workaround for linkonce linkage on Cygwin\MinGW Index: llvm/lib/Target/X86/X86AsmPrinter.cpp diff -u llvm/lib/Target/X86/X86AsmPrinter.cpp:1.226 llvm/lib/Target/X86/X86AsmPrinter.cpp:1.227 --- llvm/lib/Target/X86/X86AsmPrinter.cpp:1.226 Sat Jan 13 18:50:56 2007 +++ llvm/lib/Target/X86/X86AsmPrinter.cpp Sun Jan 14 00:29:53 2007 @@ -246,8 +246,9 @@ EmitGlobalConstant(C); O << '\n'; } -if (I->hasHiddenVisibility() && !Subtarget->isTargetDarwin()) - O << "\t.hidden " << name << "\n"; +if (I->hasHiddenVisibility()) + if (const char *Directive = TAI->getHiddenDirective()) +O << Directive << name << "\n"; } // Output linker support code for dllexported globals Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.21 llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.22 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.21 Fri Jan 12 17:28:32 2007 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cppSun Jan 14 00:29:53 2007 @@ -64,6 +64,7 @@ SetDirective = "\t.set"; UsedDirective = "\t.no_dead_strip\t"; WeakRefDirective = "\t.weak_reference\t"; +HiddenDirective = "\t.private_extern\t"; NeedsSet = true; DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug"; ___ 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.195 -> 1.196 --- Log message: Fix an incorrect conversion of int -> i32 --- Diffs of the changes: (+2 -2) LangRef.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.195 llvm/docs/LangRef.html:1.196 --- llvm/docs/LangRef.html:1.195Sat Jan 13 18:27:09 2007 +++ llvm/docs/LangRef.html Sun Jan 14 00:29:54 2007 @@ -440,7 +440,7 @@ "weak" linkage is exactly the same as linkonce linkage, except that unreferenced weak globals may not be discarded. This is - used to implement constructs in C such as "i32 X;" at global scope. + used to implement constructs in C such as "int X;" at global scope. appending: @@ -4487,7 +4487,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/01/14 00:27:09 $ + Last modified: $Date: 2007/01/14 06:29:54 $ ___ 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/PPCAsmPrinter.cpp PPCTargetAsmInfo.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCAsmPrinter.cpp updated: 1.227 -> 1.228 PPCTargetAsmInfo.cpp updated: 1.10 -> 1.11 --- Log message: add support for hidden visibility to darwin/ppc and linux/ppc targets --- Diffs of the changes: (+22 -1) PPCAsmPrinter.cpp| 22 +- PPCTargetAsmInfo.cpp |1 + 2 files changed, 22 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.227 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.228 --- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.227 Thu Dec 21 14:26:09 2006 +++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Sun Jan 14 00:37:54 2007 @@ -550,6 +550,11 @@ O << "\t.weak\t" << CurrentFnName << '\n'; break; } + + if (F->hasHiddenVisibility()) +if (const char *Directive = TAI->getHiddenDirective()) + O << Directive << CurrentFnName << "\n"; + EmitAlignment(2, F); O << CurrentFnName << ":\n"; @@ -608,8 +613,13 @@ // Check to see if this is a special global used by LLVM, if so, emit it. if (EmitSpecialLLVMGlobal(I)) continue; - + std::string name = Mang->getValueName(I); + +if (I->hasHiddenVisibility()) + if (const char *Directive = TAI->getHiddenDirective()) +O << Directive << name << "\n"; + Constant *C = I->getInitializer(); unsigned Size = TD->getTypeSize(C->getType()); unsigned Align = TD->getPreferredAlignmentLog(I); @@ -749,6 +759,11 @@ O << "\t.weak_definition\t" << CurrentFnName << "\n"; break; } + + if (F->hasHiddenVisibility()) +if (const char *Directive = TAI->getHiddenDirective()) + O << Directive << CurrentFnName << "\n"; + EmitAlignment(4, F); O << CurrentFnName << ":\n"; @@ -840,6 +855,11 @@ continue; std::string name = Mang->getValueName(I); + +if (I->hasHiddenVisibility()) + if (const char *Directive = TAI->getHiddenDirective()) +O << Directive << name << "\n"; + Constant *C = I->getInitializer(); unsigned Size = TD->getTypeSize(C->getType()); unsigned Align = TD->getPreferredAlignmentLog(I); Index: llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.10 llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.11 --- llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp:1.10 Thu Dec 21 14:26:09 2006 +++ llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cppSun Jan 14 00:37:54 2007 @@ -55,6 +55,7 @@ StaticDtorsSection = ".mod_term_func"; UsedDirective = "\t.no_dead_strip\t"; WeakRefDirective = "\t.weak_reference\t"; + HiddenDirective = "\t.private_extern\t"; } LinuxTargetAsmInfo::LinuxTargetAsmInfo(const PPCTargetMachine &TM) ___ 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.196 -> 1.197 --- Log message: clarify linkonce/weak linkage --- Diffs of the changes: (+11 -8) LangRef.html | 19 +++ 1 files changed, 11 insertions(+), 8 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.196 llvm/docs/LangRef.html:1.197 --- llvm/docs/LangRef.html:1.196Sun Jan 14 00:29:54 2007 +++ llvm/docs/LangRef.html Sun Jan 14 00:51:48 2007 @@ -424,23 +424,26 @@ an internal global value may cause the internal to be renamed as necessary to avoid collisions. Because the symbol is internal to the module, all references can be updated. This corresponds to the notion of the - 'static' keyword in C, or the idea of "anonymous namespaces" in C++. + 'static' keyword in C. linkonce: - "linkonce" linkage is similar to internal linkage, with - the twist that linking together two modules defining the same - linkonce globals will cause one of the globals to be discarded. This - is typically used to implement inline functions. Unreferenced - linkonce globals are allowed to be discarded. + Globals with "linkonce" linkage are merged with other globals of + the same name when linkage occurs. This is typically used to implement + inline functions, templates, or other code which must be generated in each + translation unit that uses it. Unreferenced linkonce globals are + allowed to be discarded. weak: "weak" linkage is exactly the same as linkonce linkage, except that unreferenced weak globals may not be discarded. This is - used to implement constructs in C such as "int X;" at global scope. + used for globals that may be emitted in multiple translation units, but that + are not guaranteed to be emitted into every translation unit that uses them. + One example of this are common globals in C, such as "int X;" at + global scope. appending: @@ -4487,7 +4490,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2007/01/14 06:29:54 $ + Last modified: $Date: 2007/01/14 06:51:48 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits