[PATCH] D142461: [SPARC] Lower BR_CC to BPr on 64-bit target whenever possible

Koakuma via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 05:34:46 PST 2023


koakuma created this revision.
koakuma added reviewers: jrtc27, dcederman, brad, ro, arsenm, MaskRay.
Herald added subscribers: fedor.sergeev, hiraditya, jyknight.
Herald added a project: All.
koakuma requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

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

      

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

Depends on D142458 <https://reviews.llvm.org/D142458>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142461

Files:
  llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
  llvm/lib/Target/Sparc/MCTargetDesc/SparcInstPrinter.cpp
  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/branches-relax.ll
  llvm/test/CodeGen/SPARC/branches-v9.ll
  llvm/test/CodeGen/SPARC/missinglabel.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142461.491730.patch
Type: text/x-patch
Size: 20726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230124/20cb870d/attachment.bin>


More information about the llvm-commits mailing list