File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed
lib/Target/Hexagon/MCTargetDesc Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ bool HexagonMCChecker::checkPredicates() {
391
391
for (const auto &I : NewPreds) {
392
392
unsigned P = I;
393
393
394
- if (!Defs.count (P) || LatePreds.count (P)) {
394
+ if (!Defs.count (P) || LatePreds.count (P) || Defs. count (Hexagon::P3_0) ) {
395
395
// Error out if the new predicate register is not defined,
396
396
// or defined "late"
397
397
// (e.g., "{ if (p3.new)... ; p3 = sp1loop0(#r7:2, Rs) }").
Original file line number Diff line number Diff line change
1
+ # RUN: not llvm-mc -arch=hexagon %s 2>%t; FileCheck --implicit-check-not=error %s <%t
2
+
3
+ .Lfoo:
4
+ { p3: 0 = r0
5
+ if (!p0.new) jump: t .Lfoo }
6
+
7
+ # CHECK: error: register `P0' used with `.new' but not validly modified in the same packet
8
+
9
+ { c4 = r0
10
+ if (!p0.new) jump: t .Lfoo }
11
+
12
+ # CHECK: error: register `P0' used with `.new' but not validly modified in the same packet
13
+
14
+ { c4 = r0
15
+ p0 = r0
16
+ if (!p0.new) jump: t .Lfoo }
17
+
18
+ # CHECK: error: register `P0' used with `.new' but not validly modified in the same packet
19
+ # CHECK: error: register `P3_0' modified more than once
Original file line number Diff line number Diff line change
1
+ # RUN: llvm-mc -arch=hexagon -filetype=asm %s 2>%t; FileCheck --implicit-check-not=error %s <%t
2
+
3
+ # Check that multiple changes to a predicate in a packet are caught.
4
+
5
+ { p0 = cmp .eq (r0, r0); p3: 0 = r0 }
6
+ # CHECK: rror: register {{.+}} modified more than once
7
+
8
+ { p0 = cmp .eq (r0, r0); c4 = r0 }
9
+ # CHECK: rror: register {{.+}} modified more than once
10
+
11
+ p3: 0 = r9
12
+ # CHECK-NOT: rror: register {{.+}} modified more than once
13
+
14
+ # Multiple writes to the same predicate register are permitted:
15
+
16
+ { p0 = cmp .eq (r0, r0); p0 = and (p1, p2) }
17
+ # CHECK-NOT: rror: register {{.+}} modified more than once
You can’t perform that action at this time.
0 commit comments