[llvm-commits] [124236] add missing #include
Revision: 124236 Author: clattner Date: 2007-02-23 20:35:59 -0800 (Fri, 23 Feb 2007) Log Message: --- add missing #include Modified Paths: -- apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp Modified: apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp === --- apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp 2007-02-24 04:31:35 UTC (rev 124235) +++ apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp 2007-02-24 04:35:59 UTC (rev 124236) @@ -30,6 +30,10 @@ #include "llvm/Intrinsics.h" #include "llvm/Module.h" +extern "C" { +#include "toplev.h" +} + /* MergeIntPtrOperand - This merges the int and pointer operands of a GCC * intrinsic into a single operand for the LLVM intrinsic. For example, this * turns LVX(4, p) -> llvm.lvx(gep P, 4). OPNUM specifies the operand number ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [124235] emit useful error messages if bad immediates are used
Revision: 124235 Author: clattner Date: 2007-02-23 20:31:35 -0800 (Fri, 23 Feb 2007) Log Message: --- emit useful error messages if bad immediates are used Modified Paths: -- apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp Modified: apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp === --- apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp 2007-02-24 04:15:35 UTC (rev 124234) +++ apple-local/branches/llvm/gcc/config/rs6000/llvm-rs6000.cpp 2007-02-24 04:31:35 UTC (rev 124235) @@ -114,7 +114,7 @@ * invocation into normal LLVM code. If the target can handle the builtin, this * function should emit the expanded code and return true. */ -bool TreeToLLVM::TargetIntrinsicLower(tree_node *exp, +bool TreeToLLVM::TargetIntrinsicLower(tree exp, unsigned FnCode, Value *DestLoc, Value *&Result, @@ -232,47 +232,59 @@ Elt = ConstantExpr::getIntegerCast(Elt, Type::Int8Ty, true); Result = BuildVector(Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, NULL); - return true; +} else { + error("%Helement must be an immediate", &EXPR_LOCATION(exp)); + Result = UndefValue::get(VectorType::get(Type::Int8Ty, 16)); } -return false; +return true; case ALTIVEC_BUILTIN_VSPLTISH: if (Constant *Elt = dyn_cast(Ops[0])) { Elt = ConstantExpr::getIntegerCast(Elt, Type::Int16Ty, true); Result = BuildVector(Elt, Elt, Elt, Elt, Elt, Elt, Elt, Elt, NULL); - return true; +} else { + error("%Helement must be an immediate", &EXPR_LOCATION(exp)); + Result = UndefValue::get(VectorType::get(Type::Int16Ty, 8)); } -return false; +return true; case ALTIVEC_BUILTIN_VSPLTISW: if (Constant *Elt = dyn_cast(Ops[0])) { Elt = ConstantExpr::getIntegerCast(Elt, Type::Int32Ty, true); Result = BuildVector(Elt, Elt, Elt, Elt, NULL); - return true; +} else { + error("%Hmask must be an immediate", &EXPR_LOCATION(exp)); + Result = UndefValue::get(VectorType::get(Type::Int32Ty, 4)); } -return false; +return true; case ALTIVEC_BUILTIN_VSPLTB: if (ConstantInt *Elt = dyn_cast(Ops[1])) { int EV = Elt->getZExtValue(); Result = BuildVectorShuffle(Ops[0], Ops[0], EV, EV, EV, EV, EV, EV, EV, EV, EV, EV, EV, EV, EV, EV, EV, EV); - return true; +} else { + error("%Helement number must be an immediate", &EXPR_LOCATION(exp)); + Result = Ops[0]; } -return false; +return true; case ALTIVEC_BUILTIN_VSPLTH: if (ConstantInt *Elt = dyn_cast(Ops[1])) { int EV = Elt->getZExtValue(); Result = BuildVectorShuffle(Ops[0], Ops[0], EV, EV, EV, EV, EV, EV, EV, EV); - return true; +} else { + error("%Helement number must be an immediate", &EXPR_LOCATION(exp)); + Result = Ops[0]; } -return false; +return true; case ALTIVEC_BUILTIN_VSPLTW: if (ConstantInt *Elt = dyn_cast(Ops[1])) { int EV = Elt->getZExtValue(); Result = BuildVectorShuffle(Ops[0], Ops[0], EV, EV, EV, EV); - return true; +} else { + error("%Helement number must be an immediate", &EXPR_LOCATION(exp)); + Result = Ops[0]; } -return false; +return true; case ALTIVEC_BUILTIN_VSLDOI_16QI: case ALTIVEC_BUILTIN_VSLDOI_8HI: case ALTIVEC_BUILTIN_VSLDOI_4SI: @@ -294,9 +306,11 @@ Amt+4, Amt+5, Amt+6, Amt+7, Amt+8, Amt+9, Amt+10, Amt+11, Amt+12, Amt+13, Amt+14, Amt+15); - return true; +} else { + error("%Hshift amount must be an immediate", &EXPR_LOCATION(exp)); + Result = Ops[0]; } -return false; +return true; case ALTIVEC_BUILTIN_VPKUHUM: { Value *Op0 = Ops[0]; Instruction::CastOps opc = CastInst::getCastOpcode(Op0, ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/APInt.cpp
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.32 -> 1.33 --- Log message: 1. Make internal functions take const arguments where they should, just to be safe. 2. Make internal functions that return a carry/borrow return bool instead of uint64_t because the carry/borrow can only be in range [0,1]. 3. Assert that the pointers to KnuthDiv are all different so that the result and operands can't overlap. 4. Add debug output to KnuthDiv function. 5. Fix a problem with KnuthDiv by separating the b's complement operation from the subtraction borrow operation. This fixes a wide range of division problems, but alas, not all of them. --- Diffs of the changes: (+61 -21) APInt.cpp | 82 ++ 1 files changed, 61 insertions(+), 21 deletions(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.32 llvm/lib/Support/APInt.cpp:1.33 --- llvm/lib/Support/APInt.cpp:1.32 Thu Feb 22 19:57:13 2007 +++ llvm/lib/Support/APInt.cpp Fri Feb 23 21:58:46 2007 @@ -12,8 +12,10 @@ // //===--===// +#define DEBUG_TYPE "apint" #include "llvm/ADT/APInt.h" #include "llvm/DerivedTypes.h" +#include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" #include #include @@ -189,8 +191,9 @@ /// add - This function adds the integer array x[] by integer array /// y[] and returns the carry. -static uint64_t add(uint64_t dest[], uint64_t x[], uint64_t y[], uint32_t len) { - bool carry = 0; +static bool add(uint64_t *dest, const uint64_t *x, const uint64_t *y, +uint32_t len) { + bool carry = false; for (uint32_t i = 0; i< len; ++i) { uint64_t limit = std::min(x[i],y[i]); // must come first in case dest == x dest[i] = x[i] + y[i] + carry; @@ -214,8 +217,8 @@ /// sub - This function subtracts the integer array x[] by /// integer array y[], and returns the borrow-out carry. -static uint64_t sub(uint64_t *dest, const uint64_t *x, const uint64_t *y, -uint32_t len) { +static bool sub(uint64_t *dest, const uint64_t *x, const uint64_t *y, +uint32_t len) { bool borrow = false; for (uint32_t i = 0; i < len; ++i) { uint64_t x_tmp = borrow ? x[i] - 1 : x[i]; @@ -988,12 +991,19 @@ assert(u && "Must provide dividend"); assert(v && "Must provide divisor"); assert(q && "Must provide quotient"); + assert(u != v && u != q && v != q && "Must us different memory"); assert(n>1 && "n must be > 1"); // Knuth uses the value b as the base of the number system. In our case b // is 2^31 so we just set it to -1u. uint64_t b = uint64_t(1) << 32; + DEBUG(cerr << "KnuthDiv: m=" << m << " n=" << n << '\n'); + DEBUG(cerr << "KnuthDiv: original:"); + DEBUG(for (int i = m+n; i >=0; i--) cerr << " " << std::setbase(16) << u[i]); + DEBUG(cerr << " by"); + DEBUG(for (int i = n; i >0; i--) cerr << " " << std::setbase(16) << v[i-1]); + DEBUG(cerr << '\n'); // D1. [Normalize.] Set d = b / (v[n-1] + 1) and multiply all the digits of // u and v by d. Note that we have taken Knuth's advice here to use a power // of 2 value for d such that d * v[n-1] >= b/2 (b is the base). A power of @@ -1018,10 +1028,16 @@ } } u[m+n] = u_carry; + DEBUG(cerr << "KnuthDiv: normal:"); + DEBUG(for (int i = m+n; i >=0; i--) cerr << " " << std::setbase(16) << u[i]); + DEBUG(cerr << " by"); + DEBUG(for (int i = n; i >0; i--) cerr << " " << std::setbase(16) << v[i-1]); + DEBUG(cerr << '\n'); // D2. [Initialize j.] Set j to m. This is the loop counter over the places. int j = m; do { +DEBUG(cerr << "KnuthDiv: quotient digit #" << j << '\n'); // D3. [Calculate q'.]. // Set qp = (u[j+n]*b + u[j+n-1]) / v[n-1]. (qp=qprime=q') // Set rp = (u[j+n]*b + u[j+n-1]) % v[n-1]. (rp=rprime=r') @@ -1031,41 +1047,54 @@ // value qp is one too large, and it eliminates all cases where qp is two // too large. uint64_t dividend = ((uint64_t(u[j+n]) << 32) + u[j+n-1]); +DEBUG(cerr << "KnuthDiv: dividend == " << dividend << '\n'); uint64_t qp = dividend / v[n-1]; uint64_t rp = dividend % v[n-1]; if (qp == b || qp*v[n-2] > b*rp + u[j+n-2]) { qp--; rp += v[n-1]; - if (rp < b) { -if (qp == b || qp*v[n-2] > b*rp + u[j+n-2]) { - qp--; - rp += v[n-1]; -} + if (rp < b && (qp == b || qp*v[n-2] > b*rp + u[j+n-2])) { +qp--; +//rp += v[n-1]; } } +DEBUG(cerr << "KnuthDiv: qp == " << qp << ", rp == " << rp << '\n'); // D4. [Multiply and subtract.] Replace (u[j+n]u[j+n-1]...u[j]) with // (u[j+n]u[j+n-1]..u[j]) - qp * (v[n-1]...v[1]v[0]). This computation // consists of a simple multiplication by a one-place number, combined with // a subtraction. The digits (u[j+n]...u[j]) should be kept positive; -bool borr
[llvm-commits] CVS: llvm/docs/HowToSubmitABug.html
Changes in directory llvm/docs: HowToSubmitABug.html updated: 1.27 -> 1.28 --- Log message: Added some more information on how to use "delta" to reduce testcases. --- Diffs of the changes: (+11 -7) HowToSubmitABug.html | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) Index: llvm/docs/HowToSubmitABug.html diff -u llvm/docs/HowToSubmitABug.html:1.27 llvm/docs/HowToSubmitABug.html:1.28 --- llvm/docs/HowToSubmitABug.html:1.27 Sun Aug 27 19:34:18 2006 +++ llvm/docs/HowToSubmitABug.html Fri Feb 23 21:46:42 2007 @@ -81,7 +81,7 @@ -More often than not, bugs in the compiler cause it to crash - often due to an +More often than not, bugs in the compiler cause it to crash—often due to an assertion failure of some sort. If you are running opt directly, and something crashes, jump to the section on bugs in LLVM passes. Otherwise, the most important @@ -126,12 +126,16 @@ llvm-gcc command that resulted in the crash, but add the -save-temps option. The compiler will crash again, but it will leave behind a foo.i file (containing preprocessed C source code) and -possibly foo.s (containing LLVM assembly code), for each +possibly foo.s (containing LLVM assembly code) for each compiled foo.c file. Send us the foo.i file, -along with a brief description of the error it caused. A tool that might help -you reduce a front-end testcase to a more manageable size is -http://delta.tigris.org/";>delta. - +along with a brief description of the error it caused. + +The http://delta.tigris.org/";>delta tool helps to reduce the +preprocessed file down to the smallest amount of code that still replicates the +problem. You're encouraged to use delta to reduce the code to make the +developers' lives easier. http://gcc.gnu.org/wiki/A_guide_to_testcase_reduction";>This website +has instructions on the best way to use delta. @@ -352,7 +356,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/08/28 00:34:18 $ + Last modified: $Date: 2007/02/24 03:46:42 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/ExecutionEngine/JIT/JIT.h JITEmitter.cpp
Changes in directory llvm/lib/ExecutionEngine/JIT: JIT.h updated: 1.29 -> 1.30 JITEmitter.cpp updated: 1.129 -> 1.130 --- Log message: Fix PR1216: http://llvm.org/PR1216 by cleaning up the ownership of JITResolver. --- Diffs of the changes: (+42 -29) JIT.h |2 + JITEmitter.cpp | 69 + 2 files changed, 42 insertions(+), 29 deletions(-) Index: llvm/lib/ExecutionEngine/JIT/JIT.h diff -u llvm/lib/ExecutionEngine/JIT/JIT.h:1.29 llvm/lib/ExecutionEngine/JIT/JIT.h:1.30 --- llvm/lib/ExecutionEngine/JIT/JIT.h:1.29 Wed Mar 22 23:22:51 2006 +++ llvm/lib/ExecutionEngine/JIT/JIT.h Fri Feb 23 20:57:03 2007 @@ -118,6 +118,8 @@ /// void freeMachineCodeForFunction(Function *F); + /// getCodeEmitter - Return the code emitter this JIT is emitting into. + MachineCodeEmitter *getCodeEmitter() const { return MCE; } private: static MachineCodeEmitter *createEmitter(JIT &J); void runJITOnFunction (Function *F); Index: llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp diff -u llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.129 llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.130 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp:1.129 Tue Jan 30 14:08:37 2007 +++ llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp Fri Feb 23 20:57:03 2007 @@ -457,9 +457,6 @@ /// JITResolver - Keep track of, and resolve, call sites for functions that /// have not yet been compiled. class JITResolver { -/// MCE - The MachineCodeEmitter to use to emit stubs with. -MachineCodeEmitter &MCE; - /// LazyResolverFn - The target lazy resolver function that we actually /// rewrite instructions to use. TargetJITInfo::LazyResolverFn LazyResolverFn; @@ -474,10 +471,18 @@ std::map revGOTMap; unsigned nextGOTIndex; +static JITResolver *TheJITResolver; public: -JITResolver(MachineCodeEmitter &mce) : MCE(mce), nextGOTIndex(0) { - LazyResolverFn = -TheJIT->getJITInfo().getLazyResolverFunction(JITCompilerFn); +JITResolver(JIT &jit) : nextGOTIndex(0) { + TheJIT = &jit; + + LazyResolverFn = jit.getJITInfo().getLazyResolverFunction(JITCompilerFn); + assert(TheJITResolver == 0 && "Multiple JIT resolvers?"); + TheJITResolver = this; +} + +~JITResolver() { + TheJITResolver = 0; } /// getFunctionStub - This returns a pointer to a function stub, creating @@ -510,12 +515,7 @@ }; } -/// getJITResolver - This function returns the one instance of the JIT resolver. -/// -static JITResolver &getJITResolver(MachineCodeEmitter *MCE = 0) { - static JITResolver TheJITResolver(*MCE); - return TheJITResolver; -} +JITResolver *JITResolver::TheJITResolver = 0; #if (defined(__POWERPC__) || defined (__ppc__) || defined(_POWER)) && \ defined(__APPLE__) @@ -548,7 +548,8 @@ // Otherwise, codegen a new stub. For now, the stub will call the lazy // resolver function. - Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, MCE); + Stub = TheJIT->getJITInfo().emitFunctionStub(Actual, + *TheJIT->getCodeEmitter()); if (Actual != (void*)(intptr_t)LazyResolverFn) { // If we are getting the stub for an external function, we really want the @@ -558,7 +559,8 @@ } // Invalidate the icache if necessary. - synchronizeICache(Stub, MCE.getCurrentPCValue()-(intptr_t)Stub); + synchronizeICache(Stub, TheJIT->getCodeEmitter()->getCurrentPCValue() - + (intptr_t)Stub); DOUT << "JIT: Stub emitted at [" << Stub << "] for function '" << F->getName() << "'\n"; @@ -576,10 +578,12 @@ void *&Stub = ExternalFnToStubMap[FnAddr]; if (Stub) return Stub; - Stub = TheJIT->getJITInfo().emitFunctionStub(FnAddr, MCE); + Stub = TheJIT->getJITInfo().emitFunctionStub(FnAddr, + *TheJIT->getCodeEmitter()); // Invalidate the icache if necessary. - synchronizeICache(Stub, MCE.getCurrentPCValue()-(intptr_t)Stub); + synchronizeICache(Stub, TheJIT->getCodeEmitter()->getCurrentPCValue() - +(intptr_t)Stub); DOUT << "JIT: Stub emitted at [" << Stub << "] for external function at '" << FnAddr << "'\n"; @@ -602,7 +606,7 @@ /// been entered. It looks up which function this stub corresponds to, compiles /// it if necessary, then returns the resultant function pointer. void *JITResolver::JITCompilerFn(void *Stub) { - JITResolver &JR = getJITResolver(); + JITResolver &JR = *TheJITResolver; MutexGuard locked(TheJIT->lock); @@ -688,11 +692,16 @@ /// JumpTableBase - A pointer to the first entry in the jump table. /// void *JumpTableBase; -public: -JITEmitter(JIT &jit) : MemMgr(jit.getJITInfo().needsGOT()) { - TheJIT = &jit; + +/// Resolver - This contains info about the currently resolved functions. +JITResolver Resolver; + public: +JITEmitter(JIT &jit) + : MemMgr
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: TargetLowering.cpp updated: 1.93 -> 1.94 --- Log message: Fix CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll and PR1219: http://llvm.org/PR1219 --- Diffs of the changes: (+2 -2) TargetLowering.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp diff -u llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.93 llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.94 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:1.93 Thu Feb 22 12:04:49 2007 +++ llvm/lib/CodeGen/SelectionDAG/TargetLowering.cppFri Feb 23 20:09:29 2007 @@ -1459,11 +1459,11 @@ case ISD::SETGT: case ISD::SETGE: // True if the sign bit of C1 is set. -return DAG.getConstant((C1 & (1ULL << VSize)) != 0, VT); +return DAG.getConstant((C1 & (1ULL << (VSize-1))) != 0, VT); case ISD::SETLT: case ISD::SETLE: // True if the sign bit of C1 isn't set. -return DAG.getConstant((C1 & (1ULL << VSize)) == 0, VT); +return DAG.getConstant((C1 & (1ULL << (VSize-1))) == 0, VT); default: 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/Generic/2007-02-23-DAGCombine-Miscompile.ll
Changes in directory llvm/test/CodeGen/Generic: 2007-02-23-DAGCombine-Miscompile.ll added (r1.1) --- Log message: testcase for PR1219: http://llvm.org/PR1219 --- Diffs of the changes: (+13 -0) 2007-02-23-DAGCombine-Miscompile.ll | 13 + 1 files changed, 13 insertions(+) Index: llvm/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll:1.1 *** /dev/null Fri Feb 23 20:08:10 2007 --- llvm/test/CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll Fri Feb 23 20:08:00 2007 *** *** 0 --- 1,13 + ; RUN: llvm-as < %s | llc -march=x86 | grep 'movl $1, %eax' + ; PR1219 + + define i32 @test(i1 %X) { + old_entry1: + %hvar2 = zext i1 %X to i32 + %C = icmp sgt i32 %hvar2, -1 + br i1 %C, label %cond_true15, label %cond_true + cond_true15: + ret i32 1 + cond_true: + ret i32 2 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/FoldingSet.cpp
Changes in directory llvm/lib/Support: FoldingSet.cpp updated: 1.16 -> 1.17 --- Log message: remove folding set debug output --- Diffs of the changes: (+0 -4) FoldingSet.cpp |4 1 files changed, 4 deletions(-) Index: llvm/lib/Support/FoldingSet.cpp diff -u llvm/lib/Support/FoldingSet.cpp:1.16 llvm/lib/Support/FoldingSet.cpp:1.17 --- llvm/lib/Support/FoldingSet.cpp:1.16Sat Feb 3 19:48:10 2007 +++ llvm/lib/Support/FoldingSet.cpp Fri Feb 23 19:41:48 2007 @@ -14,10 +14,8 @@ // //===--===// -#define DEBUG_TYPE "foldingset" #include "llvm/ADT/FoldingSet.h" #include "llvm/Support/MathExtras.h" -#include "llvm/Support/Debug.h" #include using namespace llvm; @@ -231,7 +229,6 @@ void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) { assert(N->getNextInBucket() == 0); // Do we need to grow the hashtable? - DEBUG(DOUT << "INSERT: " << N << '\n'); if (NumNodes+1 > NumBuckets*2) { GrowHashTable(); NodeID ID; @@ -261,7 +258,6 @@ bool FoldingSetImpl::RemoveNode(Node *N) { // Because each bucket is a circular list, we don't need to compute N's hash // to remove it. - DEBUG(DOUT << "REMOVE: " << N << '\n'); void *Ptr = N->getNextInBucket(); if (Ptr == 0) return false; // Not in folding set. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.137 -> 1.138 --- Log message: Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215: http://llvm.org/PR1215 --- Diffs of the changes: (+2 -1) ConstantFolding.cpp |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.137 llvm/lib/VMCore/ConstantFolding.cpp:1.138 --- llvm/lib/VMCore/ConstantFolding.cpp:1.137 Wed Feb 14 21:39:18 2007 +++ llvm/lib/VMCore/ConstantFolding.cpp Fri Feb 23 19:19:50 2007 @@ -574,7 +574,8 @@ if (CI2->isAllOnesValue() && (((CI1->getType()->getPrimitiveSizeInBits() == 64) && (CI1->getSExtValue() == INT64_MIN)) || - (CI1->getSExtValue() == -CI1->getSExtValue( + (CI1->getSExtValue() == -CI1->getSExtValue() && + CI1->getSExtValue( return 0; // MIN_INT / -1 -> overflow return ConstantInt::get(C1->getType(), CI1->getSExtValue() / CI2->getSExtValue()); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll
Changes in directory llvm/test/Transforms/ConstProp: 2007-02-23-sdiv.ll added (r1.1) --- Log message: testcase for pr1215: http://llvm.org/PR1215 --- Diffs of the changes: (+5 -0) 2007-02-23-sdiv.ll |5 + 1 files changed, 5 insertions(+) Index: llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll diff -c /dev/null llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll:1.1 *** /dev/null Fri Feb 23 19:16:49 2007 --- llvm/test/Transforms/ConstProp/2007-02-23-sdiv.ll Fri Feb 23 19:16:39 2007 *** *** 0 --- 1,5 + ; RUN: llvm-as < %s | llvm-dis | grep 'global i32 0' + ; PR1215 + + @G = global i32 sdiv (i32 0, i32 -1) + ___ 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.636 -> 1.637 --- Log message: Fix InstCombine/2007-02-23-PhiFoldInfLoop.ll and PR1217: http://llvm.org/PR1217 --- Diffs of the changes: (+2 -1) InstructionCombining.cpp |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.636 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.637 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.636 Thu Feb 15 16:52:10 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Feb 23 19:03:45 2007 @@ -1641,11 +1641,12 @@ // Check to see if all of the operands of the PHI are constants. If there is // one non-constant value, remember the BB it is. If there is more than one - // bail out. + // or if *it* is a PHI, bail out. BasicBlock *NonConstBB = 0; for (unsigned i = 0; i != NumPHIValues; ++i) if (!isa(PN->getIncomingValue(i))) { if (NonConstBB) return 0; // More than one non-const value. + if (isa(PN->getIncomingValue(i))) return 0; // Itself a phi. NonConstBB = PN->getIncomingBlock(i); // If the incoming non-constant value is in I's block, we have an infinite ___ 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-02-23-PhiFoldInfLoop.ll
Changes in directory llvm/test/Transforms/InstCombine: 2007-02-23-PhiFoldInfLoop.ll added (r1.1) --- Log message: testcase for pr1217: http://llvm.org/PR1217 --- Diffs of the changes: (+32 -0) 2007-02-23-PhiFoldInfLoop.ll | 32 1 files changed, 32 insertions(+) Index: llvm/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll diff -c /dev/null llvm/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll:1.1 *** /dev/null Fri Feb 23 19:03:21 2007 --- llvm/test/Transforms/InstCombine/2007-02-23-PhiFoldInfLoop.ll Fri Feb 23 19:03:11 2007 *** *** 0 --- 1,32 + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep ret + ; PR1217 + + target datalayout = "e-p:32:32" + target triple = "i686-pc-linux-gnu" + %struct.termbox = type { %struct.termbox*, i32, i32, i32, i32, i32 } + + implementation ; Functions: + + define void @ggenorien() { + entry: + %tmp68 = icmp eq %struct.termbox* null, null; [#uses=1] + br i1 %tmp68, label %cond_next448, label %bb80 + + bb80: ; preds = %entry + ret void + + cond_next448: ; preds = %entry + br i1 false, label %bb756, label %bb595 + + bb595:; preds = %cond_next448 + br label %bb609 + + bb609:; preds = %bb756, %bb595 + %termnum.6240.0 = phi i32 [ 2, %bb595 ], [ %termnum.6, %bb756 ] ; [#uses=1] + %tmp755 = add i32 %termnum.6240.0, 1; [#uses=1] + br label %bb756 + + bb756:; preds = %bb609, %cond_next448 + %termnum.6 = phi i32 [ %tmp755, %bb609 ], [ 2, %cond_next448 ] ; [#uses=1] + br label %bb609 + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/InstrTypes.h Instruction.h Instructions.h
Changes in directory llvm/include/llvm: InstrTypes.h updated: 1.62 -> 1.63 Instruction.h updated: 1.81 -> 1.82 Instructions.h updated: 1.61 -> 1.62 --- Log message: Refactor the setName stuff, moving it down the inheritance hierarchy, to solve a crash in -instcombine -debug that was hit while investigating PR1217: http://llvm.org/PR1217 --- Diffs of the changes: (+42 -116) InstrTypes.h | 46 +++-- Instruction.h |8 +--- Instructions.h | 104 ++--- 3 files changed, 42 insertions(+), 116 deletions(-) Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.62 llvm/include/llvm/InstrTypes.h:1.63 --- llvm/include/llvm/InstrTypes.h:1.62 Tue Feb 13 03:26:04 2007 +++ llvm/include/llvm/InstrTypes.h Fri Feb 23 18:55:48 2007 @@ -29,19 +29,14 @@ /// class TerminatorInst : public Instruction { protected: - TerminatorInst(Instruction::TermOps iType, Use *Ops, unsigned NumOps, - Instruction *InsertBefore = 0); TerminatorInst(const Type *Ty, Instruction::TermOps iType, - Use *Ops, unsigned NumOps, - const std::string &Name = "", Instruction *InsertBefore = 0) -: Instruction(Ty, iType, Ops, NumOps, Name, InsertBefore) {} + Use *Ops, unsigned NumOps, + Instruction *InsertBefore = 0) +: Instruction(Ty, iType, Ops, NumOps, InsertBefore) {} - TerminatorInst(Instruction::TermOps iType, Use *Ops, unsigned NumOps, - BasicBlock *InsertAtEnd); TerminatorInst(const Type *Ty, Instruction::TermOps iType, - Use *Ops, unsigned NumOps, - const std::string &Name, BasicBlock *InsertAtEnd) -: Instruction(Ty, iType, Ops, NumOps, Name, InsertAtEnd) {} + Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) +: Instruction(Ty, iType, Ops, NumOps, InsertAtEnd) {} // Out of line virtual method, so the vtable, etc has a home. ~TerminatorInst(); @@ -90,13 +85,11 @@ class UnaryInstruction : public Instruction { Use Op; protected: - UnaryInstruction(const Type *Ty, unsigned iType, Value *V, - const char *Name = 0, Instruction *IB = 0) -: Instruction(Ty, iType, &Op, 1, Name, IB), Op(V, this) { - } - UnaryInstruction(const Type *Ty, unsigned iType, Value *V, - const char *Name, BasicBlock *IAE) -: Instruction(Ty, iType, &Op, 1, Name, IAE), Op(V, this) { + UnaryInstruction(const Type *Ty, unsigned iType, Value *V, Instruction *IB =0) +: Instruction(Ty, iType, &Op, 1, IB), Op(V, this) { + } + UnaryInstruction(const Type *Ty, unsigned iType, Value *V, BasicBlock *IAE) +: Instruction(Ty, iType, &Op, 1, IAE), Op(V, this) { } public: // Out of line virtual method, so the vtable, etc has a home. @@ -123,20 +116,9 @@ protected: void init(BinaryOps iType); BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty, - const std::string &Name, Instruction *InsertBefore) -: Instruction(Ty, iType, Ops, 2, Name, InsertBefore) { - Ops[0].init(S1, this); - Ops[1].init(S2, this); -init(iType); - } + const std::string &Name, Instruction *InsertBefore); BinaryOperator(BinaryOps iType, Value *S1, Value *S2, const Type *Ty, - const std::string &Name, BasicBlock *InsertAtEnd) -: Instruction(Ty, iType, Ops, 2, Name, InsertAtEnd) { -Ops[0].init(S1, this); -Ops[1].init(S2, this); -init(iType); - } - + const std::string &Name, BasicBlock *InsertAtEnd); public: /// Transparently provide more efficient getOperand methods. @@ -264,13 +246,13 @@ /// @brief Constructor with insert-before-instruction semantics for subclasses CastInst(const Type *Ty, unsigned iType, Value *S, const std::string &Name = "", Instruction *InsertBefore = 0) -: UnaryInstruction(Ty, iType, S, 0, InsertBefore) { +: UnaryInstruction(Ty, iType, S, InsertBefore) { setName(Name); } /// @brief Constructor with insert-at-end-of-block semantics for subclasses CastInst(const Type *Ty, unsigned iType, Value *S, const std::string &Name, BasicBlock *InsertAtEnd) -: UnaryInstruction(Ty, iType, S, 0, InsertAtEnd) { +: UnaryInstruction(Ty, iType, S, InsertAtEnd) { setName(Name); } public: Index: llvm/include/llvm/Instruction.h diff -u llvm/include/llvm/Instruction.h:1.81 llvm/include/llvm/Instruction.h:1.82 --- llvm/include/llvm/Instruction.h:1.81Thu Feb 15 17:15:00 2007 +++ llvm/include/llvm/Instruction.h Fri Feb 23 18:55:48 2007 @@ -41,13 +41,9 @@ void setParent(BasicBlock *P); protected: Instruction(const Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, - const std::string &Name, Instruction *InsertBefore = 0); + Instruction *InsertBefore = 0); Instruction(const Type *Ty, unsigned iType, Use *Ops, unsign
[llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp Instructions.cpp
Changes in directory llvm/lib/VMCore: Instruction.cpp updated: 1.69 -> 1.70 Instructions.cpp updated: 1.77 -> 1.78 --- Log message: Refactor the setName stuff, moving it down the inheritance hierarchy, to solve a crash in -instcombine -debug that was hit while investigating PR1217: http://llvm.org/PR1217 --- Diffs of the changes: (+199 -98) Instruction.cpp | 33 -- Instructions.cpp | 264 +-- 2 files changed, 199 insertions(+), 98 deletions(-) Index: llvm/lib/VMCore/Instruction.cpp diff -u llvm/lib/VMCore/Instruction.cpp:1.69 llvm/lib/VMCore/Instruction.cpp:1.70 --- llvm/lib/VMCore/Instruction.cpp:1.69Mon Feb 19 13:46:17 2007 +++ llvm/lib/VMCore/Instruction.cpp Fri Feb 23 18:55:48 2007 @@ -19,7 +19,7 @@ using namespace llvm; Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps, - const std::string &Name, Instruction *InsertBefore) + Instruction *InsertBefore) : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) { // Make sure that we get added to a basicblock LeakDetector::addGarbageObject(this); @@ -30,11 +30,10 @@ "Instruction to insert before is not in a basic block!"); InsertBefore->getParent()->getInstList().insert(InsertBefore, this); } - setName(Name); } Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps, - const std::string &Name, BasicBlock *InsertAtEnd) + BasicBlock *InsertAtEnd) : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) { // Make sure that we get added to a basicblock LeakDetector::addGarbageObject(this); @@ -42,34 +41,6 @@ // append this instruction into the basic block assert(InsertAtEnd && "Basic block to append to may not be NULL!"); InsertAtEnd->getInstList().push_back(this); - setName(Name); -} - -Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps, - const char *Name, Instruction *InsertBefore) - : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) { - // Make sure that we get added to a basicblock - LeakDetector::addGarbageObject(this); - - // If requested, insert this instruction into a basic block... - if (InsertBefore) { -assert(InsertBefore->getParent() && - "Instruction to insert before is not in a basic block!"); -InsertBefore->getParent()->getInstList().insert(InsertBefore, this); - } - if (Name && *Name) setName(Name); -} - -Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps, - const char *Name, BasicBlock *InsertAtEnd) - : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) { - // Make sure that we get added to a basicblock - LeakDetector::addGarbageObject(this); - - // append this instruction into the basic block - assert(InsertAtEnd && "Basic block to append to may not be NULL!"); - InsertAtEnd->getInstList().push_back(this); - if (Name && *Name) setName(Name); } Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.77 llvm/lib/VMCore/Instructions.cpp:1.78 --- llvm/lib/VMCore/Instructions.cpp:1.77 Wed Feb 14 21:39:18 2007 +++ llvm/lib/VMCore/Instructions.cppFri Feb 23 18:55:48 2007 @@ -40,16 +40,6 @@ //TerminatorInst Class //===--===// -TerminatorInst::TerminatorInst(Instruction::TermOps iType, - Use *Ops, unsigned NumOps, Instruction *IB) - : Instruction(Type::VoidTy, iType, Ops, NumOps, "", IB) { -} - -TerminatorInst::TerminatorInst(Instruction::TermOps iType, - Use *Ops, unsigned NumOps, BasicBlock *IAE) - : Instruction(Type::VoidTy, iType, Ops, NumOps, "", IAE) { -} - // Out of line virtual method, so the vtable, etc has a home. TerminatorInst::~TerminatorInst() { } @@ -272,63 +262,71 @@ const std::string &Name, BasicBlock *InsertAtEnd) : Instruction(cast(cast(Func->getType()) ->getElementType())->getReturnType(), -Instruction::Call, 0, 0, Name, InsertAtEnd) { +Instruction::Call, 0, 0, InsertAtEnd) { init(Func, Args, NumArgs); + setName(Name); } CallInst::CallInst(Value *Func, Value* const *Args, unsigned NumArgs, const std::string &Name, Instruction *InsertBefore) : Instruction(cast(cast(Func->getType()) ->getElementType())->getReturnType(), - Instruction::Call, 0, 0, Name, InsertBefore) { + Instruction::Call, 0, 0, InsertBefore) { init(Func, Args, NumArgs); + setName(Name); } CallInst::CallInst(Value *Func, Value *Actual1, Value *Actual2, const std::string &Name, Instruction *InsertBe
[llvm-commits] CVS: llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll
Changes in directory llvm/test/CodeGen/CBackend: 2007-02-23-NameConflicts.ll updated: 1.1 -> 1.2 --- Log message: Make the testcase correct. --- Diffs of the changes: (+2 -2) 2007-02-23-NameConflicts.ll |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll diff -u llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll:1.1 llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll:1.2 --- llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll:1.1 Fri Feb 23 17:19:32 2007 +++ llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll Fri Feb 23 17:23:41 2007 @@ -1,5 +1,5 @@ -; RUN: llvm-as < %s | llc -march=c | grep 'llvm_cbe_A = *llvm_cbe_G;' && -; RUN: llvm-as < %s | llc -march=c | grep 'llvm_cbe_B = *(
[llvm-commits] CVS: llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll
Changes in directory llvm/test/CodeGen/CBackend: 2007-02-23-NameConflicts.ll added (r1.1) --- Log message: Testcase for PR1164: http://llvm.org/PR1164 --- Diffs of the changes: (+13 -0) 2007-02-23-NameConflicts.ll | 13 + 1 files changed, 13 insertions(+) Index: llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll diff -c /dev/null llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll:1.1 *** /dev/null Fri Feb 23 17:19:42 2007 --- llvm/test/CodeGen/CBackend/2007-02-23-NameConflicts.ll Fri Feb 23 17:19:32 2007 *** *** 0 --- 1,13 + ; RUN: llvm-as < %s | llc -march=c | grep 'llvm_cbe_A = *llvm_cbe_G;' && + ; RUN: llvm-as < %s | llc -march=c | grep 'llvm_cbe_B = *(
[llvm-commits] CVS: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp CallTargets.cpp CompleteBottomUp.cpp DataStructure.cpp DataStructureAA.cpp DataStructureOpt.cpp EquivClassGraphs.cpp Local.cpp Steensgaar
Changes in directory llvm-poolalloc/lib/DSA: BottomUpClosure.cpp updated: 1.129 -> 1.130 CallTargets.cpp updated: 1.10 -> 1.11 CompleteBottomUp.cpp updated: 1.41 -> 1.42 DataStructure.cpp updated: 1.258 -> 1.259 DataStructureAA.cpp updated: 1.41 -> 1.42 DataStructureOpt.cpp updated: 1.17 -> 1.18 EquivClassGraphs.cpp updated: 1.55 -> 1.56 Local.cpp updated: 1.167 -> 1.168 Steensgaard.cpp updated: 1.68 -> 1.69 TopDownClosure.cpp updated: 1.97 -> 1.98 --- Log message: Made to compile with newest version of llvm tree --- Diffs of the changes: (+52 -51) BottomUpClosure.cpp | 10 +- CallTargets.cpp |2 +- CompleteBottomUp.cpp | 12 ++-- DataStructure.cpp| 18 +- DataStructureAA.cpp |3 ++- DataStructureOpt.cpp |2 +- EquivClassGraphs.cpp | 18 +- Local.cpp| 18 +- Steensgaard.cpp |6 +++--- TopDownClosure.cpp | 14 +++--- 10 files changed, 52 insertions(+), 51 deletions(-) Index: llvm-poolalloc/lib/DSA/BottomUpClosure.cpp diff -u llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.129 llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.130 --- llvm-poolalloc/lib/DSA/BottomUpClosure.cpp:1.129Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/BottomUpClosure.cpp Fri Feb 23 16:49:32 2007 @@ -163,13 +163,13 @@ hash_map ValMap; unsigned NextID = 1; - Function *MainFunc = M.getMainFunction(); + Function *MainFunc = M.getFunction("main"); if (MainFunc) calculateGraphs(MainFunc, Stack, NextID, ValMap); // Calculate the graphs for any functions that are unreachable from main... for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) -if (!I->isExternal() && !DSInfo.count(I)) { +if (!I->isDeclaration() && !DSInfo.count(I)) { if (MainFunc) DOUT << "*** BU: Function unreachable from main: " << I->getName() << "\n"; @@ -212,7 +212,7 @@ // Merge the globals variables (not the calls) from the globals graph back // into the main function's graph so that the main function contains all of // the information about global pools and GV usage in the program. - if (MainFunc && !MainFunc->isExternal()) { + if (MainFunc && !MainFunc->isDeclaration()) { DSGraph &MainGraph = getOrCreateGraph(MainFunc); const DSGraph &GG = *MainGraph.getGlobalsGraph(); ReachabilityCloner RC(MainGraph, GG, @@ -280,7 +280,7 @@ } static bool isResolvableFunc(const Function* callee) { - return !callee->isExternal() || isVAHackFn(callee); + return !callee->isDeclaration() || isVAHackFn(callee); } static void GetAllCallees(const DSCallSite &CS, @@ -349,7 +349,7 @@ // FIXME! This test should be generalized to be any function that we have // already processed, in the case when there isn't a main or there are // unreachable functions! - if (F->isExternal()) { // sprintf, fprintf, sscanf, etc... + if (F->isDeclaration()) { // sprintf, fprintf, sscanf, etc... // No callees! Stack.pop_back(); ValMap[F] = ~0; Index: llvm-poolalloc/lib/DSA/CallTargets.cpp diff -u llvm-poolalloc/lib/DSA/CallTargets.cpp:1.10 llvm-poolalloc/lib/DSA/CallTargets.cpp:1.11 --- llvm-poolalloc/lib/DSA/CallTargets.cpp:1.10 Wed Jan 10 13:59:52 2007 +++ llvm-poolalloc/lib/DSA/CallTargets.cpp Fri Feb 23 16:49:32 2007 @@ -42,7 +42,7 @@ { TDDataStructures* T = &getAnalysis(); for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) -if (!I->isExternal()) +if (!I->isDeclaration()) for (Function::iterator F = I->begin(), FE = I->end(); F != FE; ++F) for (BasicBlock::iterator B = F->begin(), BE = F->end(); B != BE; ++B) if (isa(B) || isa(B)) { Index: llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp diff -u llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.41 llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.42 --- llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp:1.41Wed Jan 10 12:10:32 2007 +++ llvm-poolalloc/lib/DSA/CompleteBottomUp.cpp Fri Feb 23 16:49:32 2007 @@ -46,16 +46,16 @@ hash_map ValMap; unsigned NextID = 1; - Function *MainFunc = M.getMainFunction(); + Function *MainFunc = M.getFunction("main"); if (MainFunc) { -if (!MainFunc->isExternal()) +if (!MainFunc->isDeclaration()) calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap); } else { DOUT << "CBU-DSA: No 'main' function found!\n"; } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) -if (!I->isExternal() && !DSInfo.count(I)) { +if (!I->isDeclaration() && !DSInfo.count(I)) { if (MainFunc) { DOUT << "*** CBU: Function unreachable from main: " << I->getName() << "\n"; @@ -69,7 +69,7 @@ // Merge the globals variables (not the calls) from the globals graph back // into the main function's graph so that the main function contains all of // the information about global pools and GV usage in the program. - if (MainFunc
[llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp
Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.327 -> 1.328 --- Log message: PR1164: http://llvm.org/PR1164 : Generate local names with a "llvm_cbe_" prefix using the actual name of the variable instead of a temporary name. --- Diffs of the changes: (+52 -22) CBackend.cpp | 74 +-- 1 files changed, 52 insertions(+), 22 deletions(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.327 llvm/lib/Target/CBackend/CBackend.cpp:1.328 --- llvm/lib/Target/CBackend/CBackend.cpp:1.327 Wed Feb 14 21:39:18 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Fri Feb 23 16:45:08 2007 @@ -239,7 +239,7 @@ } void outputLValue(Instruction *I) { - Out << " " << Mang->getValueName(I) << " = "; + Out << " " << GetValueName(I) << " = "; } bool isGotoCodeNecessary(BasicBlock *From, BasicBlock *To); @@ -249,6 +249,8 @@ unsigned Indent); void printIndexingExpression(Value *Ptr, gep_type_iterator I, gep_type_iterator E); + +std::string GetValueName(const Value *Operand); }; } @@ -1080,6 +1082,34 @@ printConstant(CPV); } +std::string CWriter::GetValueName(const Value *Operand) { + std::string Name; + + if (!isa(Operand) && Operand->getName() != "") { +std::string VarName; + +Name = Operand->getName(); +VarName.reserve(Name.capacity()); + +for (std::string::iterator I = Name.begin(), E = Name.end(); + I != E; ++I) { + char ch = *I; + + if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || +(ch >= '0' && ch <= '9') || ch == '_')) +VarName += '_'; + else +VarName += ch; +} + +Name = "llvm_cbe_" + VarName; + } else { +Name = Mang->getValueName(Operand); + } + + return Name; +} + void CWriter::writeOperandInternal(Value *Operand) { if (Instruction *I = dyn_cast(Operand)) if (isInlinableInst(*I) && !isDirectAlloca(I)) { @@ -1091,11 +1121,11 @@ } Constant* CPV = dyn_cast(Operand); - if (CPV && !isa(CPV)) { + + if (CPV && !isa(CPV)) printConstant(CPV); - } else { -Out << Mang->getValueName(Operand); - } + else +Out << GetValueName(Operand); } void CWriter::writeOperandRaw(Value *Operand) { @@ -1103,7 +1133,7 @@ if (CPV && !isa(CPV)) { printConstant(CPV); } else { -Out << Mang->getValueName(Operand); +Out << GetValueName(Operand); } } @@ -1472,17 +1502,17 @@ if (I->hasExternalLinkage()) { Out << "extern "; printType(Out, I->getType()->getElementType(), false, - Mang->getValueName(I)); + GetValueName(I)); Out << ";\n"; } else if (I->hasDLLImportLinkage()) { Out << "__declspec(dllimport) "; printType(Out, I->getType()->getElementType(), false, - Mang->getValueName(I)); + GetValueName(I)); Out << ";\n"; } else if (I->hasExternalWeakLinkage()) { Out << "extern "; printType(Out, I->getType()->getElementType(), false, - Mang->getValueName(I)); + GetValueName(I)); Out << " __EXTERNAL_WEAK__ ;\n"; } } @@ -1533,7 +1563,7 @@ else Out << "extern "; printType(Out, I->getType()->getElementType(), false, - Mang->getValueName(I)); + GetValueName(I)); if (I->hasLinkOnceLinkage()) Out << " __attribute__((common))"; @@ -1565,7 +1595,7 @@ Out << "__declspec(dllexport) "; printType(Out, I->getType()->getElementType(), false, - Mang->getValueName(I)); + GetValueName(I)); if (I->hasLinkOnceLinkage()) Out << " __attribute__((common))"; else if (I->hasWeakLinkage()) @@ -1772,7 +1802,7 @@ std::stringstream FunctionInnards; // Print out the name... - FunctionInnards << Mang->getValueName(F) << '('; + FunctionInnards << GetValueName(F) << '('; bool PrintedArg = false; if (!F->isDeclaration()) { @@ -1791,7 +1821,7 @@ for (; I != E; ++I) { if (PrintedArg) FunctionInnards << ", "; if (I->hasName() || !Prototype) - ArgName = Mang->getValueName(I); + ArgName = GetValueName(I); else ArgName = ""; printType(FunctionInnards, I->getType(), @@ -1874,7 +1904,7 @@ Out << " "; printType(Out, F.arg_begin()->getType(), false, - Mang->getValueName(F.arg_begin())); + GetValueName(F.arg_begin())); Out << " = &StructReturn;\n"; } @@ -1884,18 +1914,18 @@ for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ++I) { if (const AllocaInst *AI = isDirectAlloca(&*I)) { Out << " "; - printType(Out, AI->getAllocat
[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.3 -> 1.4 --- Log message: PR1164: http://llvm.org/PR1164 : Generate local names with a "llvm_cbe_" prefix using the actual name of the variable instead of a temporary name. --- Diffs of the changes: (+1 -1) 2007-01-08-ParamAttr-ICmp.ll |2 +- 1 files changed, 1 insertion(+), 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.3 llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.4 --- llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll:1.3 Thu Feb 15 15:01:58 2007 +++ llvm/test/CodeGen/CBackend/2007-01-08-ParamAttr-ICmp.ll Fri Feb 23 16:45:08 2007 @@ -1,6 +1,6 @@ ; For PR1099 ; RUN: llvm-as < %s | llc -march=c | \ -; RUN: grep 'return ltmp_2_2 == ltmp_1_2)) ? (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/lib/Support/Allocator.cpp
Changes in directory llvm/lib/Support: Allocator.cpp updated: 1.5 -> 1.6 --- Log message: Avoid TBAA issue. --- Diffs of the changes: (+4 -1) Allocator.cpp |5 - 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm/lib/Support/Allocator.cpp diff -u llvm/lib/Support/Allocator.cpp:1.5 llvm/lib/Support/Allocator.cpp:1.6 --- llvm/lib/Support/Allocator.cpp:1.5 Thu Dec 7 17:41:45 2006 +++ llvm/lib/Support/Allocator.cpp Fri Feb 23 16:31:24 2007 @@ -93,7 +93,10 @@ } void *BumpPtrAllocator::Allocate(unsigned Size, unsigned Align) { - return ((MemRegion*)TheMemory)->Allocate(Size, Align,(MemRegion**)&TheMemory); + MemRegion *MRP = (MemRegion*)TheMemory; + void *Ptr = MRP->Allocate(Size, Align, &MRP); + TheMemory = MRP; + return Ptr; } void BumpPtrAllocator::PrintStats() const { ___ 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-02-23-lr-saved-twice.ll
Changes in directory llvm/test/CodeGen/PowerPC: 2007-02-23-lr-saved-twice.ll added (r1.1) --- Log message: New test - practically wrote itself. --- Diffs of the changes: (+15 -0) 2007-02-23-lr-saved-twice.ll | 15 +++ 1 files changed, 15 insertions(+) Index: llvm/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll diff -c /dev/null llvm/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll:1.1 *** /dev/null Fri Feb 23 16:12:18 2007 --- llvm/test/CodeGen/PowerPC/2007-02-23-lr-saved-twice.ll Fri Feb 23 16:12:08 2007 *** *** 0 --- 1,15 + ; RUN: llvm-as < %s | llc | grep mflr | wc -l | grep 1 + + target datalayout = "e-p:32:32" + target triple = "powerpc-apple-darwin8" + @str = internal constant [18 x i8] c"hello world!, %d\0A\00"; <[18 x i8]*> [#uses=1] + + implementation ; Functions: + + define i32 @main() { + entry: + %tmp = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([18 x i8]* @str, i32 0, i32 0) ); [#uses=0] + ret i32 0 + } + + declare i32 @printf(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/ARM/ARMRegisterInfo.cpp
Changes in directory llvm/lib/Target/ARM: ARMRegisterInfo.cpp updated: 1.71 -> 1.72 --- Log message: bugfix: SP wasn't updated for varargs when frame pointer was eliminated. --- Diffs of the changes: (+65 -65) ARMRegisterInfo.cpp | 130 ++-- 1 files changed, 65 insertions(+), 65 deletions(-) Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.71 llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.72 --- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.71Thu Feb 22 19:09:11 2007 +++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Fri Feb 23 15:53:48 2007 @@ -1086,15 +1086,16 @@ // belongs to which callee-save spill areas. unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0; int FramePtrSpillFI = 0; + + if (VARegSaveSize) +emitSPUpdate(MBB, MBBI, -VARegSaveSize, isThumb, TII); + if (!AFI->hasStackFrame()) { if (NumBytes != 0) emitSPUpdate(MBB, MBBI, -NumBytes, isThumb, TII); return; } - if (VARegSaveSize) -emitSPUpdate(MBB, MBBI, -VARegSaveSize, isThumb, TII); - for (unsigned i = 0, e = CSI.size(); i != e; ++i) { unsigned Reg = CSI[i].getReg(); int FI = CSI[i].getFrameIdx(); @@ -1208,72 +1209,71 @@ if (!AFI->hasStackFrame()) { if (NumBytes != 0) emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); -return; - } - - // Unwind MBBI to point to first LDR / FLDD. - const unsigned *CSRegs = getCalleeSavedRegs(); - if (MBBI != MBB.begin()) { -do - --MBBI; -while (MBBI != MBB.begin() && isCSRestore(MBBI, CSRegs)); -if (!isCSRestore(MBBI, CSRegs)) - ++MBBI; - } - - // Move SP to start of FP callee save spill area. - NumBytes -= (AFI->getGPRCalleeSavedArea1Size() + - AFI->getGPRCalleeSavedArea2Size() + - AFI->getDPRCalleeSavedAreaSize()); - if (isThumb) { -if (hasFP(MF)) { - NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; - // Reset SP based on frame pointer only if the stack frame extends beyond - // frame pointer stack slot or target is ELF and the function has FP. - if (NumBytes) -emitThumbRegPlusImmediate(MBB, MBBI, ARM::SP, FramePtr, -NumBytes, TII); - else -BuildMI(MBB, MBBI, TII.get(ARM::tMOVrr), ARM::SP).addReg(FramePtr); -} else { - if (MBBI->getOpcode() == ARM::tBX_RET && - &MBB.front() != MBBI && - prior(MBBI)->getOpcode() == ARM::tPOP) { -MachineBasicBlock::iterator PMBBI = prior(MBBI); -emitSPUpdate(MBB, PMBBI, NumBytes, isThumb, TII); - } else -emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); -} } else { -// Darwin ABI requires FP to point to the stack slot that contains the -// previous FP. -if (STI.isTargetDarwin() || hasFP(MF)) { - NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; - // Reset SP based on frame pointer only if the stack frame extends beyond - // frame pointer stack slot or target is ELF and the function has FP. - if (AFI->getGPRCalleeSavedArea2Size() || - AFI->getDPRCalleeSavedAreaSize() || - AFI->getDPRCalleeSavedAreaOffset()|| - hasFP(MF)) +// Unwind MBBI to point to first LDR / FLDD. +const unsigned *CSRegs = getCalleeSavedRegs(); +if (MBBI != MBB.begin()) { + do +--MBBI; + while (MBBI != MBB.begin() && isCSRestore(MBBI, CSRegs)); + if (!isCSRestore(MBBI, CSRegs)) +++MBBI; +} + +// Move SP to start of FP callee save spill area. +NumBytes -= (AFI->getGPRCalleeSavedArea1Size() + + AFI->getGPRCalleeSavedArea2Size() + + AFI->getDPRCalleeSavedAreaSize()); +if (isThumb) { + if (hasFP(MF)) { +NumBytes = AFI->getFramePtrSpillOffset() - NumBytes; +// Reset SP based on frame pointer only if the stack frame extends beyond +// frame pointer stack slot or target is ELF and the function has FP. if (NumBytes) - BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr) -.addImm(NumBytes); + emitThumbRegPlusImmediate(MBB, MBBI, ARM::SP, FramePtr, -NumBytes, TII); else - BuildMI(MBB, MBBI, TII.get(ARM::MOVrr), ARM::SP).addReg(FramePtr); -} else if (NumBytes) { - emitSPUpdate(MBB, MBBI, NumBytes, false, TII); -} + BuildMI(MBB, MBBI, TII.get(ARM::tMOVrr), ARM::SP).addReg(FramePtr); + } else { +if (MBBI->getOpcode() == ARM::tBX_RET && +&MBB.front() != MBBI && +prior(MBBI)->getOpcode() == ARM::tPOP) { + MachineBasicBlock::iterator PMBBI = prior(MBBI); + emitSPUpdate(MBB, PMBBI, NumBytes, isThumb, TII); +} else + emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII); + } +} else { + // Darwin ABI requires FP to point to the stack slot that contains the + // previous FP. + if (STI.isTargetDarwin() || hasFP(MF)) { +
[llvm-commits] CVS: llvm/test/CodeGen/ARM/vargs_align.ll
Changes in directory llvm/test/CodeGen/ARM: vargs_align.ll updated: 1.1 -> 1.2 --- Log message: bugfix: SP wasn't updated for varargs when frame pointer was eliminated. --- Diffs of the changes: (+2 -2) vargs_align.ll |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/CodeGen/ARM/vargs_align.ll diff -u llvm/test/CodeGen/ARM/vargs_align.ll:1.1 llvm/test/CodeGen/ARM/vargs_align.ll:1.2 --- llvm/test/CodeGen/ARM/vargs_align.ll:1.1Fri Feb 23 14:32:57 2007 +++ llvm/test/CodeGen/ARM/vargs_align.llFri Feb 23 15:53:48 2007 @@ -1,6 +1,6 @@ ; RUN: llvm-as < %s | llc -march=arm && -; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi -disable-fp-elim | grep "add sp, sp, #16" && -; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu -disable-fp-elim | grep "add sp, sp, #12" +; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi | grep "add sp, sp, #16" | wc -l | grep 1 && +; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu | grep "add sp, sp, #12" | wc -l | grep 2 define i32 @f(i32 %a, ...) { entry: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/VirtRegMap.cpp
Changes in directory llvm/lib/CodeGen: VirtRegMap.cpp updated: 1.98 -> 1.99 --- Log message: Reuse extends the liveness of a register. Transfer the kill to the operand that reuse it. --- Diffs of the changes: (+6 -1) VirtRegMap.cpp |7 ++- 1 files changed, 6 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/VirtRegMap.cpp diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.98 llvm/lib/CodeGen/VirtRegMap.cpp:1.99 --- llvm/lib/CodeGen/VirtRegMap.cpp:1.98Thu Feb 22 19:13:26 2007 +++ llvm/lib/CodeGen/VirtRegMap.cpp Fri Feb 23 15:47:50 2007 @@ -665,8 +665,13 @@ // Extend the live range of the MI that last kill the register if // necessary. MachineOperand *MOK = SSMI->findRegisterUseOperand(PhysReg, true); - if (MOK) + if (MOK) { MOK->unsetIsKill(); +if (ti == -1) + // Unless it's the use of a two-address code, transfer the kill + // of the reused register to this use. + MI.getOperand(i).setIsKill(); + } // The only technical detail we have is that we don't know that // PhysReg won't be clobbered by a reloaded stack slot that occurs ___ 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.372 -> 1.373 --- Log message: Handle improper cast. --- Diffs of the changes: (+19 -6) SelectionDAGISel.cpp | 25 +++-- 1 files changed, 19 insertions(+), 6 deletions(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.372 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.373 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.372Thu Feb 22 10:10:05 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Feb 23 15:45:01 2007 @@ -484,7 +484,9 @@ unsigned Opc); bool isExportableFromCurrentBlock(Value *V, const BasicBlock *FromBB); void ExportFromCurrentBlock(Value *V); - void LowerCallTo(CallInst &I, SDOperand Callee, unsigned OpIdx); + void LowerCallTo(Instruction &I, + const Type *CalledValueTy, unsigned CallingConv, + bool IsTailCall, SDOperand Callee, unsigned OpIdx); // Terminator instructions. void visitRet(ReturnInst &I); @@ -1118,7 +1120,11 @@ DAG.setRoot(DAG.getNode(ISD::LABEL, MVT::Other, getRoot(), DAG.getConstant(BeginLabel, MVT::i32))); - LowerCallTo((CallInst&)I, getValue(I.getOperand(0)), 3); + LowerCallTo(I, I.getCalledValue()->getType(), + I.getCallingConv(), + false, + getValue(I.getOperand(0)), + 3); // Insert a label before the invoke call to mark the try range. // This can be used to detect deletion of the invoke via the @@ -2246,9 +2252,12 @@ } -void SelectionDAGLowering::LowerCallTo(CallInst &I, +void SelectionDAGLowering::LowerCallTo(Instruction &I, + const Type *CalledValueTy, + unsigned CallingConv, + bool IsTailCall, SDOperand Callee, unsigned OpIdx) { - const PointerType *PT = cast(I.getCalledValue()->getType()); + const PointerType *PT = cast(CalledValueTy); const FunctionType *FTy = cast(PT->getElementType()); TargetLowering::ArgListTy Args; @@ -2267,7 +2276,7 @@ std::pair Result = TLI.LowerCallTo(getRoot(), I.getType(), FTy->paramHasAttr(0,FunctionType::SExtAttribute), -FTy->isVarArg(), I.getCallingConv(), I.isTailCall(), +FTy->isVarArg(), CallingConv, IsTailCall, Callee, Args, DAG); if (I.getType() != Type::VoidTy) setValue(&I, Result.first); @@ -2333,7 +2342,11 @@ else Callee = DAG.getExternalSymbol(RenameFn, TLI.getPointerTy()); - LowerCallTo(I, Callee, 1); + LowerCallTo(I, I.getCalledValue()->getType(), + I.getCallingConv(), + I.isTailCall(), + Callee, + 1); } ___ 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.212 -> 1.213 --- Log message: Handle cases when joining live intervals of two virtual registers. --- Diffs of the changes: (+17 -7) LiveIntervalAnalysis.cpp | 24 +--- 1 files changed, 17 insertions(+), 7 deletions(-) Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.212 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.213 --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.212 Thu Feb 22 17:03:39 2007 +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Fri Feb 23 14:40:13 2007 @@ -960,21 +960,31 @@ DOUT << "\n\t\tJoined. Result = "; DestInt.print(DOUT, mri_); DOUT << "\n"; - // If the intervals were swapped by Join, swap them back so that the register - // mapping (in the r2i map) is correct. - if (Swapped) SrcInt.swap(DestInt); - // Live range has been lengthened due to colaescing, eliminate the // unnecessary kills at the end of the source live ranges. - LiveVariables::VarInfo& vi = lv_->getVarInfo(repSrcReg); - for (unsigned i = 0, e = vi.Kills.size(); i != e; ++i) { -MachineInstr *Kill = vi.Kills[i]; + LiveVariables::VarInfo& svi = lv_->getVarInfo(repSrcReg); + for (unsigned i = 0, e = svi.Kills.size(); i != e; ++i) { +MachineInstr *Kill = svi.Kills[i]; if (Kill == CopyMI || isRemoved(Kill)) continue; if (DestInt.liveAt(getInstructionIndex(Kill) + InstrSlots::NUM)) unsetRegisterKill(Kill, repSrcReg); } + if (MRegisterInfo::isVirtualRegister(repDstReg)) { +// If both are virtual registers... +LiveVariables::VarInfo& dvi = lv_->getVarInfo(repDstReg); +for (unsigned i = 0, e = dvi.Kills.size(); i != e; ++i) { + MachineInstr *Kill = dvi.Kills[i]; + if (Kill == CopyMI || isRemoved(Kill)) +continue; + if (DestInt.liveAt(getInstructionIndex(Kill) + InstrSlots::NUM)) +unsetRegisterKill(Kill, repDstReg); +} + } + // If the intervals were swapped by Join, swap them back so that the register + // mapping (in the r2i map) is correct. + if (Swapped) SrcInt.swap(DestInt); removeInterval(repSrcReg); r2rMap_[repSrcReg] = repDstReg; ___ 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/vargs_align.ll
Changes in directory llvm/test/CodeGen/ARM: vargs_align.ll added (r1.1) --- Log message: Fix stack alignment in functions with varargs. --- Diffs of the changes: (+20 -0) vargs_align.ll | 20 1 files changed, 20 insertions(+) Index: llvm/test/CodeGen/ARM/vargs_align.ll diff -c /dev/null llvm/test/CodeGen/ARM/vargs_align.ll:1.1 *** /dev/null Fri Feb 23 14:33:07 2007 --- llvm/test/CodeGen/ARM/vargs_align.llFri Feb 23 14:32:57 2007 *** *** 0 --- 1,20 + ; RUN: llvm-as < %s | llc -march=arm && + ; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnueabi -disable-fp-elim | grep "add sp, sp, #16" && + ; RUN: llvm-as < %s | llc -march=arm -mtriple=arm-linux-gnu -disable-fp-elim | grep "add sp, sp, #12" + + define i32 @f(i32 %a, ...) { + entry: + %a_addr = alloca i32; [#uses=1] + %retval = alloca i32, align 4 ; [#uses=2] + %tmp = alloca i32, align 4 ; [#uses=2] + "alloca point" = bitcast i32 0 to i32 ; [#uses=0] + store i32 %a, i32* %a_addr + store i32 0, i32* %tmp + %tmp1 = load i32* %tmp ; [#uses=1] + store i32 %tmp1, i32* %retval + br label %return + + return: ; preds = %entry + %retval2 = load i32* %retval; [#uses=1] + ret i32 %retval2 + } ___ 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/PPCMachineFunctionInfo.h PPCRegisterInfo.cpp PPCRegisterInfo.h
Changes in directory llvm/lib/Target/PowerPC: PPCMachineFunctionInfo.h updated: 1.2 -> 1.3 PPCRegisterInfo.cpp updated: 1.110 -> 1.111 PPCRegisterInfo.h updated: 1.28 -> 1.29 --- Log message: Don't spill LR as a callee saved register. --- Diffs of the changes: (+19 -2) PPCMachineFunctionInfo.h |7 +++ PPCRegisterInfo.cpp | 13 +++-- PPCRegisterInfo.h|1 + 3 files changed, 19 insertions(+), 2 deletions(-) Index: llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h diff -u llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h:1.2 llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h:1.3 --- llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h:1.2Fri Nov 24 23:41:02 2006 +++ llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.hFri Feb 23 14:34:16 2007 @@ -26,6 +26,10 @@ /// stored. Also used as an anchor for instructions that need to be altered /// when using frame pointers (dyna_add, dyna_sub.) int FramePointerSaveIndex; + + /// UsesLR - Indicates whether LR is used in the current function. + /// + bool UsesLR; public: PPCFunctionInfo(MachineFunction& MF) @@ -34,6 +38,9 @@ int getFramePointerSaveIndex() const { return FramePointerSaveIndex; } void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; } + + void setUsesLR(bool U) { UsesLR = U; } + bool usesLR() { return UsesLR; } }; Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.110 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.111 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.110 Thu Feb 22 19:10:03 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Fri Feb 23 14:34:16 2007 @@ -439,8 +439,8 @@ /// usesLR - Returns if the link registers (LR) has been used in the function. /// bool PPCRegisterInfo::usesLR(MachineFunction &MF) const { - const bool *PhysRegsUsed = MF.getUsedPhysregs(); - return PhysRegsUsed[getRARegister()]; + PPCFunctionInfo *FI = MF.getInfo(); + return FI->usesLR(); } void PPCRegisterInfo:: @@ -774,6 +774,15 @@ MFI->setStackSize(FrameSize); } +void PPCRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF) + const { + // Save and clear the LR state. + PPCFunctionInfo *FI = MF.getInfo(); + unsigned LR = getRARegister(); + FI->setUsesLR(MF.isPhysRegUsed(LR)); + MF.changePhyRegUsed(LR, false); +} + void PPCRegisterInfo::emitPrologue(MachineFunction &MF) const { MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB MachineBasicBlock::iterator MBBI = MBB.begin(); Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.28 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.29 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.28 Wed Feb 21 16:54:50 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Fri Feb 23 14:34:16 2007 @@ -82,6 +82,7 @@ /// frame size. void determineFrameLayout(MachineFunction &MF) const; + void processFunctionBeforeCalleeSavedScan(MachineFunction &MF) const; void emitPrologue(MachineFunction &MF) const; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; ___ 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.16 -> 1.17 --- Log message: Fix stack alignment in functions with varargs. --- Diffs of the changes: (+5 -2) ARMISelLowering.cpp |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.16 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.17 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.16Thu Feb 22 08:56:36 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Fri Feb 23 14:32:57 2007 @@ -831,13 +831,16 @@ SSARegMap *RegMap = MF.getSSARegMap(); MachineFrameInfo *MFI = MF.getFrameInfo(); ARMFunctionInfo *AFI = MF.getInfo(); -unsigned VARegSaveSize = (4 - NumGPRs) * 4; +unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment(); +unsigned VARegSize = (4 - NumGPRs) * 4; +unsigned VARegSaveSize = (VARegSize + Align - 1) & ~(Align - 1); if (VARegSaveSize) { // If this function is vararg, store any remaining integer argument regs // to their spots on the stack so that they may be loaded by deferencing // the result of va_next. AFI->setVarArgsRegSaveSize(VARegSaveSize); - VarArgsFrameIndex = MFI->CreateFixedObject(VARegSaveSize, ArgOffset); + VarArgsFrameIndex = MFI->CreateFixedObject(VARegSaveSize, ArgOffset + + VARegSaveSize - VARegSize); SDOperand FIN = DAG.getFrameIndex(VarArgsFrameIndex, getPointerTy()); SmallVector MemOps; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [124233] Clear out the target builtin cache before reading a PCH file.
Revision: 124233 Author: bwendlin Date: 2007-02-23 12:14:43 -0800 (Fri, 23 Feb 2007) Log Message: --- Clear out the target builtin cache before reading a PCH file. Modified Paths: -- apple-local/branches/llvm/gcc/llvm-backend.cpp apple-local/branches/llvm/gcc/llvm-convert.cpp apple-local/branches/llvm/gcc/llvm-internal.h Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp === --- apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-23 19:54:33 UTC (rev 124232) +++ apple-local/branches/llvm/gcc/llvm-backend.cpp 2007-02-23 20:14:43 UTC (rev 124233) @@ -195,6 +195,7 @@ fclose (asm_out_file); std::string ErrMsg; + clearTargetBuiltinCache(); TheModule = ParseBytecodeFile(asm_file_name, Compressor::decompressToNewBuffer, &ErrMsg); Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp === --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-02-23 19:54:33 UTC (rev 124232) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-02-23 20:14:43 UTC (rev 124233) @@ -187,10 +187,10 @@ Constant *LLVMValuesNameTable = ConstantStruct::get(LLVMValuesNames, false); // Create variable to hold this string table. - GlobalVariable *GV = new GlobalVariable(LLVMValuesNameTable->getType(), true, - GlobalValue::ExternalLinkage, - LLVMValuesNameTable, - "llvm.pch.values", TheModule); + new GlobalVariable(LLVMValuesNameTable->getType(), true, + GlobalValue::ExternalLinkage, + LLVMValuesNameTable, + "llvm.pch.values", TheModule); } /// isGCC_SSA_Temporary - Return true if this is an SSA temporary that we can @@ -3454,7 +3454,14 @@ return false; } +/// TargetBuiltinCache - A cache of builtin intrisics indexed by the GCC builtin +/// number. +static std::vector TargetBuiltinCache; +void clearTargetBuiltinCache() { + TargetBuiltinCache.clear(); +} + /// EmitBuiltinCall - exp is a call to fndecl, a builtin function. Try to emit /// the call in a special way, setting Result to the scalar result if necessary. /// If we can't handle the builtin, return false, otherwise return true. @@ -3462,7 +3469,6 @@ Value *DestLoc, Value *&Result) { if (DECL_BUILT_IN_CLASS(fndecl) == BUILT_IN_MD) { unsigned FnCode = DECL_FUNCTION_CODE(fndecl); -static std::vector TargetBuiltinCache; if (TargetBuiltinCache.size() <= FnCode) TargetBuiltinCache.resize(FnCode+1); Modified: apple-local/branches/llvm/gcc/llvm-internal.h === --- apple-local/branches/llvm/gcc/llvm-internal.h 2007-02-23 19:54:33 UTC (rev 124232) +++ apple-local/branches/llvm/gcc/llvm-internal.h 2007-02-23 20:14:43 UTC (rev 124233) @@ -91,6 +91,7 @@ extern void writeLLVMTypesStringTable(); extern void readLLVMValuesStringTable(); extern void writeLLVMValuesStringTable(); +extern void clearTargetBuiltinCache(); struct StructTypeConversionInfo; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [124232] Stop the "buildit" if a "make" of LLVM fails.
Revision: 124232 Author: bwendlin Date: 2007-02-23 11:54:33 -0800 (Fri, 23 Feb 2007) Log Message: --- Stop the "buildit" if a "make" of LLVM fails. Modified Paths: -- apple-local/branches/llvm/build_gcc Modified: apple-local/branches/llvm/build_gcc === --- apple-local/branches/llvm/build_gcc 2007-02-23 11:08:39 UTC (rev 124231) +++ apple-local/branches/llvm/build_gcc 2007-02-23 19:54:33 UTC (rev 124232) @@ -197,6 +197,11 @@ make ENABLE_OPTIMIZED=1 UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \ OPTIMIZE_OPTION='-O2' \ CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" + + if ! test $? == 0 ; then + echo "error: LLVM 'make' failed!" + exit 1 + fi fi # APPLE LOCAL LLVM end @@ -564,6 +569,11 @@ ## Install the tree into the destination directory. make $MAKEFLAGS ENABLE_OPTIMIZED=1 UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install + if ! test $? == 0 ; then + echo "error: LLVM 'make install' failed!" + exit 1 + fi + ## Install Version.h if [ "x$LLVM_SUBMIT_SUBVERSION" = "x00" -o "x$LLVM_SUBMIT_SUBVERSION" = "x0" ]; then RC_ProjectSourceSubversion=0 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Utils/ValueMapper.cpp
Changes in directory llvm/lib/Transforms/Utils: ValueMapper.cpp updated: 1.30 -> 1.31 --- Log message: fix an obscure and tricky bug the inliner can hit sometimes. --- Diffs of the changes: (+1 -1) ValueMapper.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Utils/ValueMapper.cpp diff -u llvm/lib/Transforms/Utils/ValueMapper.cpp:1.30 llvm/lib/Transforms/Utils/ValueMapper.cpp:1.31 --- llvm/lib/Transforms/Utils/ValueMapper.cpp:1.30 Wed Feb 14 20:26:10 2007 +++ llvm/lib/Transforms/Utils/ValueMapper.cpp Fri Feb 23 13:54:30 2007 @@ -95,7 +95,7 @@ return VM[V] = ConstantVector::get(Values); } } - return VMSlot = C; + return VM[V] = C; } else { assert(0 && "Unknown type of constant!"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/test/Transforms/InstCombine/cast_ptr.ll
On Feb 22, 2007, at 8:28 AM, Andrew Lenharth wrote: > I won't get a chance to fix this before the nightly testers start. > Should I x-fail this until it is handled? I took care of this. The run line was wrong, so it didn't fail. Please add a fix to mainline when you can, Thanks! -Chris ___ 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/cast_ptr.ll
Changes in directory llvm/test/Transforms/InstCombine: cast_ptr.ll updated: 1.4 -> 1.5 --- Log message: fix this testcase --- Diffs of the changes: (+2 -1) cast_ptr.ll |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/test/Transforms/InstCombine/cast_ptr.ll diff -u llvm/test/Transforms/InstCombine/cast_ptr.ll:1.4 llvm/test/Transforms/InstCombine/cast_ptr.ll:1.5 --- llvm/test/Transforms/InstCombine/cast_ptr.ll:1.4Thu Feb 22 09:17:45 2007 +++ llvm/test/Transforms/InstCombine/cast_ptr.llFri Feb 23 13:39:24 2007 @@ -1,6 +1,7 @@ ; Tests to make sure elimination of casts is working correctly ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine -disable-output && -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep '\([sz]ext\)\|\(trunc\)|\(ptrtoint\)' +; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | notcast +; XFAIL: * target pointersize = 32 ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/runtime/GCCLibraries/crtend/Exception.cpp Exception.h Makefile README.txt SJLJ-Exception.cpp SJLJ-Exception.h comp_genericeh.lst comp_main.lst comp_sjljeh.lst crtend.c
Changes in directory llvm/runtime/GCCLibraries/crtend: Exception.cpp (r1.4) removed Exception.h (r1.12) removed Makefile (r1.36) removed README.txt (r1.4) removed SJLJ-Exception.cpp (r1.7) removed SJLJ-Exception.h (r1.7) removed comp_genericeh.lst (r1.3) removed comp_main.lst (r1.3) removed comp_sjljeh.lst (r1.3) removed crtend.c (r1.8) removed --- Log message: crtend is only for llvm-gcc3, remove it. --- 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/runtime/GCCLibraries/Makefile
Changes in directory llvm/runtime/GCCLibraries: Makefile updated: 1.10 -> 1.11 --- Log message: crtend is only for llvm-gcc3, remove it. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/runtime/GCCLibraries/Makefile diff -u llvm/runtime/GCCLibraries/Makefile:1.10 llvm/runtime/GCCLibraries/Makefile:1.11 --- llvm/runtime/GCCLibraries/Makefile:1.10 Thu Nov 16 21:32:33 2006 +++ llvm/runtime/GCCLibraries/Makefile Fri Feb 23 13:34:09 2007 @@ -8,5 +8,5 @@ ##===--===## LEVEL := ../.. -PARALLEL_DIRS := crtend libc libgcc libm +PARALLEL_DIRS := libc libgcc libm include $(LEVEL)/Makefile.common ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/LoopPass.cpp
Changes in directory llvm/lib/Analysis: LoopPass.cpp updated: 1.7 -> 1.8 --- Log message: Fix thinko. --- Diffs of the changes: (+2 -1) LoopPass.cpp |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm/lib/Analysis/LoopPass.cpp diff -u llvm/lib/Analysis/LoopPass.cpp:1.7 llvm/lib/Analysis/LoopPass.cpp:1.8 --- llvm/lib/Analysis/LoopPass.cpp:1.7 Fri Feb 23 11:53:17 2007 +++ llvm/lib/Analysis/LoopPass.cpp Fri Feb 23 12:05:55 2007 @@ -26,7 +26,8 @@ class LoopCompare { public: bool operator()( Loop *L1, Loop *L2) const { -return L1->getLoopDepth() > L2->getLoopDepth(); +// Loops with highest depth has the highest priority. +return L1->getLoopDepth() < L2->getLoopDepth(); } }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/LoopPass.cpp
Changes in directory llvm/lib/Analysis: LoopPass.cpp updated: 1.6 -> 1.7 --- Log message: Loop passes are set up to accept pointer. --- Diffs of the changes: (+1 -1) LoopPass.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Analysis/LoopPass.cpp diff -u llvm/lib/Analysis/LoopPass.cpp:1.6 llvm/lib/Analysis/LoopPass.cpp:1.7 --- llvm/lib/Analysis/LoopPass.cpp:1.6 Thu Feb 22 18:36:57 2007 +++ llvm/lib/Analysis/LoopPass.cpp Fri Feb 23 11:53:17 2007 @@ -116,7 +116,7 @@ StartPassTimer(P); LoopPass *LP = dynamic_cast(P); assert (LP && "Invalid LPPassManager member"); - LP->runOnLoop(*L, *this); + LP->runOnLoop(L, *this); StopPassTimer(P); if (Changed) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Analysis/LoopPass.h
Changes in directory llvm/include/llvm/Analysis: LoopPass.h updated: 1.5 -> 1.6 --- Log message: Loop passes are set up to accept pointer. --- Diffs of the changes: (+1 -1) LoopPass.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/include/llvm/Analysis/LoopPass.h diff -u llvm/include/llvm/Analysis/LoopPass.h:1.5 llvm/include/llvm/Analysis/LoopPass.h:1.6 --- llvm/include/llvm/Analysis/LoopPass.h:1.5 Thu Feb 22 18:36:57 2007 +++ llvm/include/llvm/Analysis/LoopPass.h Fri Feb 23 11:53:16 2007 @@ -32,7 +32,7 @@ public: // runOnLoop - THis method should be implemented by the subclass to perform // whatever action is necessary for the specfied Loop. - virtual bool runOnLoop (Loop &L, LPPassManager &LPM) = 0; + virtual bool runOnLoop (Loop *L, LPPassManager &LPM) = 0; virtual bool runOnFunctionBody (Function &F, LPPassManager &LPM) { return false; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [see] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.536.2.1.2.1 -> 1.536.2.1.2.2 --- Log message: remove debug output --- Diffs of the changes: (+1 -3) InstructionCombining.cpp |4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.536.2.1.2.1 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.536.2.1.2.2 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.536.2.1.2.1 Thu Feb 22 09:11:27 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Feb 23 11:24:11 2007 @@ -4846,10 +4846,8 @@ TD->getTypeSize(Op1->getType()) >= TD->getTypeSize(CastOp1->getType()) && (CastOp1->getType()->isInteger() || isa(CastOp1->getType())) && (Op1->getType()->isInteger() || isa(Op1->getType())) - ) { -std::cerr << "Triggered\n"; + ) return BinaryOperator::create(I.getOpcode(), CastOp0, CastOp1); - } } // Handle the special case of: setcc (cast bool to X), ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/RegisterScavenging.cpp
Changes in directory llvm/lib/CodeGen: RegisterScavenging.cpp updated: 1.1 -> 1.2 --- Log message: Mark livein registers as being in used. --- Diffs of the changes: (+6 -0) RegisterScavenging.cpp |6 ++ 1 files changed, 6 insertions(+) Index: llvm/lib/CodeGen/RegisterScavenging.cpp diff -u llvm/lib/CodeGen/RegisterScavenging.cpp:1.1 llvm/lib/CodeGen/RegisterScavenging.cpp:1.2 --- llvm/lib/CodeGen/RegisterScavenging.cpp:1.1 Thu Feb 22 19:01:19 2007 +++ llvm/lib/CodeGen/RegisterScavenging.cpp Fri Feb 23 02:41:19 2007 @@ -43,6 +43,12 @@ if (CSRegs != NULL) for (unsigned i = 0; CSRegs[i]; ++i) CalleeSavedRegs.set(CSRegs[i]); + + // Live-in registers are in use. + if (!MBB->livein_empty()) +for (MachineBasicBlock::const_livein_iterator I = MBB->livein_begin(), + E = MBB->livein_end(); I != E; ++I) + setUsed(*I); } void RegScavenger::forward() { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits