[llvm-commits] [llvm] r68996 - in /llvm/trunk: include/llvm/CodeGen/SelectionDAGNodes.h lib/CodeGen/SelectionDAG/DAGCombiner.cpp lib/CodeGen/SelectionDAG/LegalizeDAG.cpp lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Bob Wilson
bob.wilson at apple.com
Sat Apr 18 21:40:03 PDT 2009
On Apr 18, 2009, at 10:00 AM, Duncan Sands wrote:
> Hi Bill, I noticed that in the DAG combiner part you do:
>
> if (Op.getValueType() != SrcEltVT) {
> if (Op.getOpcode() == ISD::UNDEF)
> Op = DAG.getUNDEF(SrcEltVT);
> else
> Op = DAG.getNode(ISD::TRUNCATE, BV->getDebugLoc(),
> SrcEltVT, Op);
> }
>
> I think this can just be
>
> if (Op.getValueType() != SrcEltVT)
> Op = DAG.getNode(ISD::TRUNCATE, BV->getDebugLoc(), SrcEltVT,
> Op);
>
> because the UNDEF case should be handled automatically by DAG.getNode,
> or if not by the DAG combiner.
OK. I had checked the DAG.getNode code and it didn't seem to handle
this case. I will take your word for it that the DAG combiner will
take care of it. Thanks!
More information about the llvm-commits
mailing list