[PATCH] D103275: Update musttail verification to check all swiftasync->swiftasync tail calls.

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 13:02:48 PDT 2021


dexonsmith added a comment.

This doesn't look like a particularly expensive verifier check (although maybe I've missed something). What's the motivation for hiding it behind `EnableSwiftTailCCMustTailCheck`? Have you considered using bitcode AutoUpgrade to fix old IR?



================
Comment at: llvm/lib/IR/Verifier.cpp:3430-3437
+    if (EnableSwiftTailCCMustTailCheck &&
+        CI.getCallingConv() == CallingConv::SwiftTail &&
+        CI.getCaller()->getCallingConv() == CallingConv::SwiftTail &&
+        isa_and_nonnull<ReturnInst>(CI.getNextNode())) {
+      Assert(false,
+             "tail call from swifttail->swiftail should be marked musttail",
+             &CI);
----------------
I wonder if the verifier failure message would be more helpful if some of what's being asserted is in the assertion. Maybe, at least the `isa_and_nonnull` check; maybe also the calling convention checks, but I'm not sure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103275



More information about the llvm-commits mailing list