Feedback from chris
authorNate Begeman <natebegeman@mac.com>
Fri, 25 Apr 2008 17:45:52 +0000 (17:45 +0000)
committerNate Begeman <natebegeman@mac.com>
Fri, 25 Apr 2008 17:45:52 +0000 (17:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50271 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/CloneFunction.cpp

index 54c6a809da3fee9e8b85f241753c0ecceab9b4d4..57369143b451bf0850c64c815cd072bd5de7d083 100644 (file)
@@ -307,8 +307,8 @@ ConstantFoldMappedInstruction(const Instruction *I) {
     return ConstantFoldCompareInstOperands(CI->getPredicate(),
                                            &Ops[0], Ops.size(), TD);
 
-  if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
-    if (const LoadInst *LI = dyn_cast<LoadInst>(I))
+  if (const LoadInst *LI = dyn_cast<LoadInst>(I))
+    if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Ops[0]))
       if (!LI->isVolatile() && CE->getOpcode() == Instruction::GetElementPtr)
         if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
           if (GV->isConstant() && !GV->isDeclaration())