X86 CodeGenPrep: sink shufflevectors before shifts

Press ? to show keyboard shortcuts.
Committed
tnorthoverFeb 19 2014, 2:02 AM
Parents
rL201654: Build PIE binaries when cross-compiling to Android.
Branches
Unknown
Tags
Unknown
Subscribers
None
Description

X86 CodeGenPrep: sink shufflevectors before shifts

On x86, shifting a vector by a scalar is significantly cheaper than shifting a
vector by another fully general vector. Unfortunately, because SelectionDAG
operates on just one basic block at a time, the shufflevector instruction that
reveals whether the right-hand side of a shift *is* really a scalar is often
not visible to CodeGen when it's needed.

This adds another handler to CodeGenPrepare, to sink any useful shufflevector
instructions down to the basic block where they're used, predicated on a target
hook (since on other architectures, doing so will often just introduce extra
real work).

rdar://problem/16063505

rL201655

llvm/trunk/include/llvm/Target/TargetLowering.h

Loading...

llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Loading...

llvm/trunk/lib/Target/X86/X86ISelLowering.h

Loading...

llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp

Loading...

llvm/trunk/test/Transforms/CodeGenPrepare/x86-shuffle-sink.ll

Loading...

Add Comment