[LLVMdev] X86 isTargetShuffle Question

dag at cray.com dag at cray.com
Wed Aug 1 09:54:58 PDT 2012


We're working on integrating LLVM 3.1 and integrating our AVX
improvements which we hope to send upstream.  I am trying to make sure
we do't lose functionality of performance.

Somewhere between LLVM 2.9 and LLVM 3.1 a bunch of opcodes got removed
from isTargetShuffle in X86ISelLowering.cpp.  It looks like at one point
isTargetShuffle got removed completely so it is very difficult to mine
the history from the svn logs.

isTargetShuffle seems to be used in pretty important places:

static SDValue getShuffleScalarElt(SDNode *N, unsigned Index, SelectionDAG &DAG,
                                   unsigned Depth) {
[...]
  // Recurse into target specific vector shuffles to find scalars.
  if (isTargetShuffle(Opcode)) {
[...]
}

/// XFormVExtractWithShuffleIntoLoad - Check if a vector extract from a target
/// specific shuffle of a load can be folded into a single element load.
/// Similar handling for VECTOR_SHUFFLE is performed by DAGCombiner, but
/// shuffles have been customed lowered so we need to handle those here.
static SDValue XFormVExtractWithShuffleIntoLoad(SDNode *N, SelectionDAG &DAG,
                                         TargetLowering::DAGCombinerInfo &DCI) {
[...]
  if (!isTargetShuffle(InVec.getOpcode()))
    return SDValue();
[...]
}

It seems like we'd want to be able to "find scalars" or fold loads in as
many different kinds of shuffle as possible.  But a whole bunch went
missing between 2.9 and 3.1, particularly AVX shuffles.

Can someone explain what happened here?  Is the previous functionality
implemented in some other way?  I'm trying to decide if I have to
restore some things.

Thanks!

                           -Dave



More information about the llvm-dev mailing list