[llvm] IPRA:Fix crash and verification failures for PLT calls (PR #196917)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 13:59:18 PDT 2026


================
@@ -154,7 +154,8 @@ bool RegUsageInfoPropagation::run(MachineFunction &MF) {
       };
 
       if (const Function *F = findCalledFunction(M, MI)) {
-        if (F->isDefinitionExact()) {
+        // The Function must not be preemptable.
+        if (F->isDefinitionExact() && F->isDSOLocal()) {
----------------
lenary wrote:

Sorry, I've been misleading, according to the current version of the code. I don't believe it has changed recently but I'm not sure.

`GlobalValue::isDefinitionExact()` calls `GlobalValue::mayBeDerefined()` which may call `GlobalValue::isInterposable()` which correctly checks dso-local-ness, from what I can see.

One thing I note is that the switch cases in `mayBeDerefined()` don't correspond 1:1 with the cases in `isInterposableLinkage()`.

There's probably opportunities to cleanup this logic, but I don't think that this function above needs to check isDSOLocal itself. 

https://github.com/llvm/llvm-project/pull/196917


More information about the llvm-commits mailing list