Skip to content

Commit a25d38d

Browse files
authored
[RISCV] Correct the SDTypeProfile for RISCVISD::PROBED_ALLOCA (#139135)
1 parent 6bb3019 commit a25d38d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24502,7 +24502,7 @@ RISCVTargetLowering::emitDynamicProbedAlloc(MachineInstr &MI,
2450224502
MachineFunction &MF = *MBB->getParent();
2450324503
MachineBasicBlock::iterator MBBI = MI.getIterator();
2450424504
DebugLoc DL = MBB->findDebugLoc(MBBI);
24505-
Register TargetReg = MI.getOperand(1).getReg();
24505+
Register TargetReg = MI.getOperand(0).getReg();
2450624506

2450724507
const RISCVInstrInfo *TII = Subtarget.getInstrInfo();
2450824508
bool IsRV64 = Subtarget.is64Bit();

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ def riscv_add_tprel : SDNode<"RISCVISD::ADD_TPREL",
103103
SDTCisInt<0>]>>;
104104

105105
def riscv_probed_alloca : SDNode<"RISCVISD::PROBED_ALLOCA",
106-
SDTypeProfile<1, 1, [SDTCisSameAs<0, 1>,
107-
SDTCisVT<0, i32>]>,
106+
SDTypeProfile<0, 1, [SDTCisPtrTy<0>]>,
108107
[SDNPHasChain, SDNPMayStore]>;
109108

110109
//===----------------------------------------------------------------------===//
@@ -1456,17 +1455,17 @@ let hasSideEffects = 1, mayLoad = 1, mayStore = 1, isCodeGenOnly = 1 in {
14561455
// Probed stack allocation of a constant size, used in function prologues when
14571456
// stack-clash protection is enabled.
14581457
def PROBED_STACKALLOC : Pseudo<(outs GPR:$sp),
1459-
(ins GPR:$scratch),
1458+
(ins GPR:$target),
14601459
[]>,
14611460
Sched<[]>;
14621461
def PROBED_STACKALLOC_RVV : Pseudo<(outs GPR:$sp),
1463-
(ins GPR:$scratch),
1462+
(ins GPR:$target),
14641463
[]>,
14651464
Sched<[]>;
14661465
let usesCustomInserter = 1 in
1467-
def PROBED_STACKALLOC_DYN : Pseudo<(outs GPR:$rd),
1468-
(ins GPR:$scratch),
1469-
[(set GPR:$rd, (riscv_probed_alloca GPR:$scratch))]>,
1466+
def PROBED_STACKALLOC_DYN : Pseudo<(outs),
1467+
(ins GPR:$target),
1468+
[(riscv_probed_alloca GPR:$target)]>,
14701469
Sched<[]>;
14711470
}
14721471

0 commit comments

Comments
 (0)