This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Select between two equal values
AbandonedPublic

Authored by mkazantsev on May 23 2017, 2:47 AM.

Details

Summary

SCEV of expressions like 'select %cond, %X, %X' should be evaluated as SCEV of '%X'.

Diff Detail

Event Timeline

mkazantsev created this revision.May 23 2017, 2:47 AM
sanjoy requested changes to this revision.May 23 2017, 9:18 AM

I'm not convinced SCEV is the best place to handle this -- by the time IR hits SCEV select A, B, B should already have been simplified to B. We do not handle "simple" patterns like br (xor C, true), label A, label B for the same reason.

If you *must* do this (and I'm not yet convinced that we must), I'd instead call SimplifyInstruction at a higher level (at createSCEV perhaps).

This revision now requires changes to proceed.May 23 2017, 9:18 AM
mkazantsev abandoned this revision.May 24 2017, 1:16 AM

Okay.