This is an archive of the discontinued LLVM Phabricator instance.

[LazyValueInfo] Don't run the more complex predicate handling code for EQ and NE in getPredicateResult
ClosedPublic

Authored by craig.topper on Jun 7 2017, 10:04 AM.

Details

Summary

Unless I'm mistaken, the special handling for EQ/NE should cover everything and there is no reason to fallthrough to the more complex code. For that matter I'm not sure there's any reason to special case EQ/NE other than avoiding creating temporary ConstantRanges.

This patch moves the complex code into an else so we only do it when we are handling a predicate other than EQ/NE.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 7 2017, 10:04 AM
anna edited edge metadata.Jun 8 2017, 1:40 PM

This change looks good to me, and I agree with your summary. I think this is where additional tests to the LVI Printer pass (see -print-lazy-value-info) in lvi-after-jumpthreading.ll would help, i.e. did we change existing LVI values being calculated?

This function is just calculating a predicate result based on a LVI lattice value. I don't think it affects the calculation of LVI lattice values themselves. So I don't think the printer can see it.

anna accepted this revision.Jun 9 2017, 6:53 AM

This function is just calculating a predicate result based on a LVI lattice value. I don't think it affects the calculation of LVI lattice values themselves. So I don't think the printer can see it.

agreed, getPredicateAt uses the LVI result within CVP and Jumpthreading.

LGTM.

This revision is now accepted and ready to land.Jun 9 2017, 6:53 AM
This revision was automatically updated to reflect the committed changes.