Constant-fold a generic integer binary opcode on two register operands.
Declared in <llvm/CodeGen/GlobalISel/Utils.h>
std::optional<APInt>
ConstantFoldBinOp(
unsigned int Opcode,
Register const Op1,
Register const Op2,
MachineRegisterInfo const& MRI);
The folded APInt, or std::nullopt on failure.
| Name | Description |
|---|---|
| Opcode | Generic integer binary opcode to fold. |
| Op1 | First operand register. |
| Op2 | Second operand register. |
| MRI | Register information for the function. |