[llvm] [ConstantFold][RFC] Refactor getBinOpAbsorber function (PR #109736)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 19:12:30 PDT 2024


================
@@ -729,13 +729,15 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1,
   // Neither constant should be UndefValue, unless these are vector constants.
   assert((!HasScalarUndefOrScalableVectorUndef) && "Unexpected UndefValue");
 
+  Constant *Absorber = ConstantExpr::getBinOpAbsorber(
+      Opcode, C1->getType(), /*AllowLHSAbsorber*/ true);
----------------
eric-xtang1008 wrote:

Okay.

https://github.com/llvm/llvm-project/pull/109736


More information about the llvm-commits mailing list