[llvm] [GlobalOpt] Check if users are CallBase when changing CC (PR #161399)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 1 00:55:37 PDT 2025
================
@@ -65,15 +113,16 @@ define void @call_things() {
call i32 @preallocated(ptr preallocated(i32) %N) ["preallocated"(token %c)]
ret void
}
-; CHECK-LABEL: define void @call_things()
-; CHECK: call fastcc i32 @f
-; CHECK: call fastcc i32 @g
-; CHECK: call coldcc i32 @h
-; CHECK: call i32 @j
-; CHECK: call fastcc i32 @inalloca(ptr %args)
-; CHECK-NOT: llvm.call.preallocated
-; CHECK: call fastcc i32 @preallocated(ptr %paarg)
@llvm.used = appending global [1 x ptr] [
- ptr @j
+ ptr @j
], section "llvm.metadata"
+
+define internal i32 @constexpr_self_user() addrspace(1) {
----------------
nikic wrote:
Ah, but that indicates another issue now. We'll also ignore assume-like calls directly: https://github.com/llvm/llvm-project/blob/3c0f7b184d265281dfcd4fab73348bc0e72c9902/llvm/lib/IR/Function.cpp#L995-L999
But in that case we're going to change the CC on the assume-like call, not on a call to the function. So I think the code needs to check that it's the callee operand.
https://github.com/llvm/llvm-project/pull/161399
More information about the llvm-commits
mailing list