[PATCH] D64755: ARM: Fix missing immarg for space intrinsic

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 09:53:30 PDT 2019


arsenm created this revision.
arsenm added a reviewer: t.p.northover.
Herald added subscribers: kristof.beyls, javed.absar, wdng.

https://reviews.llvm.org/D64755

Files:
  include/llvm/IR/IntrinsicsARM.td
  test/Verifier/ARM/intrinsic-immarg.ll


Index: test/Verifier/ARM/intrinsic-immarg.ll
===================================================================
--- test/Verifier/ARM/intrinsic-immarg.ll
+++ test/Verifier/ARM/intrinsic-immarg.ll
@@ -100,3 +100,12 @@
   call void @llvm.arm.mcrr2(i32 0, i32 1, i32 2, i32 3, i32 %arg4)
   ret void
 }
+
+declare i32 @llvm.arm.space(i32, i32) nounwind
+define i32 @space(i32 %arg0, i32 %arg1) {
+  ; CHECK: immarg operand has non-immediate parameter
+  ; CHECK-NEXT: i32 %arg0
+  ; CHECK-NEXT: call i32 @llvm.arm.space(i32 %arg0, i32 %arg1)
+  %space = call i32 @llvm.arm.space(i32 %arg0, i32 %arg1)
+  ret i32 %space
+}
Index: include/llvm/IR/IntrinsicsARM.td
===================================================================
--- include/llvm/IR/IntrinsicsARM.td
+++ include/llvm/IR/IntrinsicsARM.td
@@ -19,7 +19,7 @@
 // A space-consuming intrinsic primarily for testing ARMConstantIslands. The
 // first argument is the number of bytes this "instruction" takes up, the second
 // and return value are essentially chains, used to force ordering during ISel.
-def int_arm_space : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], []>;
+def int_arm_space : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [ImmArg<0>]>;
 
 // 16-bit multiplications
 def int_arm_smulbb : GCCBuiltin<"__builtin_arm_smulbb">,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64755.209894.patch
Type: text/x-patch
Size: 1315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190715/5dfb55a9/attachment.bin>


More information about the llvm-commits mailing list