[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

Duncan Sands baldrick at free.fr
Sat Apr 18 10:00:44 PDT 2009


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.

Ciao,

Duncan.



More information about the llvm-commits mailing list