Add a comment to explain a folding transform.
authorReid Spencer <rspencer@reidspencer.com>
Mon, 26 Mar 2007 20:09:02 +0000 (20:09 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 26 Mar 2007 20:09:02 +0000 (20:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35360 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/ConstantFold.cpp

index 46263060e5767a1811d6162fa93d6f71dcd6fa46..ed69814383d0dd468b576e9c8ef578a5d6bd2afb 100644 (file)
@@ -554,6 +554,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
         if (C2->isNullValue()) return const_cast<Constant*>(C1);  // X ^ 0 == X
         break;
       case Instruction::AShr:
+        // ashr (zext C to Ty), C2 -> lshr (zext C, CSA), C2
         if (CE1->getOpcode() == Instruction::ZExt)  // Top bits known zero.
           return ConstantExpr::getLShr(const_cast<Constant*>(C1),
                                        const_cast<Constant*>(C2));