[llvm] Remove the optional bitcast between a musttail call and its ret (PR #201280)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 3 05:52:06 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
+}
----------------
arsenm wrote:
Can you also test the non-pointer cases, some of the tests had i32 to i32
https://github.com/llvm/llvm-project/pull/201280
More information about the llvm-commits
mailing list