[PATCH] D80132: Add verifier check that musttail and preallocated are not used together

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 11:54:50 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa7cc275e7e8a: Add verifier check that musttail and preallocated are not used together (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80132/new/

https://reviews.llvm.org/D80132

Files:
  llvm/lib/IR/Verifier.cpp
  llvm/test/Verifier/preallocated-invalid.ll


Index: llvm/test/Verifier/preallocated-invalid.ll
===================================================================
--- llvm/test/Verifier/preallocated-invalid.ll
+++ llvm/test/Verifier/preallocated-invalid.ll
@@ -116,3 +116,10 @@
     %x = call i8* @llvm.call.preallocated.arg(token %t, i32 1) preallocated(i32)
     ret void
 }
+
+; CHECK: musttail and preallocated not yet supported
+define void @musttail() {
+    %cs = call token @llvm.call.preallocated.setup(i32 0)
+    musttail call void @foo0() ["preallocated"(token %cs)]
+    ret void
+}
Index: llvm/lib/IR/Verifier.cpp
===================================================================
--- llvm/lib/IR/Verifier.cpp
+++ llvm/lib/IR/Verifier.cpp
@@ -3150,6 +3150,9 @@
 
 void Verifier::verifyMustTailCall(CallInst &CI) {
   Assert(!CI.isInlineAsm(), "cannot use musttail call with inline asm", &CI);
+  // FIXME: support musttail + preallocated
+  Assert(!CI.countOperandBundlesOfType(LLVMContext::OB_preallocated),
+         "musttail and preallocated not yet supported", &CI);
 
   // - The caller and callee prototypes must match.  Pointer types of
   //   parameters or return types may differ in pointee type, but not


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80132.264692.patch
Type: text/x-patch
Size: 1186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/751cfb72/attachment.bin>


More information about the llvm-commits mailing list