OSDN Git Service

[SelectionDAG][X86] Don't use ->getValueType(0) after a call to getOperand to get...
authorCraig Topper <craig.topper@intel.com>
Sat, 23 Dec 2017 02:54:50 +0000 (02:54 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 23 Dec 2017 02:54:50 +0000 (02:54 +0000)
commit3a056544bbbbdc1691921ca3ce313f0ce91d0c2e
tree41a4f3647691ba8c24c74f59becf699b67aa1fe6
parente1b8f14c6dd0b254a547f03a5dfd6fee6249f847
[SelectionDAG][X86] Don't use ->getValueType(0) after a call to getOperand to get the type of the operand.

getOperand returns an SDValue that contains the node and the result number. There is no guarantee that the result number if 0. By using the -> operator we are calling SDNode::getValueType rather than SDValue::getValueType. This requires supplying a result number and we shouldn't assume it was 0.

I don't have a test case. Just noticed while cleaning up some other code and saw that it occurred in other places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321397 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/Target/X86/X86ISelLowering.cpp