[PATCH] D53748: [ARM] Fix test inlineasm-X-allocation.ll

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 01:49:02 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL345491: [ARM][NFC] Fix test inlineasm-X-allocation.ll (authored by SjoerdMeijer, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D53748?vs=171298&id=171462#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D53748

Files:
  llvm/trunk/test/CodeGen/ARM/inlineasm-X-allocation.ll


Index: llvm/trunk/test/CodeGen/ARM/inlineasm-X-allocation.ll
===================================================================
--- llvm/trunk/test/CodeGen/ARM/inlineasm-X-allocation.ll
+++ llvm/trunk/test/CodeGen/ARM/inlineasm-X-allocation.ll
@@ -1,21 +1,20 @@
-; RUN: llc -mtriple=armv7-none-eabi -mattr=-neon,-vfpv2 %s -o - | FileCheck %s  -check-prefix=novfp
-; RUN: llc -mtriple=armv7-none-eabi -mattr=+neon %s -float-abi=hard -o - | FileCheck %s -check-prefix=vfp
+; RUN: llc -mtriple=armv7-none-eabi -mattr=-neon,-vfp2 %s -o - | FileCheck %s  -check-prefixes=COMMON,NOVFP
+; RUN: llc -mtriple=armv7-none-eabi -mattr=+neon %s -float-abi=hard -o - | FileCheck %s -check-prefixes=COMMON,VFP
 
-; vfp-LABEL: f1
-; vfp-CHECK: vadd.f32 s0, s0, s0
+; The intent here is to test "X", which says that any operand whatsoever is allowed.
+; Using this mechanism, we want to test toggling allocating GPR or SPR registers
+; depending on whether the float registers are available. Thus, the mnemonic is
+; totally irrelevant here, which is why we use FOO and also comment it out using "@"
+; to avoid assembler errors.
 
-; In the novfp case, the compiler is forced to assign a core register.
-; Although this register class can't be used with the vadd.f32 instruction,
-; the compiler behaved as expected since it is allowed to emit anything.
+; Note that this kind of IR can be generated by a function such as:
+;  void f1(float f) {asm volatile ("@FOO $0, $0" : : "X" (f));}
 
-; novfp-LABEL: f1
-; novfp-CHECK: vadd.f32 r0, r0, r0
-
-; This can be generated by a function such as:
-;  void f1(float f) {asm volatile ("add.f32 $0, $0, $0" : : "X" (f));}
-
-define arm_aapcs_vfpcc void @f1(float %f) {
+define arm_aapcs_vfpcc void @func(float %f) {
+; COMMON-LABEL: func
+; NOVFP:        FOO r0, r0
+; VFP:          FOO s0, s0
 entry:
-  call void asm sideeffect "vadd.f32 $0, $0, $0", "X" (float %f) nounwind
+  call void asm sideeffect "@FOO $0, $0", "X" (float %f) nounwind
   ret void
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53748.171462.patch
Type: text/x-patch
Size: 1989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181029/57bc23c4/attachment.bin>


More information about the llvm-commits mailing list