[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Aug 11 00:35:12 PDT 2004



Changes in directory llvm/lib/Target/PowerPC:

PPC32ISelSimple.cpp updated: 1.58 -> 1.59
---
Log message:

Fix a case where constantexprs could leak into the PPC isel.


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

Index: llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.58 llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.59
--- llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp:1.58	Tue Aug 10 22:30:55 2004
+++ llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp	Wed Aug 11 02:34:50 2004
@@ -1260,7 +1260,10 @@
   if (Val) {
     if (Constant *C = dyn_cast<Constant>(Val)) {
       Val = ConstantExpr::getCast(C, Type::IntTy);
-      Ty = Type::IntTy;
+      if (isa<ConstantExpr>(Val))   // Could not fold
+        Val = C;
+      else
+        Ty = Type::IntTy;           // Folded!
     }
 
     // If this is a simple constant, just emit a load directly to avoid the copy






More information about the llvm-commits mailing list