diff options
author | Nikita Popov <npopov@redhat.com> | 2023-04-27 15:05:03 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-04-27 15:07:19 +0200 |
commit | 079c525f206228c3343048bb5a74a8e9a428de1a (patch) | |
tree | 2275e959aca7e38c606d6f08133cd2ff486fc777 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 6cfcf0242f3260a3a90bac68e9f271548caa8372 (diff) | |
download | llvm-079c525f206228c3343048bb5a74a8e9a428de1a.zip llvm-079c525f206228c3343048bb5a74a8e9a428de1a.tar.gz llvm-079c525f206228c3343048bb5a74a8e9a428de1a.tar.bz2 |
[SCEV] Try simplifying phi before createNodeFromSelectLikePHI()
Sometimes a phi can both be trivial and match the
createNodeFromSelectLikePHI() fold. In that case it is generally
more profitable to look through the phi node.
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 6bfb5c0..d7aeb0b 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -6050,12 +6050,12 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) { if (const SCEV *S = createAddRecFromPHI(PN)) return S; - if (const SCEV *S = createNodeFromSelectLikePHI(PN)) - return S; - if (Value *V = simplifyInstruction(PN, {getDataLayout(), &TLI, &DT, &AC})) return getSCEV(V); + if (const SCEV *S = createNodeFromSelectLikePHI(PN)) + return S; + // If it's not a loop phi, we can't handle it yet. return getUnknown(PN); } |