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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 06:10:00 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);
----------------
nikic wrote:

```suggestion
      Opcode, C1->getType(), /*AllowLHSConstant*/ true);
```
To match the parameter name.

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


More information about the llvm-commits mailing list