[llvm-commits] CVS: llvm/lib/Transforms/IPO/GlobalOpt.cpp

Chris Lattner sabre at nondot.org
Thu Nov 30 09:26:22 PST 2006



Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.73 -> 1.74
---
Log message:

Fix a bug in globalopt due to the recent cast patch.


---
Diffs of the changes:  (+2 -1)

 GlobalOpt.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.73 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.74
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.73	Sun Nov 26 19:05:10 2006
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Thu Nov 30 11:26:08 2006
@@ -1713,7 +1713,8 @@
                                      getVal(Values, SI->getOperand(0)),
                                      getVal(Values, SI->getOperand(1)));
     } else if (CastInst *CI = dyn_cast<CastInst>(CurInst)) {
-      InstResult = ConstantExpr::getCast(getVal(Values, CI->getOperand(0)),
+      InstResult = ConstantExpr::getCast(CI->getOpcode(),
+                                         getVal(Values, CI->getOperand(0)),
                                          CI->getType());
     } else if (SelectInst *SI = dyn_cast<SelectInst>(CurInst)) {
       InstResult = ConstantExpr::getSelect(getVal(Values, SI->getOperand(0)),






More information about the llvm-commits mailing list