aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LCSSA.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-04-27 12:23:11 +0200
committerNikita Popov <npopov@redhat.com>2023-05-02 10:01:50 +0200
commit5cbb9f7a58d98ba432c6ddeefa581f6fc521315c (patch)
treef9fa78e5cb95845b1939713c44d2266a8e3a12fc /llvm/lib/Transforms/Utils/LCSSA.cpp
parenta257616bce1ebb2b2071ee01d7d437074a63dacc (diff)
downloadllvm-5cbb9f7a58d98ba432c6ddeefa581f6fc521315c.zip
llvm-5cbb9f7a58d98ba432c6ddeefa581f6fc521315c.tar.gz
llvm-5cbb9f7a58d98ba432c6ddeefa581f6fc521315c.tar.bz2
[LCSSA] Don't invalidate SCEV
LCSSA currently invalidates SCEV for all instructions for which LCSSA phi nodes are created. This used to be necessary, because SCEV has historically tried to maintain LCSSA form as well. As such, some SCEV uses of the value would have to become uses of the phi node instead. However, nowadays SCEV itself no longer maintains LCSSA form. The SCEV of on LCSSA phi node will be the same as the SCEV of its argument. LCSSA is instead maintained in the SCEVExpander. As such, I believe it is no longer necessary to perform any SCEV invalidation during LCSSA construction. After this patch the ScalarEvolution argument to the LCSSA utilities is no longer necessary -- I'll remove it in a followup NFC patch to keep this patch more concise. Differential Revision: https://reviews.llvm.org/D149435
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LCSSA.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp
index 4b006f5..7affa83 100644
--- a/llvm/lib/Transforms/Utils/LCSSA.cpp
+++ b/llvm/lib/Transforms/Utils/LCSSA.cpp
@@ -150,11 +150,6 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist,
SSAUpdater SSAUpdate(&InsertedPHIs);
SSAUpdate.Initialize(I->getType(), I->getName());
- // Force re-computation of I, as some users now need to use the new PHI
- // node.
- if (SE)
- SE->forgetValue(I);
-
// Insert the LCSSA phi's into all of the exit blocks dominated by the
// value, and add them to the Phi's map.
for (BasicBlock *ExitBB : ExitBlocks) {