[llvm] r374972 - [LegalizeTypes] Don't use PromoteTargetBoolean in WidenVecOp_SETCC.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 20:29:25 PDT 2019


Author: ctopper
Date: Tue Oct 15 20:29:24 2019
New Revision: 374972

URL: http://llvm.org/viewvc/llvm-project?rev=374972&view=rev
Log:
[LegalizeTypes] Don't use PromoteTargetBoolean in WidenVecOp_SETCC.

Similar to r374970, but I don't have a test for this.

PromoteTargetBoolean is intended to be use for legalizing an
operand that needs to be promoted. It picks its type based on
the return from getSetccResultType and is intended to be used
when we have freedom to pick the new type. But the return type
we need for WidenVecOp_SETCC is completely determined by the
type of the input node.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp?rev=374972&r1=374971&r2=374972&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Tue Oct 15 20:29:24 2019
@@ -4574,7 +4574,10 @@ SDValue DAGTypeLegalizer::WidenVecOp_SET
       ISD::EXTRACT_SUBVECTOR, dl, ResVT, WideSETCC,
       DAG.getConstant(0, dl, TLI.getVectorIdxTy(DAG.getDataLayout())));
 
-  return PromoteTargetBoolean(CC, VT);
+  EVT OpVT = N->getOperand(0).getValueType();
+  ISD::NodeType ExtendCode =
+      TargetLowering::getExtendForContent(TLI.getBooleanContents(OpVT));
+  return DAG.getNode(ExtendCode, dl, VT, CC);
 }
 
 SDValue DAGTypeLegalizer::WidenVecOp_VECREDUCE(SDNode *N) {




More information about the llvm-commits mailing list