setcc (csel 0, 1, cond, X), 1, ne ==> csel 0, 1, !cond, X
Where X is a condition code setting instruction.
Co-authored-by: Paul Walker <paul.walker@arm.com>
Paths
| Differential D103256
[AArch64] Remove SETCC of CSEL when the latter's condition can be inverted ClosedPublic Authored by bsmith on May 27 2021, 8:02 AM.
Details Summary setcc (csel 0, 1, cond, X), 1, ne ==> csel 0, 1, !cond, X Where X is a condition code setting instruction. Co-authored-by: Paul Walker <paul.walker@arm.com>
Diff Detail
Event TimelineHerald added subscribers: danielkiss, hiraditya, kristof.beyls. · View Herald TranscriptMay 27 2021, 8:02 AM Comment Actions LGTM, one small suggestion.
This revision is now accepted and ready to land.Jun 3 2021, 8:09 AM Comment Actions Apologies @bsmith, ignore my last comment. The pattern matching stuff is only for IR -- I had mistakenly thought that it could be used in this context, but it can't. Sorry! 😅 This revision was landed with ongoing or failed builds.Jun 4 2021, 8:01 AM Closed by commit rGa85f5874e2a4: [AArch64] Remove SETCC of CSEL when the latter's condition can be inverted (authored by bsmith). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 349879 llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/sve-setcc.ll
|
Untested, but you might be able to simplify this a little bit with LLVM's pattern matching functionality. See: https://llvm.org/doxygen/PatternMatch_8h_source.html.
It might not work, though. If not I'm fine with this. 😄