[PATCH] D45537: [CodeGenPrepare] Move Extension Instructions Through Logical And Shift Instructions
Guozhi Wei via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 25 14:29:09 PDT 2018
Carrot added inline comments.
================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:3369
+ Inst->getOpcode() == Instruction::Or) &&
+ isa<ConstantInt>(Inst->getOperand(1)))
+ return true;
----------------
qcolombet wrote:
> Do we need to restrict this to constants?
It is same as DAGCombiner::visitZERO_EXTEND. Extension of constant doesn't cause extra cost at run time, it makes sure moving extension across this instruction doesn't bring another extension on the other operand. Only in rare case the extension on the other operand can also be combined with another load.
https://reviews.llvm.org/D45537
More information about the llvm-commits
mailing list