Do "simplifyShift" and "FoldConstantArithmetic" folds for the SSHLSAT
and USHLSAT DAG nodes.
This for example include folds such as:
(shlsat 0, x) -> 0 (shlsat x, 0) -> x (shlsat c1, c2) -> c3
Paths
| Differential D118603
[DAGCombine] Add simple folds for SSHLSAT/USHLSAT ClosedPublic Authored by bjope on Jan 31 2022, 5:42 AM.
Details
Summary Do "simplifyShift" and "FoldConstantArithmetic" folds for the SSHLSAT This for example include folds such as: (shlsat 0, x) -> 0 (shlsat x, 0) -> x (shlsat c1, c2) -> c3
Diff Detail
Event Timeline
Comment Actions Added test cases for undef/poison/out-of-bounds-shamt: (shlsat undef/poison, x) -> 0 (shlsat x, undef/poison) -> undef (shlsat x, too_large_shamt) -> undef Comment Actions LGTM - please can you pre-commit the tests and then rebase so that the patch commit shows the codegen diffs This revision is now accepted and ready to land.Jan 31 2022, 1:41 PM This revision was landed with ongoing or failed builds.Feb 1 2022, 1:52 AM Closed by commit rG38858790467e: [DAGCombine] Add simple folds for SSHLSAT/USHLSAT (authored by bjope). · Explain Why This revision was automatically updated to reflect the committed changes. Comment Actions
Ok, thanks! I did pre-committ the tests before landing.
Revision Contents
Diff 404841 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/CodeGen/AArch64/sshl_sat.ll
llvm/test/CodeGen/AArch64/ushl_sat.ll
|
Do you have any test coverage for undef/poison/outofrangeamt operands - that's mainly what simplifyShift handles?