[llvm-commits] [llvm] r58426 - in /llvm/trunk: include/llvm/Target/TargetLowering.h lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeTypes.h lib/CodeGen/SelectionDAG/TargetLowering.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h

Duncan Sands duncan.sands at math.u-psud.fr
Thu Oct 30 01:53:09 PDT 2008


Hi,

> BTW,  Dan and I noticed that for OperationAction, Promote is used to  
> change vector types, e.g., for AND on X86, it can promote v16i8 to  
> v2i64.  This doesn't interfere with widening but I mention it as  
> another use of LegalizeAction promote though in a different context.   
> Maybe we should split LegalizeAction into two different enumerations,  
> one for for LegalizeTypes and one for OperationAction.

this is effectively already the case for LegalizeTypes: it has its
own enumeration:

  enum LegalizeAction {
    Legal,           // The target natively supports this type.
    PromoteInteger,  // Replace this integer type with a larger one.
    ExpandInteger,   // Split this integer type into two of half the size.
    SoftenFloat,     // Convert this float type to a same size integer type.
    ExpandFloat,     // Split this float type into two of half the size.
    ScalarizeVector, // Replace this one-element vector with its element type.
    SplitVector      // This vector type should be split into smaller vectors.
  };

It translates the traditional type action into one of these by looking at
details of the type.  When the type legalization code is finally removed from
LegalizeDAG, I think it would make sense to move this enumeration type to
TargetLowering and use it directly for type legalization methods, and have the
old LegalizeAction be only for operation legalization.

Ciao,

Duncan.



More information about the llvm-commits mailing list