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

Reid Spencer reid at x10sys.com
Tue Dec 12 15:36:36 PST 2006



Changes in directory llvm/lib/Transforms/IPO:

GlobalOpt.cpp updated: 1.78 -> 1.79
---
Log message:

Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.


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

 GlobalOpt.cpp |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.78 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.79
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.78	Wed Dec  6 19:30:31 2006
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Tue Dec 12 17:36:14 2006
@@ -708,8 +708,8 @@
 
   Constant *RepValue = NewGV;
   if (NewGV->getType() != GV->getType()->getElementType())
-    RepValue = ConstantExpr::getCast(Instruction::BitCast,
-                                     RepValue, GV->getType()->getElementType());
+    RepValue = ConstantExpr::getBitCast(RepValue, 
+                                        GV->getType()->getElementType());
 
   // If there is a comparison against null, we will insert a global bool to
   // keep track of whether the global was initialized yet or not.
@@ -1058,8 +1058,7 @@
       GV->getInitializer()->isNullValue()) {
     if (Constant *SOVC = dyn_cast<Constant>(StoredOnceVal)) {
       if (GV->getInitializer()->getType() != SOVC->getType())
-        SOVC = ConstantExpr::getCast(Instruction::BitCast,
-                                     SOVC, GV->getInitializer()->getType());
+        SOVC = ConstantExpr::getBitCast(SOVC, GV->getInitializer()->getType());
 
       // Optimize away any trapping uses of the loaded value.
       if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC))
@@ -1510,7 +1509,7 @@
   if (!GCL->use_empty()) {
     Constant *V = NGV;
     if (V->getType() != GCL->getType())
-      V = ConstantExpr::getCast(Instruction::BitCast, V, GCL->getType());
+      V = ConstantExpr::getBitCast(V, GCL->getType());
     GCL->replaceAllUsesWith(V);
   }
   GCL->eraseFromParent();






More information about the llvm-commits mailing list