[PATCH] D94106: [Local] Treat calls that may not return as being alive (WIP).

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 08:53:43 PST 2021


nikic added a comment.

The new direction of the patch looks good to me. And yes, I would prefer it if the intrinsic attribute updates were split off into a separate patch.



================
Comment at: llvm/include/llvm/IR/Intrinsics.td:1192
     []>;
-def int_coro_alloc : Intrinsic<[llvm_i1_ty], [llvm_token_ty], []>;
+def int_coro_alloc : DefaultAttrsIntrinsic<[llvm_i1_ty], [llvm_token_ty], []>;
 def int_coro_id_async : Intrinsic<[llvm_token_ty],
----------------
Wow, `coro.alloc` and `coro.free` are some seriously misleading function names.


================
Comment at: llvm/include/llvm/IR/IntrinsicsARM.td:374
   : Intrinsic<[llvm_anyvector_ty], [LLVMTruncatedType<0>, LLVMTruncatedType<0>],
-              [IntrNoMem]>;
+              [IntrNoMem, IntrWillReturn]>;
 class Neon_3Arg_Intrinsic
----------------
Any reason not to use DefaultAttrsIntrinsic for these?


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:425
+    // Treat calls that may not return as alive.
+    if (!I->getFunction()->willReturn() && !CB->willReturn())
+      return false;
----------------
Why does this check for willreturn on the calling function as well? It's not wrong, but it's also not clear to me under what circumstances the extra check would be useful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94106



More information about the llvm-commits mailing list