[llvm] PHIElimination: add target hook to control reuse. (PR #163604)

Junjie Gu via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 8 21:27:20 PST 2025


jgu222 wrote:

> I don't think this is the correct approach, but correct me if I'm mistaken. The underlying assumption of reusing the same virtual destination register is that in the worst case, values will be copied around (different register classes/banks, allocation). In the presented issue, it seems like there's an actual semantic difference between what the virtual registers represent in each block, depending on which thread is executing? This sounds more like a modeling issue rather than a problem with this specific pass. Maybe verifying that the register classes overlap can be a workaround in this specific case, but it seems like more issues will pop along the way.

PR has been re-done.  Could you comment ?  If okay,  can you help approve and merge ?

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


More information about the llvm-commits mailing list