This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Let getGuaranteedNonFullPoisonOp consider assume, remove mentioning about br
ClosedPublic

Authored by aqjune on Feb 28 2020, 9:29 PM.

Details

Summary

This patch helps getGuaranteedNonFullPoisonOp handle llvm.assume call.
Also, a comment about the semantics of branch is removed to prevent confusion.
As llvm.assume does, branching on poison directly raises UB (as LangRef says), and this allows transformations such as introduction of llvm.assume on branch condition at each successor, or freely replacing values after conditional branch (such as at loop exit).
Handling br is not addressed in this patch. It makes SCEV more accurate, causing existing LoopVectorize/IndVar/etc tests to fail.

Diff Detail

Event Timeline

aqjune created this revision.Feb 28 2020, 9:29 PM
aqjune edited the summary of this revision. (Show Details)Feb 28 2020, 9:34 PM
aqjune added reviewers: spatel, lebedev.ri.
nlopes accepted this revision.Feb 29 2020, 8:55 AM

LGTM (modulo the style fix).
assume poison is UB.

This revision is now accepted and ready to land.Feb 29 2020, 8:55 AM
This revision was automatically updated to reflect the committed changes.