This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Don't inspect !range metadata for extended loads
ClosedPublic

Authored by sanjoy on Oct 26 2015, 11:13 PM.

Details

Summary

Don't call computeKnownBitsFromRangeMetadata for extended loads --
this can cause a mismatch between the width of the !range metadata and
the width of the APInt's accumulating KnownZero (and KnownOne in the
future). This isn't a problem now, but will be after a future change.

Note: this can be made more aggressive in the future.

Diff Detail

Event Timeline

sanjoy updated this revision to Diff 38504.Oct 26 2015, 11:13 PM
sanjoy retitled this revision from to [SelectionDAG] Don't inspect !range metadata for extended loads.
sanjoy updated this object.
sanjoy added a reviewer: nlewycky.
sanjoy added a subscriber: llvm-commits.
nlewycky edited edge metadata.Oct 27 2015, 9:50 AM

That is one big function.

No testsuite changes at all? It seems like this could earn itself a test for the miscompile that it fixes which was asymptomatic before D14100?

@nlewycky after this and D14100, CodeGen/PowerPC/glob-comp-aa-crash.ll crashes. I can make a separate test out of that if you like.

I'm okay with either or both of changing existing testcases because of this change (ie., to represent the slightly weaker optimization) and/or adding a new testcase to ensure we don't get this exact thing wrong. I just didn't want it to go in with no change to the tests at all.

sanjoy updated this revision to Diff 38614.Oct 27 2015, 5:36 PM
sanjoy edited edge metadata.
  • add a test case
hfinkel accepted this revision.Oct 27 2015, 5:39 PM
hfinkel added a reviewer: hfinkel.
hfinkel added a subscriber: hfinkel.

LGTM.

This revision is now accepted and ready to land.Oct 27 2015, 5:39 PM
This revision was automatically updated to reflect the committed changes.