trunc (sign_ext_inreg X, iM) to iN --> sign_ext_inreg (trunc X to iN), iM
There are improvements on existing tests from this, and there are a pair of large regressions in D127115 for Thumb2 caused by not folding this pattern.
Paths
| Differential D129890
[SDAG] narrow truncated sign_extend_inreg ClosedPublic Authored by spatel on Jul 15 2022, 11:56 AM.
Details Summary trunc (sign_ext_inreg X, iM) to iN --> sign_ext_inreg (trunc X to iN), iM There are improvements on existing tests from this, and there are a pair of large regressions in D127115 for Thumb2 caused by not folding this pattern.
Diff Detail
Unit TestsFailed Event Timelinespatel retitled this revision from [SDAG] reduce cast ops around sign_extend_inreg to [SDAG] narrow truncated sign_extend_inreg. Comment ActionsPatch updated: Herald added subscribers: jsji, kosarev, kerbowa and 3 others. · View Herald TranscriptJul 16 2022, 6:31 AM arsenm added inline comments. This revision is now accepted and ready to land.Jul 16 2022, 6:33 AM spatel added inline comments.
This revision was landed with ongoing or failed builds.Jul 16 2022, 1:29 PM Closed by commit rG7ca3e23f250d: [SDAG] narrow truncated sign_extend_inreg (authored by spatel). · Explain Why This revision was automatically updated to reflect the committed changes. spatel marked 2 inline comments as done.
Revision Contents
Diff 445231 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AMDGPU/mul_int24.ll
llvm/test/CodeGen/X86/pmulh.ll
llvm/test/CodeGen/X86/sar_fold64.ll
|
Shouldn't really require legal types, but the DAG is lacking in adequate legality checks for sext_inreg