This matches patterns of the form
(X op Y) == X
And transforms them to
Y == 0
where appropriate.
Example: https://godbolt.org/z/hfW811c7W
Paths
| Differential D135380
[GlobalISel] Combine (X op Y) == X --> Y == 0 ClosedPublic Authored by paquette on Oct 6 2022, 11:13 AM.
Details
Summary This matches patterns of the form (X op Y) == X And transforms them to Y == 0 where appropriate. Example: https://godbolt.org/z/hfW811c7W
Diff Detail
Event Timelinepaquette added a parent revision: D135378: [GlobalISel] Add a m_SpecificReg matcher.Oct 6 2022, 11:13 AM
paquette edited parent revisions, added: D135415: [GlobalISel] Add commutative matchers for compares.; removed: D135378: [GlobalISel] Add a m_SpecificReg matcher.Oct 6 2022, 5:24 PM
This revision is now accepted and ready to land.Oct 7 2022, 9:54 PM This revision was landed with ongoing or failed builds.Oct 11 2022, 9:53 AM Closed by commit rG036a13065b7a: [GlobalISel] Combine (X op Y) == X --> Y == 0 (authored by paquette). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 466845 llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/combine-icmp-of-binop-to-icmp-of-0.mir
|
Can you really get away without checking the mi_match result?