This is an archive of the discontinued LLVM Phabricator instance.

[IndVarSimply] Fix assert/release build difference.
ClosedPublic

Authored by Meinersbur on Feb 18 2020, 5:43 PM.

Details

Summary

In builds with assertions enabled (!NDEBUG), IndVarSimplify has an additional query to ScalarEvolution which may change future SCEV queries since it fills the internal cache differently. The result is actually only used when -verify-indvars. We fix the issue by only calling SE->getBackedgeTakenCount(L) if -verify-indvars is enabled such that only -verify-indvars shows the behavior, but not debug builds themselves. Also add a remark to the description of -verify-indvars about this behavior.

Fixes llvm.org/PR44815

Diff Detail

Event Timeline

Meinersbur created this revision.Feb 18 2020, 5:43 PM
  • Add test case

looks good to me, except for one minor issue in the testcase.

llvm/test/Transforms/IndVarSimplify/deterministic-scev-verify.ll
14 ↗(On Diff #245315)

Shouldn't this be 'IR-LABEL:' ?

Meinersbur marked an inline comment as done.
  • Fix mislabeling in test case
reames accepted this revision.Feb 19 2020, 12:06 PM

Also LGTM

This revision is now accepted and ready to land.Feb 19 2020, 12:06 PM
This revision was automatically updated to reflect the committed changes.