[llvm-commits] CVS: llvm/lib/Transforms/LevelRaise.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Feb 8 18:22:01 PST 2004
Changes in directory llvm/lib/Transforms:
LevelRaise.cpp updated: 1.93 -> 1.94
---
Log message:
The ConstantExpr::getCast call can cause a CPR to be generated. If so,
strip it off.
---
Diffs of the changes: (+4 -0)
Index: llvm/lib/Transforms/LevelRaise.cpp
diff -u llvm/lib/Transforms/LevelRaise.cpp:1.93 llvm/lib/Transforms/LevelRaise.cpp:1.94
--- llvm/lib/Transforms/LevelRaise.cpp:1.93 Mon Jan 12 12:12:44 2004
+++ llvm/lib/Transforms/LevelRaise.cpp Sun Feb 8 18:20:55 2004
@@ -539,6 +539,10 @@
NewCast = new CastInst(CI->getCalledValue(), NewPFunTy,
CI->getCalledValue()->getName()+"_c",CI);
+ // Strip off unneeded CPR's.
+ if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(NewCast))
+ NewCast = CPR->getValue();
+
// Create a new call instruction...
CallInst *NewCall = new CallInst(NewCast,
std::vector<Value*>(CI->op_begin()+1, CI->op_end()));
More information about the llvm-commits
mailing list