llvm-project
ddaaf4fa - [Inliner] Fix return attribute propagation across multiple return sites (#186076)

Commit
129 days ago
[Inliner] Fix return attribute propagation across multiple return sites (#186076) Fixes #185159 This patch fixes a bug in `AddReturnAttributes()` where propagated return attributes could incorrectly leak across multiple return sites in the callee being inlined. `AddReturnAttributes()` walks the callee's return instructions and tries to backward-propagate return attributes from the callsite to the returned call when the callee directly returns a call result. However, the propagated attribute builders were updated in-place while iterating over return sites. As a result, attributes refined for one return site could be reused when processing a later return site. This is incorrect because each return site should be handled independently, starting from the original callsite attributes. This patch ensures that propagated return attributes are reinitialized for each return site, so propagation is computed independently per returned call.
Author
Parents
Loading