[PATCH] AArch64 : Implement GHC calling convention.

Renato Golin renato.golin at linaro.org
Wed Jan 14 01:51:08 PST 2015

Hi Erik,

The changes look harmless to me, but I'd like to see slightly better tests before this goes in.



Comment at: test/CodeGen/AArch64/ghc-cc.ll:28
@@ +27,3 @@
+  ; CHECK:      mov  x20, x1
+  ; CHECK-NEXT: bl   addtwo
If you're checking for the absence of prologue, I'd recommend you used CHECK-NOT, instead of CHECK-NEXT with some instruction, because:

1. It tells us what the test is about, and
2. It's less fragile to codegen changes. 

Comment at: test/CodeGen/AArch64/ghc-cc.ll:46
@@ +45,3 @@
+  ; CHECK:      adrp    x8, d4
+  ; CHECK-NEXT: adrp    x9, d3
The more CHECK-NEXT you use, the more fragile the test will be to codegen changes. Though, in these cases, CHECK-DAG will not be as efficient/correct.

Maybe what you should do, since there are no prologues and no stack (I'm assuming), you should create multiple functions, one for each type of parameter, and test it with CHECK-NEXT in an atomic way (for each example, a pair of CHECK + CHECK-NEXT *after* the CHECK-LABEL).



More information about the llvm-commits mailing list