This is a straight port from the equivalent DAG combine.
For AMDGPU, since it doesn't support legalizing G_MULH for s64 element vectors I've added an abort to the run line to get it to pass.
Paths
| Differential D110890
[GlobalISel] Port the udiv -> mul by constant combine. ClosedPublic Authored by aemerson on Sep 30 2021, 4:02 PM.
Details Summary This is a straight port from the equivalent DAG combine. For AMDGPU, since it doesn't support legalizing G_MULH for s64 element vectors I've added an abort to the run line to get it to pass.
Diff Detail
Event TimelineHerald added subscribers: kerbowa, hiraditya, tpr and 3 others. · View Herald TranscriptSep 30 2021, 4:02 PM Comment Actions
aemerson added a child revision: D111036: [GlobalISel] Combine G_UMULH x, (1 << c)) -> x >> (bitwidth - c).Oct 3 2021, 11:08 PM
Comment Actions
That didn't work, but D111129 should fix it instead. Comment Actions Personally I think this is probably good to go? @foad, does this look good on the AMDGPU end? This revision is now accepted and ready to land.Oct 5 2021, 4:59 PM
This revision was landed with ongoing or failed builds.Oct 7 2021, 11:37 AM Closed by commit rG8bfc0e06dc85: [GlobalISel] Port the udiv -> mul by constant combine. (authored by aemerson). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 377927 llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/CodeGen/GlobalISel/Utils.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/CodeGen/GlobalISel/Utils.cpp
llvm/test/CodeGen/AArch64/GlobalISel/combine-udiv.ll
llvm/test/CodeGen/AArch64/GlobalISel/combine-udiv.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i32.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/udiv.i64.ll
|
could use a doxygen comment?