Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25418,8 +25418,10 @@ bool RISCVTargetLowering::fallBackToDAGISel(const Instruction &Inst) const {
if (auto *II = dyn_cast<IntrinsicInst>(&Inst)) {
// Mark RVV intrinsic as supported.
if (RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo(II->getIntrinsicID())) {
// GISel doesn't support tuple types yet.
if (Inst.getType()->isRISCVVectorTupleTy())
// GISel doesn't support tuple types yet. It also doesn't suport returning
// a struct containing a scalable vector like vleff.
if (Inst.getType()->isRISCVVectorTupleTy() ||
Inst.getType()->isStructTy())
return true;

for (unsigned i = 0; i < II->arg_size(); ++i)
Expand Down
15 changes: 15 additions & 0 deletions llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/vec-vleff.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; RUN: not --crash llc -mtriple=riscv64 -mattr=+v -global-isel -stop-after=irtranslator \
; RUN: -verify-machineinstrs < %s 2>&1 | FileCheck %s

; Intrinsics returning structs and extractvalue of scalable vector are not
; supported yet.
define <vscale x 1 x i64> @intrinsic_vleff_v_nxv1i64_nxv1i64(ptr %0, i64 %1, ptr %2) nounwind {
entry:
%a = call { <vscale x 1 x i64>, i64 } @llvm.riscv.vleff.nxv1i64(<vscale x 1 x i64> poison, ptr %0, i64 %1)
%b = extractvalue { <vscale x 1 x i64>, i64 } %a, 0
%c = extractvalue { <vscale x 1 x i64>, i64 } %a, 1
store i64 %c, ptr %2
ret <vscale x 1 x i64> %b
}

; CHECK: LLVM ERROR: unable to translate instruction: call llvm.riscv.vleff.nxv1i64.i64.p0 (in function: intrinsic_vleff_v_nxv1i64_nxv1i64)
Loading