Add udiv and urem instructions to the DAG post-dominated by trunc,
allowing TruncInstCombine to reduce bitwidth of expressions containing these
instructions. It is sufficient to require that all truncated bits of both
operands are zeros: https://alive2.llvm.org/ce/z/yiithn
(urem case is identical).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems reasonable.
llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp | ||
---|---|---|
152 | sdiv, srem; see b289dc530632613edb3eb067895c1981cb77ccd0. | |
315–324 |
LG, thanks.
llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp | ||
---|---|---|
318–319 | Hm, if you swap arguments around, does it lead to better clang-format? |
llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp | ||
---|---|---|
152 | Hi @lebedev.ri, @spatel , according to this patch rGb289dc530632, sdiv/srem (as well as udiv/urem) instrs are guarded with trunc/ext wherever it's possible. So it looks like support them here in AIC is redundant as we get always MinBitWidth == OrigBitWidth after correlated value propagation. |
sdiv, srem; see b289dc530632613edb3eb067895c1981cb77ccd0.