This patch slove TODO left in div.ll.
By adding a parameter to function FoldOpIntoSelect, we can fold more Ops to Select.
For this example, we tend to fold the division instruction, so we no longer care whether SelectInst is one use.
Paths
| Differential D122967
[InstCombine] fold more constant divisor to select-of-constants divisor ClosedPublic Authored by Chenbing.Zheng on Apr 1 2022, 11:45 PM.
Details Summary This patch slove TODO left in div.ll. By adding a parameter to function FoldOpIntoSelect, we can fold more Ops to Select.
Diff Detail
Event Timeline
Chenbing.Zheng added inline comments.
This revision is now accepted and ready to land.Apr 7 2022, 3:51 AM This revision was landed with ongoing or failed builds.Apr 7 2022, 7:24 PM Closed by commit rG467cbb6249df: [InstCombine] fold more constant divisor to select-of-constants divisor (authored by Chenbing.Zheng). · Explain Why This revision was automatically updated to reflect the committed changes. Chenbing.Zheng marked an inline comment as done.
Revision Contents
Diff 421388 llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/div.ll
|
'Tend' sounds odd to me - maybe something like 'FoldWithMultiUse' to be more descriptive?