diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -7294,9 +7294,9 @@ SDValue WideN = DAG.getNode(N.getOpcode(), DL, VTs, WideOps); SmallVector TruncVals; for (unsigned I = 0; I < NumVals; I++) { - TruncVals.push_back(DAG.getNode(ISD::TRUNCATE, DL, - N->getSimpleValueType(I), - SDValue(WideN.getNode(), I))); + TruncVals.push_back( + DAG.getSetCC(DL, N->getSimpleValueType(I), SDValue(WideN.getNode(), I), + DAG.getConstant(0, DL, WideVT), ISD::SETNE)); } if (TruncVals.size() > 1) diff --git a/llvm/test/CodeGen/RISCV/rvv/vector-deinterleave.ll b/llvm/test/CodeGen/RISCV/rvv/vector-deinterleave.ll --- a/llvm/test/CodeGen/RISCV/rvv/vector-deinterleave.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vector-deinterleave.ll @@ -18,10 +18,8 @@ ; CHECK-NEXT: vmv1r.v v0, v8 ; CHECK-NEXT: vmerge.vim v12, v10, 1, v0 ; CHECK-NEXT: vnsrl.wi v8, v12, 0 -; CHECK-NEXT: vand.vi v8, v8, 1 ; CHECK-NEXT: vmsne.vi v0, v8, 0 -; CHECK-NEXT: vnsrl.wi v8, v12, 8 -; CHECK-NEXT: vand.vi v10, v8, 1 +; CHECK-NEXT: vnsrl.wi v10, v12, 8 ; CHECK-NEXT: vmsne.vi v8, v10, 0 ; CHECK-NEXT: ret %retval = call {, } @llvm.experimental.vector.deinterleave2.nxv32i1( %vec) diff --git a/llvm/test/CodeGen/RISCV/rvv/vector-interleave.ll b/llvm/test/CodeGen/RISCV/rvv/vector-interleave.ll --- a/llvm/test/CodeGen/RISCV/rvv/vector-interleave.ll +++ b/llvm/test/CodeGen/RISCV/rvv/vector-interleave.ll @@ -17,15 +17,13 @@ ; CHECK-NEXT: vwaddu.vv v16, v8, v12 ; CHECK-NEXT: li a0, -1 ; CHECK-NEXT: vwmaccu.vx v16, a0, v12 -; CHECK-NEXT: vand.vi v8, v18, 1 -; CHECK-NEXT: vmsne.vi v10, v8, 0 -; CHECK-NEXT: vand.vi v8, v16, 1 -; CHECK-NEXT: vmsne.vi v0, v8, 0 +; CHECK-NEXT: vmsne.vi v8, v18, 0 +; CHECK-NEXT: vmsne.vi v0, v16, 0 ; CHECK-NEXT: csrr a0, vlenb ; CHECK-NEXT: srli a0, a0, 2 ; CHECK-NEXT: add a1, a0, a0 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, tu, ma -; CHECK-NEXT: vslideup.vx v0, v10, a0 +; CHECK-NEXT: vslideup.vx v0, v8, a0 ; CHECK-NEXT: ret %res = call @llvm.experimental.vector.interleave2.nxv32i1( %a, %b) ret %res