llvm-project
ea2d35a1 - [CodeGen] Prevent debug instructions from changing PHI copy placement (#233156)

Commit
11 days ago
[CodeGen] Prevent debug instructions from changing PHI copy placement (#233156) Debug instructions after PHIs can make PHIElimination place destination copies too early. This can move an AMDGPU copy before `SI_END_CF`, changing its exec mask, or an X86 copy before an EH label, causing the exceptional path to skip it. Ignore debug instructions when selecting the copy position, then move them after the inserted copies while preserving pseudo-probe placement. Tests cover the AMDGPU and X86 cases, including `DBG_VALUE` and `DBG_INSTR_REF`. Fixes #43204 The AMDGPU issue was found by a non-AI automated testing tool. AI assisted with the analysis and development of the fix.
Author
Parents
Loading