Similar to what SDAG does when it sees a smulo/umulo against 2 (see: DAGCombiner::visitMULO)
This pattern is fairly common in Swift code AFAICT.
Here's an example extracted from a Swift testcase:
Paths
| Differential D110662
[GlobalISel] Combine mulo x, 2 -> addo x, x ClosedPublic Authored by paquette on Sep 28 2021, 3:09 PM.
Details Summary Similar to what SDAG does when it sees a smulo/umulo against 2 (see: DAGCombiner::visitMULO) This pattern is fairly common in Swift code AFAICT. Here's an example extracted from a Swift testcase:
Diff Detail
Event TimelineHerald added subscribers: steven.zhang, hiraditya, rovka. · View Herald TranscriptSep 28 2021, 3:09 PM This revision is now accepted and ready to land.Sep 28 2021, 4:42 PM This revision was landed with ongoing or failed builds.Sep 28 2021, 5:00 PM Closed by commit rG15a24e1fdbc4: [GlobalISel] Combine mulo x, 2 -> addo x, x (authored by paquette). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 375742 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-mulo-with-2.mir
|