[SCEVExpander] Avoid ConstantExpr::get() (NFCI)
Use ConstantFoldBinaryOpOperands() instead. This will be important when not all binops have constant expression variants.
This commit is contained in:
parent
3912928aa8
commit
32a76fc292
|
@ -220,7 +220,8 @@ Value *SCEVExpander::InsertBinop(Instruction::BinaryOps Opcode,
|
|||
// Fold a binop with constant operands.
|
||||
if (Constant *CLHS = dyn_cast<Constant>(LHS))
|
||||
if (Constant *CRHS = dyn_cast<Constant>(RHS))
|
||||
return ConstantExpr::get(Opcode, CLHS, CRHS);
|
||||
if (Constant *Res = ConstantFoldBinaryOpOperands(Opcode, CLHS, CRHS, DL))
|
||||
return Res;
|
||||
|
||||
// Do a quick scan to see if we have this binop nearby. If so, reuse it.
|
||||
unsigned ScanLimit = 6;
|
||||
|
|
Loading…
Reference in a new issue