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

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Apr 16 07:34:21 PDT 2010


On Apr 15, 2010, at 11:14 PM, Evan Cheng wrote:

> +static SDValue PromoteOperand(SDValue Op, EVT PVT, SelectionDAG &DAG) {
> +  unsigned Opc = ISD::ZERO_EXTEND;
> +  if (Op.getOpcode() == ISD::Constant) {
> +    // Zero extend things like i1, sign extend everything else.  It shouldn't
> +    // matter in theory which one we pick, but this tends to give better code?
> +    // See DAGTypeLegalizer::PromoteIntRes_Constant.
> +    if (Op.getValueType().isByteSized())
> +      Opc = ISD::SIGN_EXTEND;
> +  }
> +  return DAG.getNode(Opc, Op.getDebugLoc(), PVT, Op);
> +}

Should this be using ANY_EXTEND?





More information about the llvm-commits mailing list