[llvm] Remove the optional bitcast between a musttail call and its ret (PR #201280)
Arseniy Obolenskiy via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 3 06:14:49 PDT 2026
================
@@ -0,0 +1,20 @@
+; RUN: llvm-dis %s.bc -o - | FileCheck %s
+; RUN: verify-uselistorder %s.bc
+
+; musttail-bitcast-upgrade.ll.bc was produced from the IR below using an
+; llvm-as that still emitted the optional no-op bitcast between a musttail call
+; and its return. The reader must drop that bitcast so the module verifies.
+
+; CHECK-LABEL: define ptr @caller(ptr %a)
+; CHECK-NEXT: %c = musttail call ptr @callee(ptr %a)
+; CHECK-NEXT: ret ptr %c
+
+define ptr @callee(ptr %a) {
+ ret ptr %a
+}
+
+define ptr @caller(ptr %a) {
+ %c = musttail call ptr @callee(ptr %a)
+ %b = bitcast ptr %c to ptr
+ ret ptr %b
+}
----------------
aobolensk wrote:
Done
https://github.com/llvm/llvm-project/pull/201280
More information about the llvm-commits
mailing list