Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 22abcbc

Browse files
committed
[RISCV] Remove overzealous is64Bit checks
lowerGlobalAddress, lowerBlockAddress, and insertIndirectBranch contain overzealous checks for is64Bit. These functions are all safe as-implemented for RV64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343781 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent e3c126f commit 22abcbc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/Target/RISCV/RISCVISelLowering.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ SDValue RISCVTargetLowering::lowerGlobalAddress(SDValue Op,
327327
int64_t Offset = N->getOffset();
328328
MVT XLenVT = Subtarget.getXLenVT();
329329

330-
if (isPositionIndependent() || Subtarget.is64Bit())
330+
if (isPositionIndependent())
331331
report_fatal_error("Unable to lowerGlobalAddress");
332332
// In order to maximise the opportunity for common subexpression elimination,
333333
// emit a separate ADD node for the global address offset instead of folding
@@ -352,7 +352,7 @@ SDValue RISCVTargetLowering::lowerBlockAddress(SDValue Op,
352352
const BlockAddress *BA = N->getBlockAddress();
353353
int64_t Offset = N->getOffset();
354354

355-
if (isPositionIndependent() || Subtarget.is64Bit())
355+
if (isPositionIndependent())
356356
report_fatal_error("Unable to lowerBlockAddress");
357357

358358
SDValue BAHi = DAG.getTargetBlockAddress(BA, Ty, Offset, RISCVII::MO_HI);

lib/Target/RISCV/RISCVInstrInfo.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,8 @@ unsigned RISCVInstrInfo::insertIndirectBranch(MachineBasicBlock &MBB,
362362
MachineFunction *MF = MBB.getParent();
363363
MachineRegisterInfo &MRI = MF->getRegInfo();
364364
const auto &TM = static_cast<const RISCVTargetMachine &>(MF->getTarget());
365-
const auto &STI = MF->getSubtarget<RISCVSubtarget>();
366365

367-
if (TM.isPositionIndependent() || STI.is64Bit())
366+
if (TM.isPositionIndependent())
368367
report_fatal_error("Unable to insert indirect branch");
369368

370369
if (!isInt<32>(BrOffset))

0 commit comments

Comments
 (0)