Skip to content

Commit 02930b8

Browse files
manasij7479Artem-B
authored andcommitted
[NVPTX] Promote v2i8 to v2i16 (llvm#111189)
Promote v2i8 to v2i16, fixes a crash. Re-enable a test in NVPTX/vector-returns.ll Partial cherry-pick of fda2fea w/o the test which does not exist in release/19.x llvm#104864
1 parent 51dee6b commit 02930b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL,
229229
// v*i8 are formally lowered as v4i8
230230
EltVT = MVT::v4i8;
231231
NumElts = (NumElts + 3) / 4;
232+
} else if (EltVT.getSimpleVT() == MVT::i8 && NumElts == 2) {
233+
// v2i8 is promoted to v2i16
234+
NumElts = 1;
235+
EltVT = MVT::v2i16;
232236
}
233237
for (unsigned j = 0; j != NumElts; ++j) {
234238
ValueVTs.push_back(EltVT);

0 commit comments

Comments
 (0)