Skip to content

Commit c68faed

Browse files
committed
[RISCV] Return a vXi1 vector type from getSetCCResultType if V extension is enabled.
nvxXi1 types are legal with V extension and that's the result vmseq/vmsne/vmslt/etc instructions return. No test cases yet because the setcc isel patterns aren't in and we'll need more than basic tests to observe this. I locally tested that this plus D947078, D94168, D94142, and D94149 was enough to be able to handle the overflow result from llvm.sadd.overflow.
1 parent a515342 commit c68faed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,8 @@ EVT RISCVTargetLowering::getSetCCResultType(const DataLayout &DL, LLVMContext &,
398398
EVT VT) const {
399399
if (!VT.isVector())
400400
return getPointerTy(DL);
401+
if (Subtarget.hasStdExtV())
402+
return MVT::getVectorVT(MVT::i1, VT.getVectorElementCount());
401403
return VT.changeVectorElementTypeToInteger();
402404
}
403405

0 commit comments

Comments
 (0)