[SPARC] Lower SELECT_CC to MOVr on 64-bit target whenever possible
authorKoakuma <koachan@protonmail.com>
Wed, 7 Dec 2022 20:31:31 +0000 (15:31 -0500)
committerBrad Smith <brad@comstyle.com>
Wed, 7 Dec 2022 20:34:58 +0000 (15:34 -0500)
commitf8f41c3fcd77829b8a4f10190699adb8b6451f56
tree6a929104e727c260279bd83a389f525d3da57abe
parent7ec057ff4a0662fea834af607b48d39b490c0aa0
[SPARC] Lower SELECT_CC to MOVr on 64-bit target whenever possible

On 64-bit target, when doing i64 SELECT_CC where one of the comparison operands
is a constant zero, try to fold the compare and MOVcc into a MOVr instruction.

For all integers, EQ and NE comparison are available, additionally for signed
integers, GT, GE, LT, and LE is also available.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D138922
14 files changed:
llvm/lib/Target/Sparc/MCTargetDesc/SparcInstPrinter.cpp
llvm/lib/Target/Sparc/Sparc.h
llvm/lib/Target/Sparc/SparcISelLowering.cpp
llvm/lib/Target/Sparc/SparcISelLowering.h
llvm/lib/Target/Sparc/SparcInstr64Bit.td
llvm/lib/Target/Sparc/SparcInstrAliases.td
llvm/lib/Target/Sparc/SparcInstrFormats.td
llvm/lib/Target/Sparc/SparcInstrInfo.cpp
llvm/lib/Target/Sparc/SparcInstrInfo.td
llvm/test/CodeGen/SPARC/64bit.ll
llvm/test/CodeGen/SPARC/64cond.ll
llvm/test/CodeGen/SPARC/smulo-128-legalisation-lowering.ll
llvm/test/CodeGen/SPARC/umulo-128-legalisation-lowering.ll
llvm/test/MC/Sparc/sparc64-ctrl-instructions.s