Skip to content

Commit 835d303

Browse files
authored
[AArch64] improve zero-cycle regmov test (#143680)
- Add a `gpr32` suffix to test name to denote the specific register class being checked - Expand `-mtriple=arm64-apple-ios` to `-march=arm64` to broaden the test context to the generic architecture, as the specific triple is not required - Port `bl` match to Linux too via the regex: `{{_?foo}}` - Advance `-mcpu=cyclone` to the newer M series major `-mcpu=apple-m1` - Use `-mcpu` so that `-mattr=-zcm` has a real effect - Add a test that generic arm64 doesn't optimize for ZCM - Distinguish 4 different assembly layouts: NOTCPU, CPU, NOTATTR, ATTR - Fix broken test logic, for example: `; NOT: mov [[REG2:w[0-9]+]], w3` matched `mov w1, w3` then `REG2` captured `w1` but then `; NOT: mov w1, [[REG2]]` matched by prefix `mov, w1, w19` even though it should have matched `mov w1, w1`. This change adds explicit matches for all of the generated copies.
1 parent 82acd8c commit 835d303

File tree

2 files changed

+45
-23
lines changed

2 files changed

+45
-23
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
; RUN: llc < %s -march=arm64 | FileCheck %s -check-prefixes=NOTCPU --match-full-lines
2+
; RUN: llc < %s -mtriple=arm64-apple-macosx -mcpu=apple-m1 | FileCheck %s -check-prefixes=CPU --match-full-lines
3+
; RUN: llc < %s -mtriple=arm64-apple-macosx -mcpu=apple-m1 -mattr=-zcm | FileCheck %s -check-prefixes=NOTATTR --match-full-lines
4+
; RUN: llc < %s -mtriple=arm64-apple-macosx -mattr=+zcm | FileCheck %s -check-prefixes=ATTR --match-full-lines
5+
6+
define void @t(i32 %a, i32 %b, i32 %c, i32 %d) {
7+
entry:
8+
; CHECK-LABEL: t:
9+
; NOTCPU: mov w0, w2
10+
; NOTCPU: mov w1, w3
11+
; NOTCPU: mov [[REG2:w[0-9]+]], w3
12+
; NOTCPU: mov [[REG1:w[0-9]+]], w2
13+
; NOTCPU-NEXT: bl {{_?foo}}
14+
; NOTCPU: mov w0, [[REG1]]
15+
; NOTCPU: mov w1, [[REG2]]
16+
17+
; CPU: mov [[REG2:x[0-9]+]], x3
18+
; CPU: mov [[REG1:x[0-9]+]], x2
19+
; CPU: mov x0, x2
20+
; CPU: mov x1, x3
21+
; CPU-NEXT: bl {{_?foo}}
22+
; CPU: mov x0, [[REG1]]
23+
; CPU: mov x1, [[REG2]]
24+
25+
; NOTATTR: mov [[REG2:w[0-9]+]], w3
26+
; NOTATTR: mov [[REG1:w[0-9]+]], w2
27+
; NOTATTR: mov w0, w2
28+
; NOTATTR: mov w1, w3
29+
; NOTATTR-NEXT: bl {{_?foo}}
30+
; NOTATTR: mov w0, [[REG1]]
31+
; NOTATTR: mov w1, [[REG2]]
32+
33+
; ATTR: mov x0, x2
34+
; ATTR: mov x1, x3
35+
; ATTR: mov [[REG2:x[0-9]+]], x3
36+
; ATTR: mov [[REG1:x[0-9]+]], x2
37+
; ATTR-NEXT: bl {{_?foo}}
38+
; ATTR: mov x0, [[REG1]]
39+
; ATTR: mov x1, [[REG2]]
40+
%call = call i32 @foo(i32 %c, i32 %d)
41+
%call1 = call i32 @foo(i32 %c, i32 %d)
42+
unreachable
43+
}
44+
45+
declare i32 @foo(i32, i32)

llvm/test/CodeGen/AArch64/arm64-zero-cycle-regmov.ll

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)