[llvm] r262852 - DAGCombiner: Check legality before creating extract_vector_elt
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 7 13:10:09 PST 2016
Author: arsenm
Date: Mon Mar 7 15:10:09 2016
New Revision: 262852
URL: http://llvm.org/viewvc/llvm-project?rev=262852&view=rev
Log:
DAGCombiner: Check legality before creating extract_vector_elt
Problem not hit by any in tree target.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=262852&r1=262851&r2=262852&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Mar 7 15:10:09 2016
@@ -7207,7 +7207,9 @@ SDValue DAGCombiner::visitTRUNCATE(SDNod
if (N0.getOpcode() == ISD::BITCAST && !VT.isVector()) {
SDValue VecSrc = N0.getOperand(0);
EVT SrcVT = VecSrc.getValueType();
- if (SrcVT.isVector() && SrcVT.getScalarType() == VT) {
+ if (SrcVT.isVector() && SrcVT.getScalarType() == VT &&
+ (!LegalOperations ||
+ TLI.isOperationLegal(ISD::EXTRACT_VECTOR_ELT, SrcVT))) {
SDLoc SL(N);
EVT IdxVT = TLI.getVectorIdxTy(DAG.getDataLayout());
More information about the llvm-commits
mailing list