(xor/sub N-1, Y) -> (not Y) is minorly preferable (especially for
(sub N-1, Y) where it saves an instruction), but isn't worth
potentially creating an extra instruction for.
So, only do the transformation if (xor/sub N-1, Y) has one use.
Paths
| Differential D144985
[X86] Make `(shift X (xor/sub N-1, Y))` -> `(shift X, (not Y))` check for one use. ClosedPublic Authored by goldstein.w.n on Feb 28 2023, 10:09 AM.
Details Summary (xor/sub N-1, Y) -> (not Y) is minorly preferable (especially for So, only do the transformation if (xor/sub N-1, Y) has one use.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Feb 28 2023, 10:31 AM This revision was landed with ongoing or failed builds.Feb 28 2023, 9:25 PM Closed by commit rG05ca9ebc0433: [X86] Make `(shift X (xor/sub N-1, Y))` -> `(shift X, (not Y))` check for one… (authored by goldstein.w.n). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 501370 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/pr61038.ll |
You might be able to get away with a common CHECK-X64-BMI2 to replace the SKX and V4 prefixes