[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
Evan Cheng
evan.cheng at apple.com
Fri Apr 16 11:12:53 PDT 2010
On Apr 16, 2010, at 7:34 AM, Jakob Stoklund Olesen wrote:
>
> 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?
>
Yes, of course.
Evan
More information about the llvm-commits
mailing list