File tree Expand file tree Collapse file tree 4 files changed +775
-33
lines changed
test/CodeGen/RISCV/GlobalISel Expand file tree Collapse file tree 4 files changed +775
-33
lines changed Original file line number Diff line number Diff line change @@ -722,6 +722,10 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
722722bool RISCVLegalizerInfo::legalizeIntrinsic (LegalizerHelper &Helper,
723723 MachineInstr &MI) const {
724724 Intrinsic::ID IntrinsicID = cast<GIntrinsic>(MI).getIntrinsicID ();
725+
726+ if (RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo (IntrinsicID))
727+ return true ;
728+
725729 switch (IntrinsicID) {
726730 default :
727731 return false ;
Original file line number Diff line number Diff line change 3838#include "llvm/IR/DiagnosticPrinter.h"
3939#include "llvm/IR/IRBuilder.h"
4040#include "llvm/IR/Instructions.h"
41+ #include "llvm/IR/IntrinsicInst.h"
4142#include "llvm/IR/IntrinsicsRISCV.h"
4243#include "llvm/MC/MCCodeEmitter.h"
4344#include "llvm/MC/MCInstBuilder.h"
@@ -24894,6 +24895,12 @@ bool RISCVTargetLowering::fallBackToDAGISel(const Instruction &Inst) const {
2489424895 Op == Instruction::Freeze || Op == Instruction::Store)
2489524896 return false;
2489624897
24898+ if (auto *II = dyn_cast<IntrinsicInst>(&Inst)) {
24899+ // Mark RVV intrinsic as supported.
24900+ if (RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo(II->getIntrinsicID()))
24901+ return false;
24902+ }
24903+
2489724904 if (Inst.getType()->isScalableTy())
2489824905 return true;
2489924906
Original file line number Diff line number Diff line change 22; RUN: FileCheck %s --check-prefix=FALLBACK-WITH-REPORT-OUT < %t.out
33; RUN: FileCheck %s --check-prefix=FALLBACK-WITH-REPORT-ERR < %t.err
44
5-
6- declare <vscale x 1 x i8 > @llvm.riscv.vadd.nxv1i8.nxv1i8 (
7- <vscale x 1 x i8 >,
8- <vscale x 1 x i8 >,
9- <vscale x 1 x i8 >,
10- i64 )
11-
12- ; FALLBACK_WITH_REPORT_ERR: <unknown>:0:0: unable to translate instruction: call
13- ; FALLBACK-WITH-REPORT-OUT-LABEL: scalable_arg
14- define <vscale x 1 x i8 > @scalable_arg (<vscale x 1 x i8 > %0 , <vscale x 1 x i8 > %1 , i64 %2 ) nounwind {
15- entry:
16- %a = call <vscale x 1 x i8 > @llvm.riscv.vadd.nxv1i8.nxv1i8 (
17- <vscale x 1 x i8 > undef ,
18- <vscale x 1 x i8 > %0 ,
19- <vscale x 1 x i8 > %1 ,
20- i64 %2 )
21-
22- ret <vscale x 1 x i8 > %a
23- }
24-
25- ; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: unable to translate instruction: call
26- ; FALLBACK-WITH-REPORT-OUT-LABEL: scalable_inst
27- define <vscale x 1 x i8 > @scalable_inst (i64 %0 ) nounwind {
28- entry:
29- %a = call <vscale x 1 x i8 > @llvm.riscv.vadd.nxv1i8.nxv1i8 (
30- <vscale x 1 x i8 > undef ,
31- <vscale x 1 x i8 > undef ,
32- <vscale x 1 x i8 > undef ,
33- i64 %0 )
34-
35- ret <vscale x 1 x i8 > %a
36- }
37-
385; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: unable to translate instruction: alloca:
396; FALLBACK-WITH-REPORT-OUT-LABEL: scalable_alloca
407define void @scalable_alloca () #1 {
You can’t perform that action at this time.
0 commit comments