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)
722
722
bool RISCVLegalizerInfo::legalizeIntrinsic (LegalizerHelper &Helper,
723
723
MachineInstr &MI) const {
724
724
Intrinsic::ID IntrinsicID = cast<GIntrinsic>(MI).getIntrinsicID ();
725
+
726
+ if (RISCVVIntrinsicsTable::getRISCVVIntrinsicInfo (IntrinsicID))
727
+ return true ;
728
+
725
729
switch (IntrinsicID) {
726
730
default :
727
731
return false ;
Original file line number Diff line number Diff line change 38
38
#include "llvm/IR/DiagnosticPrinter.h"
39
39
#include "llvm/IR/IRBuilder.h"
40
40
#include "llvm/IR/Instructions.h"
41
+ #include "llvm/IR/IntrinsicInst.h"
41
42
#include "llvm/IR/IntrinsicsRISCV.h"
42
43
#include "llvm/MC/MCCodeEmitter.h"
43
44
#include "llvm/MC/MCInstBuilder.h"
@@ -24894,6 +24895,12 @@ bool RISCVTargetLowering::fallBackToDAGISel(const Instruction &Inst) const {
24894
24895
Op == Instruction::Freeze || Op == Instruction::Store)
24895
24896
return false;
24896
24897
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
+
24897
24904
if (Inst.getType()->isScalableTy())
24898
24905
return true;
24899
24906
Original file line number Diff line number Diff line change 2
2
; RUN: FileCheck %s --check-prefix=FALLBACK-WITH-REPORT-OUT < %t.out
3
3
; RUN: FileCheck %s --check-prefix=FALLBACK-WITH-REPORT-ERR < %t.err
4
4
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
-
38
5
; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: unable to translate instruction: alloca:
39
6
; FALLBACK-WITH-REPORT-OUT-LABEL: scalable_alloca
40
7
define void @scalable_alloca () #1 {
You can’t perform that action at this time.
0 commit comments