This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking,VectorCombine] Allow passing DT to computeConstantRange.
ClosedPublic

Authored by fhahn on Sep 21 2021, 7:09 AM.

Details

Summary

isValidAssumeForContext can provide better results with access to the
dominator tree in some cases. This patch adjusts computeConstantRange to
allow passing through a dominator tree.

The use VectorCombine is updated to pass through the DT to enable
additional scalarization.

Note that similar APIs like computeKnownBits already accept optional dominator
tree arguments.

Diff Detail

Event Timeline

fhahn created this revision.Sep 21 2021, 7:09 AM
fhahn requested review of this revision.Sep 21 2021, 7:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2021, 7:09 AM
lebedev.ri accepted this revision.Sep 21 2021, 7:11 AM

LG with nit.

llvm/include/llvm/Analysis/ValueTracking.h
552

I think Depth should always stay the last parameter

This revision is now accepted and ready to land.Sep 21 2021, 7:11 AM
RKSimon added inline comments.Sep 21 2021, 7:30 AM
llvm/include/llvm/Analysis/ValueTracking.h
552

+1

fhahn updated this revision to Diff 373931.Sep 21 2021, 7:44 AM

Thanks, moved DT argument before Depth.

fhahn marked 2 inline comments as done.Sep 21 2021, 7:45 AM
fhahn added inline comments.
llvm/include/llvm/Analysis/ValueTracking.h
552

There weren't too many users that needed updating. Fixed!

lebedev.ri accepted this revision.Sep 21 2021, 7:47 AM
This revision was landed with ongoing or failed builds.Sep 21 2021, 9:06 AM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.