Skip to content

Commit 07f4d5a

Browse files
committed
Don't optimize for global address
1 parent e9aa331 commit 07f4d5a

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,23 +2469,6 @@ bool RISCVDAGToDAGISel::SelectAddrRegImmLsb00000(SDValue Addr, SDValue &Base,
24692469
int64_t CVal = cast<ConstantSDNode>(Addr.getOperand(1))->getSExtValue();
24702470
if (isInt<12>(CVal)) {
24712471
Base = Addr.getOperand(0);
2472-
if (Base.getOpcode() == RISCVISD::ADD_LO) {
2473-
SDValue LoOperand = Base.getOperand(1);
2474-
if (auto *GA = dyn_cast<GlobalAddressSDNode>(LoOperand)) {
2475-
const DataLayout &DL = CurDAG->getDataLayout();
2476-
Align Alignment = commonAlignment(
2477-
GA->getGlobal()->getPointerAlignment(DL), GA->getOffset());
2478-
int64_t CombinedOffset = CVal + GA->getOffset();
2479-
if (((CombinedOffset & 0b11111) == 0) &&
2480-
(CVal == 0 || Alignment > CVal)) {
2481-
Base = Base.getOperand(0);
2482-
Offset = CurDAG->getTargetGlobalAddress(
2483-
GA->getGlobal(), SDLoc(LoOperand), LoOperand.getValueType(),
2484-
CombinedOffset, GA->getTargetFlags());
2485-
return true;
2486-
}
2487-
}
2488-
}
24892472

24902473
// Early-out if not a valid offset.
24912474
if ((CVal & 0b11111) != 0) {

0 commit comments

Comments
 (0)