This is an archive of the discontinued LLVM Phabricator instance.

export ConstantRange from LVI
ClosedPublic

Authored by regehr on Apr 15 2016, 2:12 PM.

Details

Summary

LVI had no facility to let clients see the ConstantRanges that it compues, this fixes that.

Example client is a pass I'm writing that looks for LVI bugs by asserting that every value for which a nontrivial ConstantRange exists is within the specified bounds.

Diff Detail

Repository
rL LLVM

Event Timeline

regehr updated this revision to Diff 53950.Apr 15 2016, 2:12 PM
regehr retitled this revision from to export ConstantRange from LVI.
regehr updated this object.
regehr added a reviewer: reames.
regehr set the repository for this revision to rL LLVM.
reames accepted this revision.Apr 18 2016, 5:57 PM
reames edited edge metadata.

LGTM

I'd really like to see a test case for this. I'm accepting the change without it, but finding a way to test this in tree would be good. Unfortunately, we don't appear to have any of the harness needed for this.

lib/Analysis/LazyValueInfo.cpp
1405

This case should be dead. Assert(!isConstant)

1408

else if

This revision is now accepted and ready to land.Apr 18 2016, 5:57 PM
regehr updated this revision to Diff 54173.Apr 19 2016, 4:08 AM
regehr edited edge metadata.

Addresses Philip's comments. Thanks!

regehr marked 2 inline comments as done.Apr 19 2016, 4:09 AM
regehr added a comment.EditedApr 19 2016, 4:13 AM

I agree that tests would be good, thanks for confirming that I hadn't simply failed to spot the infrastructure I should be using to do that...

regehr updated this revision to Diff 55727.Apr 30 2016, 3:16 PM

Rebase.

Closed by commit rL268291 (authored by regehr). · Explain WhyMay 2 2016, 1:04 PM
This revision was automatically updated to reflect the committed changes.