Skip to content

Commit 327459e

Browse files
committed
Fix issues with removal of VecType, all tests pass now
1 parent 502c437 commit 327459e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

llvm/lib/Target/NVPTX/NVPTXForwardParams.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static bool eliminateMove(MachineInstr &Mov, const MachineRegisterInfo &MRI,
105105
const MachineOperand *ParamSymbol = Mov.uses().begin();
106106
assert(ParamSymbol->isSymbol());
107107

108-
constexpr unsigned LDInstBasePtrOpIdx = 6;
108+
constexpr unsigned LDInstBasePtrOpIdx = 5;
109109
constexpr unsigned LDInstAddrSpaceOpIdx = 2;
110110
for (auto *LI : LoadInsts) {
111111
(LI->uses().begin() + LDInstBasePtrOpIdx)

llvm/lib/Target/NVPTX/NVPTXReplaceImageHandles.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,8 +1808,8 @@ bool NVPTXReplaceImageHandles::replaceImageHandle(MachineOperand &Op,
18081808
// For CUDA, we preserve the param loads coming from function arguments
18091809
return false;
18101810

1811-
assert(TexHandleDef.getOperand(7).isSymbol() && "Load is not a symbol!");
1812-
StringRef Sym = TexHandleDef.getOperand(7).getSymbolName();
1811+
assert(TexHandleDef.getOperand(6).isSymbol() && "Load is not a symbol!");
1812+
StringRef Sym = TexHandleDef.getOperand(6).getSymbolName();
18131813
InstrsToRemove.insert(&TexHandleDef);
18141814
Op.ChangeToES(Sym.data());
18151815
MFI->getImageHandleSymbolIndex(Sym);

llvm/test/CodeGen/MIR/NVPTX/floating-point-immediate-operands.mir

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ registers:
4040
- { id: 7, class: float32regs }
4141
body: |
4242
bb.0.entry:
43-
%0 = LD_f32 0, 0, 4, 1, 2, 32, &test_param_0, 0
43+
%0 = LD_f32 0, 0, 4, 2, 32, &test_param_0, 0
4444
%1 = CVT_f64_f32 %0, 0
45-
%2 = LD_i32 0, 0, 4, 1, 0, 32, &test_param_1, 0
45+
%2 = LD_i32 0, 0, 4, 0, 32, &test_param_1, 0
4646
; CHECK: %3:float64regs = FADD_rnf64ri %1, double 3.250000e+00
4747
%3 = FADD_rnf64ri %1, double 3.250000e+00
4848
%4 = CVT_f32_f64 %3, 5
@@ -66,9 +66,9 @@ registers:
6666
- { id: 7, class: float32regs }
6767
body: |
6868
bb.0.entry:
69-
%0 = LD_f32 0, 0, 4, 1, 2, 32, &test2_param_0, 0
69+
%0 = LD_f32 0, 0, 4, 2, 32, &test2_param_0, 0
7070
%1 = CVT_f64_f32 %0, 0
71-
%2 = LD_i32 0, 0, 4, 1, 0, 32, &test2_param_1, 0
71+
%2 = LD_i32 0, 0, 4, 0, 32, &test2_param_1, 0
7272
; CHECK: %3:float64regs = FADD_rnf64ri %1, double 0x7FF8000000000000
7373
%3 = FADD_rnf64ri %1, double 0x7FF8000000000000
7474
%4 = CVT_f32_f64 %3, 5

0 commit comments

Comments
 (0)