[PATCH] D54285: [DAGCombiner] Enable tryToFoldExtendOfConstant to run after legalize vector ops
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 12 18:03:21 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346728: [DAGCombiner] Enable tryToFoldExtendOfConstant to run after legalize vector ops (authored by ctopper, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D54285
Files:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -8023,8 +8023,7 @@
/// Vector extends are not folded if operations are legal; this is to
/// avoid introducing illegal build_vector dag nodes.
static SDValue tryToFoldExtendOfConstant(SDNode *N, const TargetLowering &TLI,
- SelectionDAG &DAG, bool LegalTypes,
- bool LegalOperations) {
+ SelectionDAG &DAG, bool LegalTypes) {
unsigned Opcode = N->getOpcode();
SDValue N0 = N->getOperand(0);
EVT VT = N->getValueType(0);
@@ -8044,8 +8043,7 @@
// fold (zext (build_vector AllConstants) -> (build_vector AllConstants)
// fold (aext (build_vector AllConstants) -> (build_vector AllConstants)
EVT SVT = VT.getScalarType();
- if (!(VT.isVector() &&
- (!LegalTypes || (!LegalOperations && TLI.isTypeLegal(SVT))) &&
+ if (!(VT.isVector() && (!LegalTypes || TLI.isTypeLegal(SVT)) &&
ISD::isBuildVectorOfConstantSDNodes(N0.getNode())))
return SDValue();
@@ -8479,8 +8477,7 @@
EVT VT = N->getValueType(0);
SDLoc DL(N);
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes,
- LegalOperations))
+ if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
return Res;
// fold (sext (sext x)) -> (sext x)
@@ -8718,8 +8715,7 @@
SDValue N0 = N->getOperand(0);
EVT VT = N->getValueType(0);
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes,
- LegalOperations))
+ if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
return Res;
// fold (zext (zext x)) -> (zext x)
@@ -8968,8 +8964,7 @@
SDValue N0 = N->getOperand(0);
EVT VT = N->getValueType(0);
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes,
- LegalOperations))
+ if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
return Res;
// fold (aext (aext x)) -> (aext x)
@@ -9495,8 +9490,7 @@
if (N0.isUndef())
return DAG.getUNDEF(VT);
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes,
- LegalOperations))
+ if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
return Res;
return SDValue();
@@ -9509,8 +9503,7 @@
if (N0.isUndef())
return DAG.getUNDEF(VT);
- if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes,
- LegalOperations))
+ if (SDValue Res = tryToFoldExtendOfConstant(N, TLI, DAG, LegalTypes))
return Res;
return SDValue();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54285.173803.patch
Type: text/x-patch
Size: 2954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/ba6c83c3/attachment.bin>
More information about the llvm-commits
mailing list