[llvm] [NewGVN] Set parent to the temporal instructions that are generated during phi-of-ops optimization (PR #66314)

Konstantina Mitropoulou via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 15 18:32:26 PDT 2023


================
@@ -2765,6 +2771,7 @@ NewGVN::makePossiblePHIOfOps(Instruction *I,
       // Clone the instruction, create an expression from it that is
       // translated back into the predecessor, and see if we have a leader.
       Instruction *ValueOp = I->clone();
+      ValueOp->insertBefore(I);
----------------
kmitropoulou wrote:

Good point! It makes the code better :)

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


More information about the llvm-commits mailing list