From: Roman Lebedev Date: Thu, 13 Jan 2022 20:55:00 +0000 (+0300) Subject: [SCEV] Don't consider umin_seq scev expr to be more complex that ptrtoint scev expr X-Git-Tag: upstream/15.0.7~20580 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=993792bd1affe3cf13ce3b9d71250235cd0d029e;p=platform%2Fupstream%2Fllvm.git [SCEV] Don't consider umin_seq scev expr to be more complex that ptrtoint scev expr Let's consider sequential min/max expression family to be more complex than their non-sequential counterparts, preserving internal ordering within them. --- diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h index 4416fdb..27542bc 100644 --- a/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h +++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h @@ -50,8 +50,8 @@ enum SCEVTypes : unsigned short { scSMaxExpr, scUMinExpr, scSMinExpr, - scPtrToInt, scSequentialUMinExpr, + scPtrToInt, scUnknown, scCouldNotCompute }; diff --git a/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll b/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll index 629b292..1de3014 100644 --- a/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll +++ b/llvm/test/Analysis/ScalarEvolution/exit-count-select-safe.ll @@ -429,7 +429,7 @@ define i64 @uminseq_vs_ptrtoint_complexity(i64 %n, i64 %m, i64* %ptr) { ; CHECK-NEXT: %ptr.int = ptrtoint i64* %ptr to i64 ; CHECK-NEXT: --> (ptrtoint i64* %ptr to i64) U: full-set S: full-set ; CHECK-NEXT: %r = add i64 %i, %ptr.int -; CHECK-NEXT: --> {(ptrtoint i64* %ptr to i64),+,1}<%loop> U: full-set S: full-set --> ((ptrtoint i64* %ptr to i64) + (%n umin_seq %m)) U: full-set S: full-set +; CHECK-NEXT: --> {(ptrtoint i64* %ptr to i64),+,1}<%loop> U: full-set S: full-set --> ((%n umin_seq %m) + (ptrtoint i64* %ptr to i64)) U: full-set S: full-set ; CHECK-NEXT: Determining loop execution counts for: @uminseq_vs_ptrtoint_complexity ; CHECK-NEXT: Loop %loop: backedge-taken count is (%n umin_seq %m) ; CHECK-NEXT: Loop %loop: max backedge-taken count is -1