diff options
author | Chris Lattner <sabre@nondot.org> | 2001-11-06 08:34:29 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-11-06 08:34:29 +0000 |
commit | e34443db3c428c6b504d5689d85213ff3fb24bef (patch) | |
tree | c152461375e849136a00d6a23f70825b57e15ca6 /lib/Transforms | |
parent | 71344bd650b2ee95647fc84e9e0d08603f544f98 (diff) | |
download | external_llvm-e34443db3c428c6b504d5689d85213ff3fb24bef.tar.gz external_llvm-e34443db3c428c6b504d5689d85213ff3fb24bef.tar.bz2 external_llvm-e34443db3c428c6b504d5689d85213ff3fb24bef.zip |
Fix bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/LevelRaise.cpp | 4 | ||||
-rw-r--r-- | lib/Transforms/TransformInternals.h | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/Transforms/LevelRaise.cpp b/lib/Transforms/LevelRaise.cpp index a40d865fa6..13140b4ea8 100644 --- a/lib/Transforms/LevelRaise.cpp +++ b/lib/Transforms/LevelRaise.cpp @@ -375,11 +375,13 @@ static bool PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { if (RetValConvertableToType(CI, Src->getType(), ConvertedTypes)) { PRINT_PEEPHOLE2("CAST-DEST-EXPR-CONV:in ", CI, Src); + //cerr << "\nCONVERTING EXPR TYPE:\n"; ValueMapCache ValueMap; ConvertUsersType(CI, Src, ValueMap); // This will delete CI! BI = BB->begin(); // Rescan basic block. BI might be invalidated. - PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", I); + PRINT_PEEPHOLE1("CAST-DEST-EXPR-CONV:out", Src); + //cerr << "DONE CONVERTING EXPR TYPE: ";// << BB->getParent(); return true; } } diff --git a/lib/Transforms/TransformInternals.h b/lib/Transforms/TransformInternals.h index 5c753c506c..94af20099e 100644 --- a/lib/Transforms/TransformInternals.h +++ b/lib/Transforms/TransformInternals.h @@ -29,6 +29,14 @@ extern const TargetData TD; bool losslessCastableTypes(const Type *T1, const Type *T2); +// isFirstClassType - Return true if a value of the specified type can be held +// in a register. +// +static inline bool isFirstClassType(const Type *Ty) { + return Ty->isPrimitiveType() || Ty->isPointerType(); +} + + // ReplaceInstWithValue - Replace all uses of an instruction (specified by BI) // with a value, then remove and delete the original instruction. // @@ -51,7 +59,7 @@ struct ValueMapCache { // Operands mapped - Contains an entry if the first value (the user) has had // the second value (the operand) mapped already. // - set<pair<const User*, const Value*> > OperandsMapped; + set<const User*> OperandsMapped; // Expression Map - Contains an entry from the old value to the new value of // an expression that has been converted over. @@ -75,10 +83,7 @@ void ConvertUsersType(Value *V, Value *NewVal, ValueMapCache &VMC); class ValueHandle : public Instruction { ValueHandle(const ValueHandle &); // DO NOT IMPLEMENT public: - ValueHandle(Value *V) : Instruction(Type::VoidTy, UserOp1, "") { - Operands.push_back(Use(V, this)); - } - + ValueHandle(Value *V); ~ValueHandle(); virtual Instruction *clone() const { abort(); return 0; } |