Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions llvm/test/CodeGen/AArch64/arm64-zero-cycle-regmov-gpr32.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
; RUN: llc < %s -march=arm64 | FileCheck %s -check-prefixes=NOTCPU --match-full-lines
; RUN: llc < %s -mtriple=arm64-apple-macosx -mcpu=apple-m1 | FileCheck %s -check-prefixes=CPU --match-full-lines
; RUN: llc < %s -mtriple=arm64-apple-macosx -mcpu=apple-m1 -mattr=-zcm | FileCheck %s -check-prefixes=NOTATTR --match-full-lines
; RUN: llc < %s -mtriple=arm64-apple-macosx -mattr=+zcm | FileCheck %s -check-prefixes=ATTR --match-full-lines

define void @t(i32 %a, i32 %b, i32 %c, i32 %d) {
entry:
; CHECK-LABEL: t:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How big is the full assembly for the function? Would it make sense to auto-generate the check lines via llvm/utils/update_llc_test_checks.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its only 20-30 lines of assembly, I think its small enough to keep it manual and more manageable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interleaving off checks for different configuration makes it very hard to see what's going on.

I would expect that CPU/ATTR check lines are the same? Same for NOTATTR/NOTCPU?

If that's the case, they should be merged. Then it would make sense to auto-generate and check the full assembly for the case with and without the feature enabled (either via CPU or attribute)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So CPU/ATTR differ because -mcpu changes the order of instructions. Same for NOTATTR/NOTCPU. I can separate each configuration by duplicating ; CHECK: bl {{_?foo}}, or autogen it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will separate the outputs as described, as I dont think the cons of autogenerating the test worth it here (overfitting, robustness, readability, harder to debug)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So CPU/ATTR differ because -mcpu changes the order of instructions. Same for NOTATTR/NOTCPU. I can separate each configuration by duplicating ; CHECK: bl {{_?foo}}, or autogen it.

Ah I see, thanks. Separating the output makes things clearer.

; NOTCPU: mov w0, w2
; NOTCPU: mov w1, w3
; NOTCPU: mov [[REG2:w[0-9]+]], w3
; NOTCPU: mov [[REG1:w[0-9]+]], w2
; NOTCPU-NEXT: bl {{_?foo}}
; NOTCPU: mov w0, [[REG1]]
; NOTCPU: mov w1, [[REG2]]

; CPU: mov [[REG2:x[0-9]+]], x3
; CPU: mov [[REG1:x[0-9]+]], x2
; CPU: mov x0, x2
; CPU: mov x1, x3
; CPU-NEXT: bl {{_?foo}}
; CPU: mov x0, [[REG1]]
; CPU: mov x1, [[REG2]]

; NOTATTR: mov [[REG2:w[0-9]+]], w3
; NOTATTR: mov [[REG1:w[0-9]+]], w2
; NOTATTR: mov w0, w2
; NOTATTR: mov w1, w3
; NOTATTR-NEXT: bl {{_?foo}}
; NOTATTR: mov w0, [[REG1]]
; NOTATTR: mov w1, [[REG2]]

; ATTR: mov x0, x2
; ATTR: mov x1, x3
; ATTR: mov [[REG2:x[0-9]+]], x3
; ATTR: mov [[REG1:x[0-9]+]], x2
; ATTR-NEXT: bl {{_?foo}}
; ATTR: mov x0, [[REG1]]
; ATTR: mov x1, [[REG2]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also check that the call comes next

%call = call i32 @foo(i32 %c, i32 %d)
%call1 = call i32 @foo(i32 %c, i32 %d)
unreachable
}

declare i32 @foo(i32, i32)
23 changes: 0 additions & 23 deletions llvm/test/CodeGen/AArch64/arm64-zero-cycle-regmov.ll

This file was deleted.

Loading