Add a comment to explain a folding transform.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-03-26 20:09:02 +00:00
parent 21e289b5c2
commit 4ada00d166

View 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));