diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2024-03-05 15:48:15 +0000 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2024-03-05 17:00:12 +0000 |
commit | f33f66be7dc586a597437d7ce7619d87e8637209 (patch) | |
tree | d656bb0e5d428ac175d0bb44148f7341cdbfb41c /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 1e828f838cc0f15074f3dbbb04929c06ef0c9729 (diff) | |
download | llvm-f33f66be7dc586a597437d7ce7619d87e8637209.zip llvm-f33f66be7dc586a597437d7ce7619d87e8637209.tar.gz llvm-f33f66be7dc586a597437d7ce7619d87e8637209.tar.bz2 |
[NFC][RemoveDIs] Always use iterators for inserting PHIs
It's becoming potentially unsafe to insert a PHI instruction using a plain
Instruction pointer. Switch all the remaining sites that create and insert
PHIs to use iterators instead. For example, the code in
ComplexDeinterleavingPass.cpp is definitely at-risk of mixing PHIs and
debug-info.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index feefe87..36f6cc8 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -4130,7 +4130,7 @@ private: PHINode *CurrentPhi = cast<PHINode>(Current); unsigned PredCount = CurrentPhi->getNumIncomingValues(); PHINode *PHI = - PHINode::Create(CommonType, PredCount, "sunk_phi", CurrentPhi); + PHINode::Create(CommonType, PredCount, "sunk_phi", CurrentPhi->getIterator()); Map[Current] = PHI; ST.insertNewPhi(PHI); append_range(Worklist, CurrentPhi->incoming_values()); @@ -6436,7 +6436,7 @@ bool CodeGenPrepare::optimizePhiType( } for (PHINode *Phi : PhiNodes) ValMap[Phi] = PHINode::Create(ConvertTy, Phi->getNumIncomingValues(), - Phi->getName() + ".tc", Phi); + Phi->getName() + ".tc", Phi->getIterator()); // Pipe together all the PhiNodes. for (PHINode *Phi : PhiNodes) { PHINode *NewPhi = cast<PHINode>(ValMap[Phi]); |