This is an archive of the discontinued LLVM Phabricator instance.

Optimize shufflevector that copies an i64/f64 and zeros the rest.
ClosedPublic

Authored by filcab on Apr 25 2014, 7:09 PM.

Diff Detail

Event Timeline

filcab updated this revision to Diff 8859.Apr 25 2014, 7:09 PM
filcab retitled this revision from to Optimize shufflevector that copies an i64/f64 and zeros the rest..
filcab updated this object.
filcab edited the test plan for this revision. (Show Details)
filcab added reviewers: nadav, craig.topper.
filcab added a subscriber: Unknown Object (MLST).
filcab added a subscriber: Bigcheese.

I'm pinging this revision and properly adding Elena as a reviewer instead of a subscriber.
I mistakenly committed and reverted it, since I'm still waiting for the LGTM.

delena added inline comments.May 6 2014, 11:32 PM
lib/Target/X86/X86ISelLowering.cpp
7538

You can change the previous "if" and do not duplicate the code.
else if (VT.is128BitVector() && Subtarget->hasSSE2()) {
..
}
and RewriteAsNarrowerShuffle() will return the same node for v2f64 and v2i64.

But the logic is right and the optimization is very good!

filcab updated this revision to Diff 9196.May 7 2014, 5:17 PM

Merged the if statement into the previous statement.

RewriteAsNarrowerShuffle will now return its argument if it's a v2?64
vector.

delena added inline comments.May 7 2014, 10:40 PM
lib/Target/X86/X86ISelLowering.cpp
7517

v4i32 is covered by 128bitVector.
All other LGTM

filcab accepted this revision.May 8 2014, 4:44 PM
filcab added a reviewer: filcab.
This revision is now accepted and ready to land.May 8 2014, 4:44 PM
filcab closed this revision.May 8 2014, 4:44 PM