[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
================
@@ -1210,8 +1210,11 @@ class ConstantExpr : public Constant {
/// Return the absorbing element for the given binary
/// operation, i.e. a constant C such that X op C = C and C op X = C for
/// every X. For example, this returns zero for integer multiplication.
- /// It returns null if the operator doesn't have an absorbing element.
- static Constant *getBinOpAbsorber(unsigned Opcode, Type *Ty);
+ /// If AllowLHSConstant is true, operand 1 is a constant C that must be
----------------
nikic wrote:
```suggestion
/// If AllowLHSConstant is true, the LHS operand is a constant C that must be
```
It's not clear what "operand 1" means here (because we often use operands 0 and 1 rather than 1 and 2).
https://github.com/llvm/llvm-project/pull/109736
More information about the llvm-commits
mailing list