[llvm] [AMDGPU] Reland: Do not use original PHIs in coercion chains (PR #98985)
Jeffrey Byrnes via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 10:21:09 PDT 2024
================
@@ -365,13 +365,33 @@ bool LiveRegOptimizer::optimizeLiveType(
else
MissingIncVal = true;
}
- Instruction *DeadInst = Phi;
if (MissingIncVal) {
- DeadInst = cast<Instruction>(ValMap[Phi]);
- // Do not use the dead phi
- ValMap[Phi] = Phi;
+ Value *DeadVal = ValMap[Phi];
+ // The coercion chain of the PHI is broken. Delete the Phi
+ // from the ValMap and any connected / user Phis.
----------------
jrbyrnes wrote:
Not quite sure how we could more easily accomplish this using ValueHandles -- We never RAUW so by simply replacing to use ValueHandles we would still be where we are.
But if we changed the implementation of PHI node handling to use RAUW, it seems to me that we would still create broken PHIs and would need some unwinding mechanism.
https://github.com/llvm/llvm-project/pull/98985
More information about the llvm-commits
mailing list