[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Changes in directory llvm/lib/CodeGen: LiveIntervalAnalysis.cpp updated: 1.222 - 1.223 --- Log message: - Merge UsedBlocks info after two virtual registers are coalesced. - Use distance to closest use to determine whether to abort coalescing. --- Diffs of the changes: (+30 -23) LiveIntervalAnalysis.cpp | 53 ++- 1 files changed, 30 insertions(+), 23 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.222 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.223 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.222 Sat Mar 17 04:27:35 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Mar 18 04:05:55 2007 @@ -940,48 +940,50 @@ if (ReduceJoinPhys !isDead MRegisterInfo::isPhysicalRegister(repSrcReg)) { // Small function. No need to worry! -if (r2iMap_.size() = allocatableRegs_.size() * 2) +unsigned Threshold = allocatableRegs_.count() * 2; +if (r2iMap_.size() = Threshold) goto TryJoin; LiveVariables::VarInfo dvi = lv_-getVarInfo(repDstReg); // Is the value used in the current BB or any immediate successroe BB? -MachineBasicBlock *SrcBB = CopyMI-getParent(); -if (!dvi.UsedBlocks[SrcBB-getNumber()]) { - for (MachineBasicBlock::succ_iterator SI = SrcBB-succ_begin(), - SE = SrcBB-succ_end(); SI != SE; ++SI) { -MachineBasicBlock *SuccMBB = *SI; -if (dvi.UsedBlocks[SuccMBB-getNumber()]) +MachineBasicBlock *CopyBB = CopyMI-getParent(); +if (dvi.UsedBlocks[CopyBB-getNumber()]) + goto TryJoin; +for (MachineBasicBlock::succ_iterator SI = CopyBB-succ_begin(), + SE = CopyBB-succ_end(); SI != SE; ++SI) { + MachineBasicBlock *SuccMBB = *SI; + if (dvi.UsedBlocks[SuccMBB-getNumber()]) goto TryJoin; - } } // Ok, no use in this BB and no use in immediate successor BB's. Be really // careful now! // It's only used in one BB, forget about it! -if (dvi.UsedBlocks.count() = 1) { +if (dvi.UsedBlocks.count() 2) { ++numAborts; return false; } -// Examine all the blocks where the value is used. If any is in the same -// loop, then it's ok. Or if the current BB is a preheader of any of the -// loop that uses this value, that's ok as well. -const LoopInfo LI = getAnalysisLoopInfo(); -const Loop *L = LI.getLoopFor(SrcBB-getBasicBlock()); +// Determine whether to allow coalescing based on how far the closest +// use is. +unsigned CopyIdx = getInstructionIndex(CopyMI); +unsigned MinDist = i2miMap_.size() * InstrSlots::NUM; int UseBBNum = dvi.UsedBlocks.find_first(); while (UseBBNum != -1) { MachineBasicBlock *UseBB = mf_-getBlockNumbered(UseBBNum); - const Loop *UL = LI.getLoopFor(UseBB-getBasicBlock()); - if ((UL UL == L) || // A use in the same loop - (UL L // A use in a loop and this BB is the preheader - UL-getLoopPreheader() == SrcBB-getBasicBlock())) -goto TryJoin; + unsigned UseIdx = getMBBStartIdx(UseBB); + if (UseIdx CopyIdx) { +MinDist = std::min(MinDist, UseIdx - CopyIdx); +if (MinDist = Threshold) + break; + } UseBBNum = dvi.UsedBlocks.find_next(UseBBNum); } - -// Don't do it! -++numAborts; -return false; +if (MinDist Threshold) { + // Don't do it! + ++numAborts; + return false; +} } TryJoin: @@ -1038,6 +1040,11 @@ if (MRegisterInfo::isPhysicalRegister(repDstReg)) { for (const unsigned *AS = mri_-getAliasSet(repDstReg); *AS; ++AS) getInterval(*AS).MergeInClobberRanges(SrcInt); + } else { +// Merge UsedBlocks info if the destination is a virtual register. +LiveVariables::VarInfo dVI = lv_-getVarInfo(repDstReg); +LiveVariables::VarInfo sVI = lv_-getVarInfo(repSrcReg); +dVI.UsedBlocks |= sVI.UsedBlocks; } DOUT \n\t\tJoined. Result = ; DestInt.print(DOUT, mri_); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/PHIElimination.cpp TwoAddressInstructionPass.cpp
Changes in directory llvm/lib/CodeGen: PHIElimination.cpp updated: 1.54 - 1.55 TwoAddressInstructionPass.cpp updated: 1.45 - 1.46 --- Log message: Keep UsedBlocks info accurate. --- Diffs of the changes: (+6 -0) PHIElimination.cpp|3 +++ TwoAddressInstructionPass.cpp |3 +++ 2 files changed, 6 insertions(+) Index: llvm/lib/CodeGen/PHIElimination.cpp diff -u llvm/lib/CodeGen/PHIElimination.cpp:1.54 llvm/lib/CodeGen/PHIElimination.cpp:1.55 --- llvm/lib/CodeGen/PHIElimination.cpp:1.54Wed Jan 31 23:31:50 2007 +++ llvm/lib/CodeGen/PHIElimination.cpp Sun Mar 18 04:02:31 2007 @@ -160,6 +160,8 @@ // Realize that the destination register is defined by the PHI copy now, not // the PHI itself. LV-getVarInfo(DestReg).DefInst = PHICopy; + +LV-getVarInfo(IncomingReg).UsedBlocks[MBB.getNumber()] = true; } // Adjust the VRegPHIUseCount map to account for the removal of this PHI @@ -210,6 +212,7 @@ // instruction kills the incoming value. // LiveVariables::VarInfo InRegVI = LV-getVarInfo(SrcReg); +InRegVI.UsedBlocks[opBlock.getNumber()] = true; // Loop over all of the successors of the basic block, checking to see // if the value is either live in the block, or if it is killed in the Index: llvm/lib/CodeGen/TwoAddressInstructionPass.cpp diff -u llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.45 llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.46 --- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp:1.45 Tue Dec 19 16:41:21 2006 +++ llvm/lib/CodeGen/TwoAddressInstructionPass.cpp Sun Mar 18 04:02:31 2007 @@ -198,6 +198,9 @@ varInfo.DefInst = prevMi; // update live variables for regB + LiveVariables::VarInfo varInfoB = LV.getVarInfo(regB); + // regB is used in this BB. + varInfoB.UsedBlocks[mbbi-getNumber()] = true; if (LV.removeVirtualRegisterKilled(regB, mbbi, mi)) LV.addVirtualRegisterKilled(regB, prevMi); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/README.txt
Changes in directory llvm/lib/Target: README.txt updated: 1.56 - 1.57 --- Log message: This is implemented. We now generate: entry: icmp ugt i32 %x, 4 ; i1:0 [#uses=1] br i1 %0, label %cond_true, label %cond_false cond_true: ; preds = %entry %tmp1 = tail call i32 (...)* @bar( i32 12 ) ; i32 [#uses=0] ret void cond_false: ; preds = %entry switch i32 %x, label %cond_true15 [ i32 4, label %cond_true3 i32 3, label %cond_true7 i32 2, label %cond_true11 i32 0, label %cond_false17 ] ... --- Diffs of the changes: (+0 -40) README.txt | 39 --- 1 files changed, 39 deletions(-) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.56 llvm/lib/Target/README.txt:1.57 --- llvm/lib/Target/README.txt:1.56 Wed Feb 14 21:39:18 2007 +++ llvm/lib/Target/README.txt Sun Mar 18 09:37:20 2007 @@ -348,46 +348,6 @@ //===-===// --predsimplify should transform this: - -void bad(unsigned x) -{ - if (x 4) -bar(12); - else if (x 3) -bar(523); - else if (x 2) -bar(36); - else if (x 1) -bar(65); - else if (x 0) -bar(45); - else -bar(367); -} - -into: - -void good(unsigned x) -{ - if (x == 4) -bar(523); - else if (x == 3) -bar(36); - else if (x == 2) -bar(65); - else if (x == 1) -bar(45); - else if (x == 0) -bar(367); - else -bar(12); -} - -to enable further optimizations. - -//===-===// - Consider: typedef unsigned U32; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/README.txt
Changes in directory llvm/lib/Target: README.txt updated: 1.57 - 1.58 --- Log message: minor updates --- Diffs of the changes: (+6 -8) README.txt | 14 ++ 1 files changed, 6 insertions(+), 8 deletions(-) Index: llvm/lib/Target/README.txt diff -u llvm/lib/Target/README.txt:1.57 llvm/lib/Target/README.txt:1.58 --- llvm/lib/Target/README.txt:1.57 Sun Mar 18 09:37:20 2007 +++ llvm/lib/Target/README.txt Sun Mar 18 17:41:33 2007 @@ -20,12 +20,14 @@ FreeBench/mason contains code like this: -static p_type m0u(p_type p) { +typedef struct { int a; int b; int c; } p_type; +extern int m[]; +p_type m0u(p_type *p) { int m[]={0, 8, 1, 2, 16, 5, 13, 7, 14, 9, 3, 4, 11, 12, 15, 10, 17, 6}; p_type pu; - pu.a = m[p.a]; - pu.b = m[p.b]; - pu.c = m[p.c]; + pu.a = m[p-a]; + pu.b = m[p-b]; + pu.c = m[p-c]; return pu; } @@ -122,10 +124,6 @@ //===-===// -Add LSR exit value substitution. It'll probably be a win for Ackermann, etc. - -//===-===// - It would be nice to revert this patch: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060213/031986.html ___ 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/and-xor-merge.ll
Changes in directory llvm/test/Transforms/InstCombine: and-xor-merge.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+19 -0) and-xor-merge.ll | 19 +++ 1 files changed, 19 insertions(+) Index: llvm/test/Transforms/InstCombine/and-xor-merge.ll diff -c /dev/null llvm/test/Transforms/InstCombine/and-xor-merge.ll:1.1 *** /dev/null Sun Mar 18 17:51:07 2007 --- llvm/test/Transforms/InstCombine/and-xor-merge.ll Sun Mar 18 17:50:57 2007 *** *** 0 --- 1,19 + ; RUN: llvm-as %s | opt -instcombine | llvm-dis | grep and | wc -l | grep 1 + ; RUN: llvm-as %s | opt -instcombine | llvm-dis | grep xor | wc -l | grep 2 + + ; (xz) ^ (yz) - (x^y)z + define i32 @test1(i32 %x, i32 %y, i32 %z) { + %tmp3 = and i32 %z, %x + %tmp6 = and i32 %z, %y + %tmp7 = xor i32 %tmp3, %tmp6 + ret i32 %tmp7 + } + + ; (x y) ^ (x|y) - x^y + define i32 @test2(i32 %x, i32 %y, i32 %z) { + %tmp3 = and i32 %y, %x + %tmp6 = or i32 %y, %x + %tmp7 = xor i32 %tmp3, %tmp6 + 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/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.661 - 1.662 --- Log message: Implement InstCombine/and-xor-merge.ll:test[12]. Rearrange some code to simplify it now that shifts are binops --- Diffs of the changes: (+95 -53) InstructionCombining.cpp | 148 ++- 1 files changed, 95 insertions(+), 53 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.661 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.662 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.661 Wed Mar 14 04:07:33 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Mar 18 17:51:34 2007 @@ -12,10 +12,10 @@ // simplification happens. // // This pass combines things like: -//%Y = add int %X, 1 -//%Z = add int %Y, 1 +//%Y = add i32 %X, 1 +//%Z = add i32 %Y, 1 // into: -//%Z = add int %X, 2 +//%Z = add i32 %X, 2 // // This is a simple worklist driven algorithm. // @@ -4789,58 +4789,115 @@ if (Value *X = dyn_castNotVal(Op1)) // A ^ ~A == -1 if (X == Op0) - return ReplaceInstUsesWith(I, -ConstantInt::getAllOnesValue(I.getType())); + return ReplaceInstUsesWith(I, ConstantInt::getAllOnesValue(I.getType())); - if (BinaryOperator *Op1I = dyn_castBinaryOperator(Op1)) -if (Op1I-getOpcode() == Instruction::Or) { - if (Op1I-getOperand(0) == Op0) { // B^(B|A) == (A|B)^B + + BinaryOperator *Op1I = dyn_castBinaryOperator(Op1); + if (Op1I) { +Value *A, *B; +if (match(Op1I, m_Or(m_Value(A), m_Value(B { + if (A == Op0) { // B^(B|A) == (A|B)^B Op1I-swapOperands(); I.swapOperands(); std::swap(Op0, Op1); - } else if (Op1I-getOperand(1) == Op0) { // B^(A|B) == (A|B)^B + } else if (B == Op0) { // B^(A|B) == (A|B)^B I.swapOperands(); // Simplified below. std::swap(Op0, Op1); } -} else if (Op1I-getOpcode() == Instruction::Xor) { - if (Op0 == Op1I-getOperand(0))// A^(A^B) == B -return ReplaceInstUsesWith(I, Op1I-getOperand(1)); - else if (Op0 == Op1I-getOperand(1)) // A^(B^A) == B -return ReplaceInstUsesWith(I, Op1I-getOperand(0)); -} else if (Op1I-getOpcode() == Instruction::And Op1I-hasOneUse()) { - if (Op1I-getOperand(0) == Op0) // A^(AB) - A^(BA) +} else if (match(Op1I, m_Xor(m_Value(A), m_Value(B { + if (Op0 == A) // A^(A^B) == B +return ReplaceInstUsesWith(I, B); + else if (Op0 == B) // A^(B^A) == B +return ReplaceInstUsesWith(I, A); +} else if (match(Op1I, m_And(m_Value(A), m_Value(B))) Op1I-hasOneUse()){ + if (A == Op0)// A^(AB) - A^(BA) Op1I-swapOperands(); - if (Op0 == Op1I-getOperand(1)) {// A^(BA) - (BA)^A + if (B == Op0) { // A^(BA) - (BA)^A I.swapOperands(); // Simplified below. std::swap(Op0, Op1); } } - - if (BinaryOperator *Op0I = dyn_castBinaryOperator(Op0)) -if (Op0I-getOpcode() == Instruction::Or Op0I-hasOneUse()) { - if (Op0I-getOperand(0) == Op1)// (B|A)^B == (A|B)^B -Op0I-swapOperands(); - if (Op0I-getOperand(1) == Op1) { // (A|B)^B == A ~B -Instruction *NotB = BinaryOperator::createNot(Op1, tmp); -InsertNewInstBefore(NotB, I); -return BinaryOperator::createAnd(Op0I-getOperand(0), NotB); + } + + BinaryOperator *Op0I = dyn_castBinaryOperator(Op0); + if (Op0I) { +Value *A, *B; +if (match(Op0I, m_Or(m_Value(A), m_Value(B))) Op0I-hasOneUse()) { + if (A == Op1) // (B|A)^B == (A|B)^B +std::swap(A, B); + if (B == Op1) {// (A|B)^B == A ~B +Instruction *NotB = + InsertNewInstBefore(BinaryOperator::createNot(Op1, tmp), I); +return BinaryOperator::createAnd(A, NotB); } -} else if (Op0I-getOpcode() == Instruction::Xor) { - if (Op1 == Op0I-getOperand(0))// (A^B)^A == B -return ReplaceInstUsesWith(I, Op0I-getOperand(1)); - else if (Op1 == Op0I-getOperand(1)) // (B^A)^A == B -return ReplaceInstUsesWith(I, Op0I-getOperand(0)); -} else if (Op0I-getOpcode() == Instruction::And Op0I-hasOneUse()) { - if (Op0I-getOperand(0) == Op1) // (AB)^A - (BA)^A -Op0I-swapOperands(); - if (Op0I-getOperand(1) == Op1 // (BA)^A == ~B A +} else if (match(Op0I, m_Xor(m_Value(A), m_Value(B { + if (Op1 == A)
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp
Changes in directory llvm/lib/Transforms/Scalar: PredicateSimplifier.cpp updated: 1.59 - 1.60 --- Log message: Clean up this code and fix subtract miscompile. --- Diffs of the changes: (+22 -18) PredicateSimplifier.cpp | 40 ++-- 1 files changed, 22 insertions(+), 18 deletions(-) Index: llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp diff -u llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.59 llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.60 --- llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp:1.59 Sat Mar 17 20:09:32 2007 +++ llvm/lib/Transforms/Scalar/PredicateSimplifier.cpp Sun Mar 18 17:58:46 2007 @@ -1543,13 +1543,26 @@ // %x = mul i32 %y, 0 then %x EQ 0 Instruction::BinaryOps Opcode = BO-getOpcode(); +const Type *Ty = BO-getType(); +assert(!Ty-isFPOrFPVector() Float in work queue!); + +Constant *Zero = Constant::getNullValue(Ty); +Constant *AllOnes = ConstantInt::getAllOnesValue(Ty); switch (Opcode) { default: break; case Instruction::Sub: +if (Op1 == Zero) { + add(BO, Op0, ICmpInst::ICMP_EQ, NewContext); + return; +} +break; + case Instruction::Or: +if (Op0 == AllOnes || Op1 == AllOnes) { + add(BO, AllOnes, ICmpInst::ICMP_EQ, NewContext); + return; +} // fall-through case Instruction::Add: - case Instruction::Or: { -Constant *Zero = Constant::getNullValue(BO-getType()); if (Op0 == Zero) { add(BO, Op1, ICmpInst::ICMP_EQ, NewContext); return; @@ -1557,9 +1570,8 @@ add(BO, Op0, ICmpInst::ICMP_EQ, NewContext); return; } - } break; - case Instruction::And: { -Constant *AllOnes = ConstantInt::getAllOnesValue(BO-getType()); +break; + case Instruction::And: if (Op0 == AllOnes) { add(BO, Op1, ICmpInst::ICMP_EQ, NewContext); return; @@ -1567,17 +1579,13 @@ add(BO, Op0, ICmpInst::ICMP_EQ, NewContext); return; } - } break; - case Instruction::Mul: { -Constant *Zero = Constant::getNullValue(BO-getType()); -if (Op0 == Zero) { - add(BO, Zero, ICmpInst::ICMP_EQ, NewContext); - return; -} else if (Op1 == Zero) { +// fall-through + case Instruction::Mul: +if (Op0 == Zero || Op1 == Zero) { add(BO, Zero, ICmpInst::ICMP_EQ, NewContext); return; } - } break; +break; } // %x = add i32 %y, %z and %x EQ %y then %z EQ 0 @@ -1585,9 +1593,6 @@ // 1. Repeat all of the above, with order of operands reversed. // %x = udiv i32 %y, %z and %x EQ %y then %z EQ 1 -const Type *Ty = BO-getType(); -assert(!Ty-isFPOrFPVector() Float in work queue!); - Value *Known = Op0, *Unknown = Op1; if (Known != BO) std::swap(Known, Unknown); if (Known == BO) { @@ -1596,8 +1601,7 @@ case Instruction::Xor: case Instruction::Add: case Instruction::Sub: - add(Unknown, Constant::getNullValue(Ty), ICmpInst::ICMP_EQ, - NewContext); + add(Unknown, Zero, ICmpInst::ICMP_EQ, NewContext); break; case Instruction::UDiv: case Instruction::SDiv: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/pubs/2007-03-12-BossaLLVMIntro.pdf
Changes in directory llvm-www/pubs: 2007-03-12-BossaLLVMIntro.pdf updated: 1.1 - 1.2 --- Log message: Update --- Diffs of the changes: (+0 -0) 2007-03-12-BossaLLVMIntro.pdf |0 1 files changed Index: llvm-www/pubs/2007-03-12-BossaLLVMIntro.pdf ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/ScalarRepl/memset-aggregate.ll
Changes in directory llvm/test/Transforms/ScalarRepl: memset-aggregate.ll added (r1.1) --- Log message: testcase for SROA with memset etc --- Diffs of the changes: (+48 -0) memset-aggregate.ll | 48 1 files changed, 48 insertions(+) Index: llvm/test/Transforms/ScalarRepl/memset-aggregate.ll diff -c /dev/null llvm/test/Transforms/ScalarRepl/memset-aggregate.ll:1.1 *** /dev/null Sun Mar 18 19:09:10 2007 --- llvm/test/Transforms/ScalarRepl/memset-aggregate.ll Sun Mar 18 19:09:00 2007 *** *** 0 --- 1,48 + ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | grep 'ret i32 16843009' + ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | not grep alloca + + 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 = i686-apple-darwin8 + %struct.bar = type { %struct.foo, i64, double } + %struct.foo = type { i32, i32 } + + implementation ; Functions: + + define i32 @test1(%struct.foo* %P) { + entry: + %L = alloca %struct.foo, align 8; %struct.foo* [#uses=2] + %L2 = bitcast %struct.foo* %L to i8*; i8* [#uses=1] + %tmp13 = bitcast %struct.foo* %P to i8* ; i8* [#uses=1] + call void @llvm.memcpy.i32( i8* %L2, i8* %tmp13, i32 8, i32 4 ) + %tmp4 = getelementptr %struct.foo* %L, i32 0, i32 0 ; i32* [#uses=1] + %tmp5 = load i32* %tmp4 ; i32 [#uses=1] + ret i32 %tmp5 + } + + declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) + + define i32 @test2() { + entry: + %L = alloca [4 x %struct.foo], align 16 ; [4 x %struct.foo]* [#uses=2] + %L12 = bitcast [4 x %struct.foo]* %L to i8* ; i8* [#uses=1] + call void @llvm.memset.i32( i8* %L12, i8 0, i32 32, i32 16 ) + %tmp4 = getelementptr [4 x %struct.foo]* %L, i32 0, i32 0, i32 0 ; i32* [#uses=1] + %tmp5 = load i32* %tmp4 ; i32 [#uses=1] + ret i32 %tmp5 + } + + declare void @llvm.memset.i32(i8*, i8, i32, i32) + + define i32 @test3() { + entry: + %B = alloca %struct.bar, align 16 ; %struct.bar* [#uses=4] + %B1 = bitcast %struct.bar* %B to i8*; i8* [#uses=1] + call void @llvm.memset.i32( i8* %B1, i8 1, i32 24, i32 16 ) + %tmp3 = getelementptr %struct.bar* %B, i32 0, i32 0, i32 0 ; i32* [#uses=1] + store i32 1, i32* %tmp3 + %tmp4 = getelementptr %struct.bar* %B, i32 0, i32 2 ; double* [#uses=1] + store double 1.00e+01, double* %tmp4 + %tmp6 = getelementptr %struct.bar* %B, i32 0, i32 0, i32 1 ; i32* [#uses=1] + %tmp7 = load i32* %tmp6 ; i32 [#uses=1] + 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/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
Changes in directory llvm/test/Transforms/ScalarRepl: memset-aggregate-byte-leader.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+20 -0) memset-aggregate-byte-leader.ll | 20 1 files changed, 20 insertions(+) Index: llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll diff -c /dev/null llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll:1.1 *** /dev/null Sun Mar 18 19:11:40 2007 --- llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll Sun Mar 18 19:11:30 2007 *** *** 0 --- 1,20 + ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | not grep 'call void @llvm.memcpy.i32' + ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | grep 'getelementptr' + target datalayout = E-p:32:32 + target triple = powerpc-apple-darwin8.8.0 + %struct.foo = type { i8, i8 } + + implementation ; Functions: + + define i32 @test1(%struct.foo* %P) { + entry: + %L = alloca %struct.foo, align 2; %struct.foo* [#uses=1] + %L2 = getelementptr %struct.foo* %L, i32 0, i32 0 ; i8* [#uses=2] + %tmp13 = getelementptr %struct.foo* %P, i32 0, i32 0; i8* [#uses=1] + call void @llvm.memcpy.i32( i8* %L2, i8* %tmp13, i32 2, i32 1 ) + %tmp5 = load i8* %L2; i8 [#uses=1] + %tmp56 = sext i8 %tmp5 to i32 ; i32 [#uses=1] + ret i32 %tmp56 + } + + declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/ScalarRepl/memset-aggregate.ll
Changes in directory llvm/test/Transforms/ScalarRepl: memset-aggregate.ll updated: 1.1 - 1.2 --- Log message: add pr# --- Diffs of the changes: (+1 -0) memset-aggregate.ll |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Transforms/ScalarRepl/memset-aggregate.ll diff -u llvm/test/Transforms/ScalarRepl/memset-aggregate.ll:1.1 llvm/test/Transforms/ScalarRepl/memset-aggregate.ll:1.2 --- llvm/test/Transforms/ScalarRepl/memset-aggregate.ll:1.1 Sun Mar 18 19:09:00 2007 +++ llvm/test/Transforms/ScalarRepl/memset-aggregate.ll Sun Mar 18 19:15:43 2007 @@ -1,5 +1,6 @@ ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | grep 'ret i32 16843009' ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | not grep alloca +; PR1226 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 = 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/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll
Changes in directory llvm/test/Transforms/ScalarRepl: memset-aggregate-byte-leader.ll updated: 1.1 - 1.2 --- Log message: add PR# --- Diffs of the changes: (+1 -0) memset-aggregate-byte-leader.ll |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll diff -u llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll:1.1 llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll:1.2 --- llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll:1.1 Sun Mar 18 19:11:30 2007 +++ llvm/test/Transforms/ScalarRepl/memset-aggregate-byte-leader.ll Sun Mar 18 19:17:19 2007 @@ -1,5 +1,6 @@ ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | not grep 'call void @llvm.memcpy.i32' ; RUN: llvm-as %s | opt -scalarrepl | llvm-dis | grep 'getelementptr' +; PR1226 target datalayout = E-p:32:32 target triple = powerpc-apple-darwin8.8.0 %struct.foo = type { i8, i8 } ___ 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.372 - 1.373 --- Log message: fix a warning --- Diffs of the changes: (+1 -1) X86ISelLowering.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.372 llvm/lib/Target/X86/X86ISelLowering.cpp:1.373 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.372 Fri Mar 16 19:13:28 2007 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Sun Mar 18 19:39:32 2007 @@ -4526,7 +4526,7 @@ case 'I': if (isaConstantSDNode(Op)) { unsigned Value = castConstantSDNode(Op)-getValue(); - if (Value = 0 Value = 31) + if (Value = 31) return Op; else return SDOperand(0,0); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/OpenProjects.html
Changes in directory llvm-www: OpenProjects.html updated: 1.21 - 1.22 --- Log message: Add new idea --- Diffs of the changes: (+9 -1) OpenProjects.html | 10 +- 1 files changed, 9 insertions(+), 1 deletion(-) Index: llvm-www/OpenProjects.html diff -u llvm-www/OpenProjects.html:1.21 llvm-www/OpenProjects.html:1.22 --- llvm-www/OpenProjects.html:1.21 Tue Mar 6 23:31:39 2007 +++ llvm-www/OpenProjects.html Sun Mar 18 19:45:40 2007 @@ -361,6 +361,14 @@ href=/docs/CommandGuide/html/bugpoint.htmlbugpoint/a/tt to reduce the test case and post it to a website or mailing list. Repeat ad infinitum./li liDesign a simple, recognizable logo./li +liMake QEMU use LLVM:br + QEMU currently uses 'dyngen' to produce 'ops', which are executed during + disassembling of binary.br + It will be interesting to teach 'dyngen' emit LLVM code for 'ops' and + use approach similar to LLVM usage in Apple's OpenGL stack: emit LLVM + code for big chunks of input code, optimize it, translate to native code + and execute. It will be also interesting to see speed comparison between + original approach and LLVM-based one./li /ol /div @@ -375,7 +383,7 @@ src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a a href=http://llvm.org;LLVM Compiler Infrastructure/abr - Last modified: $Date: 2007/03/07 05:31:39 $ + Last modified: $Date: 2007/03/19 00:45:40 $ /address !--#include virtual=footer.incl -- ___ 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.223 - 1.224 --- Log message: Minor bug fix. --- Diffs of the changes: (+1 -1) LiveIntervalAnalysis.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.223 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.224 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.223 Sun Mar 18 04:05:55 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Sun Mar 18 23:22:35 2007 @@ -937,7 +937,7 @@ // virtual register. Once the coalescing is done, it cannot be broken and // these are not spillable! If the destination interval uses are far away, // think twice about coalescing them! - if (ReduceJoinPhys !isDead + if (ReduceJoinPhys !mopd-isDead() MRegisterInfo::isPhysicalRegister(repSrcReg)) { // Small function. No need to worry! unsigned Threshold = allocatableRegs_.count() * 2; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/MultiSource/Applications/minisat/Makefile
Changes in directory llvm-test/MultiSource/Applications/minisat: Makefile updated: 1.8 - 1.9 --- Log message: work around a libtool bug. --- Diffs of the changes: (+4 -0) Makefile |4 1 files changed, 4 insertions(+) Index: llvm-test/MultiSource/Applications/minisat/Makefile diff -u llvm-test/MultiSource/Applications/minisat/Makefile:1.8 llvm-test/MultiSource/Applications/minisat/Makefile:1.9 --- llvm-test/MultiSource/Applications/minisat/Makefile:1.8 Fri Feb 16 12:22:21 2007 +++ llvm-test/MultiSource/Applications/minisat/Makefile Sun Mar 18 23:25:29 2007 @@ -12,4 +12,8 @@ include ../../Makefile.multisrc +ifeq ($(OS),Darwin) +SHLIBEXT := .dylib +endif + JIT_OPTS += -load libz$(SHLIBEXT) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/Makefile.programs
Changes in directory llvm-test: Makefile.programs updated: 1.261 - 1.262 --- Log message: Reset x86 llcbeta to -enable-tail-merge. --- Diffs of the changes: (+1 -2) Makefile.programs |3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) Index: llvm-test/Makefile.programs diff -u llvm-test/Makefile.programs:1.261 llvm-test/Makefile.programs:1.262 --- llvm-test/Makefile.programs:1.261 Sat Mar 17 04:31:11 2007 +++ llvm-test/Makefile.programs Mon Mar 19 00:11:53 2007 @@ -223,8 +223,7 @@ LLCBETAOPTION := -sched=simple endif ifeq ($(ARCH),x86) -LLCBETAOPTION := -reduce-joining-phy-regs -#--enable-tail-merge +LLCBETAOPTION := -enable-tail-merge #-regalloc=local -fast endif ifeq ($(ARCH),Sparc) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h
Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.42 - 1.43 --- Log message: Add isStrictPositive() to APInt to determine if this APInt Value 0. --- Diffs of the changes: (+6 -0) APInt.h |6 ++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.42 llvm/include/llvm/ADT/APInt.h:1.43 --- llvm/include/llvm/ADT/APInt.h:1.42 Tue Mar 13 01:16:26 2007 +++ llvm/include/llvm/ADT/APInt.h Mon Mar 19 00:22:18 2007 @@ -374,6 +374,12 @@ return !isNegative(); } + /// This just tests if the value of this APInt is strictly positive ( 0). + /// @brief Determine if this APInt Value is strictly positive. + inline bool isStrictPositive() const { +return isPositive() (*this) != 0; + } + /// Arithmetic right-shift this APInt by shiftAmt. /// @brief Arithmetic right-shift function. APInt ashr(uint32_t shiftAmt) const; ___ 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.113 - 1.114 --- Log message: Add a TargetInstrDescriptor flag to mark an instruction as re-materializable. It means the instruction can be easily re-materialized at any point. e.g. constant generation, load from constantpool. --- Diffs of the changes: (+7 -0) TargetInstrInfo.h |7 +++ 1 files changed, 7 insertions(+) Index: llvm/include/llvm/Target/TargetInstrInfo.h diff -u llvm/include/llvm/Target/TargetInstrInfo.h:1.113 llvm/include/llvm/Target/TargetInstrInfo.h:1.114 --- llvm/include/llvm/Target/TargetInstrInfo.h:1.113Fri Mar 16 03:41:06 2007 +++ llvm/include/llvm/Target/TargetInstrInfo.h Mon Mar 19 01:19:16 2007 @@ -78,6 +78,10 @@ // execution. const unsigned M_PREDICATED = 1 12; +// M_REMATERIALIZIBLE - Set if this instruction can be trivally re-materialized +// at any time, e.g. constant generation, load from constant pool. +const unsigned M_REMATERIALIZIBLE = 1 13; + // Machine operand flags // M_LOOK_UP_PTR_REG_CLASS - Set if this operand is a pointer value and it @@ -207,6 +211,9 @@ bool isPredicated(MachineOpCode Opcode) const { return get(Opcode).Flags M_PREDICATED; } + bool isReMaterializable(MachineOpCode Opcode) const { +return get(Opcode).Flags M_REMATERIALIZIBLE; + } bool isCommutableInstr(MachineOpCode Opcode) const { return get(Opcode).Flags M_COMMUTABLE; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/utils/TableGen/CodeGenInstruction.h CodeGenTarget.cpp InstrInfoEmitter.cpp
Changes in directory llvm/utils/TableGen: CodeGenInstruction.h updated: 1.25 - 1.26 CodeGenTarget.cpp updated: 1.85 - 1.86 InstrInfoEmitter.cpp updated: 1.56 - 1.57 --- Log message: Recognize target instruction flag 'isReMaterializable'. --- Diffs of the changes: (+3 -0) CodeGenInstruction.h |1 + CodeGenTarget.cpp|1 + InstrInfoEmitter.cpp |1 + 3 files changed, 3 insertions(+) Index: llvm/utils/TableGen/CodeGenInstruction.h diff -u llvm/utils/TableGen/CodeGenInstruction.h:1.25 llvm/utils/TableGen/CodeGenInstruction.h:1.26 --- llvm/utils/TableGen/CodeGenInstruction.h:1.25 Wed Nov 15 17:23:02 2006 +++ llvm/utils/TableGen/CodeGenInstruction.hMon Mar 19 01:20:37 2007 @@ -91,6 +91,7 @@ bool isConvertibleToThreeAddress; bool isCommutable; bool isTerminator; +bool isReMaterializable; bool hasDelaySlot; bool usesCustomDAGSchedInserter; bool hasVariableNumberOfOperands; Index: llvm/utils/TableGen/CodeGenTarget.cpp diff -u llvm/utils/TableGen/CodeGenTarget.cpp:1.85 llvm/utils/TableGen/CodeGenTarget.cpp:1.86 --- llvm/utils/TableGen/CodeGenTarget.cpp:1.85 Tue Feb 27 16:08:27 2007 +++ llvm/utils/TableGen/CodeGenTarget.cpp Mon Mar 19 01:20:37 2007 @@ -356,6 +356,7 @@ isConvertibleToThreeAddress = R-getValueAsBit(isConvertibleToThreeAddress); isCommutable = R-getValueAsBit(isCommutable); isTerminator = R-getValueAsBit(isTerminator); + isReMaterializable = R-getValueAsBit(isReMaterializable); hasDelaySlot = R-getValueAsBit(hasDelaySlot); usesCustomDAGSchedInserter = R-getValueAsBit(usesCustomDAGSchedInserter); hasCtrlDep = R-getValueAsBit(hasCtrlDep); Index: llvm/utils/TableGen/InstrInfoEmitter.cpp diff -u llvm/utils/TableGen/InstrInfoEmitter.cpp:1.56 llvm/utils/TableGen/InstrInfoEmitter.cpp:1.57 --- llvm/utils/TableGen/InstrInfoEmitter.cpp:1.56 Fri Jan 26 11:29:20 2007 +++ llvm/utils/TableGen/InstrInfoEmitter.cppMon Mar 19 01:20:37 2007 @@ -240,6 +240,7 @@ if (Inst.isConvertibleToThreeAddress) OS |M_CONVERTIBLE_TO_3_ADDR; if (Inst.isCommutable) OS |M_COMMUTABLE; if (Inst.isTerminator) OS |M_TERMINATOR_FLAG; + if (Inst.isReMaterializable) OS |M_REMATERIALIZIBLE; if (Inst.usesCustomDAGSchedInserter) OS |M_USES_CUSTOM_DAG_SCHED_INSERTION; if (Inst.hasVariableNumberOfOperands) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/Target.td
Changes in directory llvm/lib/Target: Target.td updated: 1.94 - 1.95 --- Log message: Added isReMaterializable. --- Diffs of the changes: (+1 -0) Target.td |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/Target/Target.td diff -u llvm/lib/Target/Target.td:1.94 llvm/lib/Target/Target.td:1.95 --- llvm/lib/Target/Target.td:1.94 Tue Feb 27 00:59:52 2007 +++ llvm/lib/Target/Target.td Mon Mar 19 01:22:07 2007 @@ -165,6 +165,7 @@ bit isConvertibleToThreeAddress = 0; // Can this 2-addr instruction promote? bit isCommutable = 0; // Is this 3 operand instruction commutable? bit isTerminator = 0; // Is this part of the terminator for a basic block? + bit isReMaterializable = 0; // Is this instruction re-materializable? bit hasDelaySlot = 0; // Does this instruction have an delay slot? bit usesCustomDAGSchedInserter = 0; // Pseudo instr needing special help. bit hasCtrlDep = 0; // Does this instruction r/w ctrl-flow chains? ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits