[PATCH] D40645: [SCEV][NFC] Check NoWrap flags before lexicographical comparison of SCEVs
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 6 04:45:32 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL319889: [SCEV][NFC] Check NoWrap flags before lexicographical comparison of SCEVs (authored by mkazantsev).
Changed prior to commit:
https://reviews.llvm.org/D40645?vs=124911&id=125704#toc
Repository:
rL LLVM
https://reviews.llvm.org/D40645
Files:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Index: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp
@@ -694,6 +694,10 @@
if (LNumOps != RNumOps)
return (int)LNumOps - (int)RNumOps;
+ // Compare NoWrap flags.
+ if (LA->getNoWrapFlags() != RA->getNoWrapFlags())
+ return (int)LA->getNoWrapFlags() - (int)RA->getNoWrapFlags();
+
// Lexicographically compare.
for (unsigned i = 0; i != LNumOps; ++i) {
int X = CompareSCEVComplexity(EqCacheSCEV, EqCacheValue, LI,
@@ -718,6 +722,10 @@
if (LNumOps != RNumOps)
return (int)LNumOps - (int)RNumOps;
+ // Compare NoWrap flags.
+ if (LC->getNoWrapFlags() != RC->getNoWrapFlags())
+ return (int)LC->getNoWrapFlags() - (int)RC->getNoWrapFlags();
+
for (unsigned i = 0; i != LNumOps; ++i) {
int X = CompareSCEVComplexity(EqCacheSCEV, EqCacheValue, LI,
LC->getOperand(i), RC->getOperand(i), DT,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40645.125704.patch
Type: text/x-patch
Size: 1061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171206/fd5ca485/attachment.bin>
More information about the llvm-commits
mailing list