File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ bool HexagonMask::runOnMachineFunction(MachineFunction &MF) {
90
90
91
91
if (!F.hasFnAttribute (Attribute::OptimizeForSize))
92
92
return false ;
93
+ // Mask instruction is available only from v66
94
+ if (!HST.hasV66Ops ())
95
+ return false ;
93
96
// The mask instruction available in v66 can be used to generate values in
94
97
// registers using 2 immediates Eg. to form 0x07fffffc in R0, you would write
95
98
// "R0 = mask(#25,#2)" Since it is a single-word instruction, it takes less
Original file line number Diff line number Diff line change
1
+ ; Enable Utlilize mask instruction pass only on v66 and above.
2
+ ; RUN: llc -mv60 -march=hexagon < %s -o /dev/null
3
+
4
+ target datalayout = "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048"
5
+ target triple = "hexagon"
6
+
7
+ @b = dso_local local_unnamed_addr global i8 0 , align 1
8
+ @a = dso_local local_unnamed_addr global i32 0 , align 4
9
+
10
+ ; Function Attrs: cold nounwind optsize memory(readwrite, argmem: none, inaccessiblemem: none)
11
+ define dso_local void @c () local_unnamed_addr {
12
+ entry:
13
+ %0 = tail call i32 asm "" , "=&r" ()
14
+ %and = and i32 %0 , 134217727
15
+ %tobool.not = icmp eq i32 %and , 0
16
+ br i1 %tobool.not , label %if.end , label %if.then
17
+
18
+ if.then: ; preds = %entry
19
+ %1 = load i8 , ptr @b , align 1
20
+ %loadedv = zext nneg i8 %1 to i32
21
+ store i32 %loadedv , ptr @a , align 4
22
+ br label %if.end
23
+
24
+ if.end: ; preds = %if.then, %entry
25
+ ret void
26
+ }
You can’t perform that action at this time.
0 commit comments