Closed pzread closed 1 year ago
To reproduce:
Download the MLIR: https://storage.googleapis.com/iree-github-actions-postsubmit-artifacts/6303857967/1/e2e-test-artifacts/iree_MobileNetV2_int8_tflite_.mlir
Run:
iree-compile --output-format=vm-bytecode --mlir-print-op-on-diagnostic=false --iree-hal-target-backends=llvm-cpu --iree-input-type=tosa --iree-llvmcpu-target-triple=riscv32-pc-linux-gnu --iree-llvmcpu-target-cpu=generic-rv32 --iree-llvmcpu-target-abi=ilp32 --iree-llvmcpu-target-cpu-features=+m,+a,+f,+zvl512b,+zve32f --riscv-v-fixed-length-vector-lmul-max=8 iree_MobileNetV2_int8_tflite_.mlir -o module.vmfb
This patch may fix it
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index c4942f9c637b..ee9957795f97 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -8641,6 +8641,9 @@ SDValue RISCVTargetLowering::lowerINSERT_SUBVECTOR(SDValue Op,
DAG.getUNDEF(ContainerVT), SubVec,
DAG.getConstant(0, DL, XLenVT));
if (OrigIdx == 0 && Vec.isUndef() && VecVT.isFixedLengthVector()) {
+ if (ContainerVT != OrigContainerVT)
+ SubVec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, OrigContainerVT, OrigVec,
+ SubVec, DAG.getVectorIdxConstant(0, DL));
SubVec = convertFromScalableVector(VecVT, SubVec, DAG, Subtarget);
return DAG.getBitcast(Op.getValueType(), SubVec);
}
A fix was landed in https://github.com/llvm/llvm-project/commit/b14f6eebc9e2c56c325fe72aa29a1f042bb9e9b3, does that fix the crash here?
A fix was landed in llvm/llvm-project@b14f6ee, does that fix the crash here?
Confirmed the issue has been fixed, thanks!
With the LLVM integration https://github.com/openxla/iree/pull/15020, RISC-V failed to build these targets with error: