mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
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:
@@ -554,6 +554,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
|
|||||||
if (C2->isNullValue()) return const_cast<Constant*>(C1); // X ^ 0 == X
|
if (C2->isNullValue()) return const_cast<Constant*>(C1); // X ^ 0 == X
|
||||||
break;
|
break;
|
||||||
case Instruction::AShr:
|
case Instruction::AShr:
|
||||||
|
// ashr (zext C to Ty), C2 -> lshr (zext C, CSA), C2
|
||||||
if (CE1->getOpcode() == Instruction::ZExt) // Top bits known zero.
|
if (CE1->getOpcode() == Instruction::ZExt) // Top bits known zero.
|
||||||
return ConstantExpr::getLShr(const_cast<Constant*>(C1),
|
return ConstantExpr::getLShr(const_cast<Constant*>(C1),
|
||||||
const_cast<Constant*>(C2));
|
const_cast<Constant*>(C2));
|
||||||
|
Reference in New Issue
Block a user