[PATCH] D40945: [ScalarEvolution] Improve high cost heuristic in SCEVExpander.

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 23:19:10 PST 2017


sanjoy added a subscriber: mzolotukhin.
sanjoy added a comment.

lgtm to me, but I want Michael to take a look at the test update, as mentioned inline.



================
Comment at: test/Analysis/ScalarEvolution/expensive-expansion.ll:39
+
+attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
----------------
Is this necessary?


================
Comment at: test/Transforms/IndVarSimplify/no-iv-rewrite.ll:228
 ; ScalarEvolution is able to understand the loop evolution and that '%iv' at the
-; end of the loop is an even value. Thus '%val' is computed at the end of the
-; loop and the OR instruction is replaced by an ADD keeping the result
-; equivalent.
+; end of the loop is an even value. However, the expression is too expensive to
+; compute as the loop is not guarded, so the OR is not cloned (and changed into
----------------
@mzolotukhin - can you please review this bit (that the test update is fine)?


https://reviews.llvm.org/D40945





More information about the llvm-commits mailing list