[llvm] [GlobalIsel] Combine G_ADD and G_SUB with constants (PR #97771)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 10:45:40 PDT 2024
tschuett wrote:
I found
https://github.com/llvm/llvm-project/blob/dac9042cc6a4dcb23e85b13232e2b233d55eda57/llvm/lib/CodeGen/GlobalISel/Utils.cpp#L405
which is also fallible and in an anonymous namespace.
The other option is to change the signature of the match functions:
```
bool CombinerHelper::matchFoldAPlusC1MinusC2(const MachineInstr &MI, const MachineInstr &C1, const MachineInstr &C2,
BuildFnTy &MatchInfo) {
```
with the implication that C1 and C2 are G_CONSTANTs. I don't like because it is too low-level.
https://github.com/llvm/llvm-project/pull/97771
More information about the llvm-commits
mailing list