Debian Codegraph @

flang/test/Fir/target-rewrite-target-features.fir

raw
1 // RUN: fir-opt --target-rewrite %s | FileCheck %s --check-prefixes=ALL_MLIR,UNCHANGED_MLIR
2 // RUN: fir-opt --target-rewrite="target-features=+gfx9-insts,+wavefrontsize64" %s | FileCheck %s --check-prefixes=ALL_MLIR,CHANGED_MLIR
3
4 // RUN: tco %s | FileCheck %s --check-prefixes=ALL_LLVM,UNCHANGED_LLVM
5 // RUN: tco -target-features=+gfx9-insts,+wavefrontsize64 %s | FileCheck %s --check-prefixes=ALL_LLVM,CHANGED_LLVM
6
7
8 // Check MLIR output from the 'fir-opt' tool
9
10 // ALL_MLIR: module attributes {
11 // ALL_MLIR-SAME: fir.target_features = #llvm.target_features<[
12
13 // UNCHANGED_MLIR-SAME: "+sse"
14 // CHANGED_MLIR-SAME: "+gfx9-insts", "+wavefrontsize64"
15
16 // ALL_MLIR-SAME: ]>
17
18 // ALL_MLIR: func.func @dummyfunc() attributes {
19 // ALL_MLIR-SAME: target_features = #llvm.target_features<[
20
21 // UNCHANGED_MLIR-SAME: "+sse"
22 // CHANGED_MLIR-SAME: "+gfx9-insts", "+wavefrontsize64"
23
24 // ALL_MLIR-SAME: ]>
25
26
27 // Check LLVM output from the 'tco' tool
28
29 // ALL_LLVM: define void @dummyfunc() #[[ATTRS:.*]] {
30 // ALL_LLVM: attributes #[[ATTRS]] = {
31
32 // UNCHANGED_LLVM-SAME: "target-features"="+sse"
33 // CHANGED_LLVM-SAME: "target-features"="+gfx9-insts,+wavefrontsize64"
34
35 module attributes {fir.target_features = #llvm.target_features<["+sse"]>} {
36 func.func @dummyfunc() -> () {
37 return
38 }
39 }