This is an archive of the discontinued LLVM Phabricator instance.

[LSV] Don't assume that bitcast ops are Instructions.
ClosedPublic

Authored by jlebar on Jul 27 2016, 10:46 AM.

Details

Summary

When we ask the builder to create a bitcast on a constant, we get back a
constant, not an instruction.

Diff Detail

Event Timeline

jlebar updated this revision to Diff 65770.Jul 27 2016, 10:46 AM
jlebar retitled this revision from to [LSV] Don't assume that bitcast ops are Instructions..
jlebar updated this object.
jlebar added a reviewer: asbirlea.
jlebar added subscribers: arsenm, llvm-commits.
asbirlea added inline comments.Jul 27 2016, 11:01 AM
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
971–972

Looking back at this, why do we need a small vector for instructions to reorder and not just one instruction (which now may or may not exist)?

973

Can you rename I to something else? It's being used right below as an unsigned iterator, and while the two scopes don't overlap, it can be confusing.

998–999

Same as above.

jlebar updated this revision to Diff 65801.Jul 27 2016, 2:02 PM
jlebar marked 3 inline comments as done.

Address review comments.

There are other places where we're assuming that Builder gives us an instruction when it doesn't, but I'd like to deal with those in a separate patch.

lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
971–972

lol, good point. Fixed.

asbirlea accepted this revision.Jul 27 2016, 2:14 PM
asbirlea edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jul 27 2016, 2:14 PM
This revision was automatically updated to reflect the committed changes.