[PATCH] D36649: [X86][ARM][TargetLowering] Add SrcVT to isExtractSubvectorCheap
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 13 10:30:18 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL310793: [X86][ARM][TargetLowering] Add SrcVT to isExtractSubvectorCheap (authored by ctopper).
Changed prior to commit:
https://reviews.llvm.org/D36649?vs=110858&id=110879#toc
Repository:
rL LLVM
https://reviews.llvm.org/D36649
Files:
llvm/trunk/include/llvm/Target/TargetLowering.h
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
llvm/trunk/lib/Target/ARM/ARMISelLowering.h
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.h
Index: llvm/trunk/include/llvm/Target/TargetLowering.h
===================================================================
--- llvm/trunk/include/llvm/Target/TargetLowering.h
+++ llvm/trunk/include/llvm/Target/TargetLowering.h
@@ -2172,11 +2172,12 @@
return false;
}
- /// Return true if EXTRACT_SUBVECTOR is cheap for this result type
- /// with this index. This is needed because EXTRACT_SUBVECTOR usually
- /// has custom lowering that depends on the index of the first element,
- /// and only the target knows which lowering is cheap.
- virtual bool isExtractSubvectorCheap(EVT ResVT, unsigned Index) const {
+ /// Return true if EXTRACT_SUBVECTOR is cheap for extracting this result type
+ /// from this source type with this index. This is needed because
+ /// EXTRACT_SUBVECTOR usually has custom lowering that depends on the index of
+ /// the first element, and only the target knows which lowering is cheap.
+ virtual bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
+ unsigned Index) const {
return false;
}
Index: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
@@ -4574,7 +4574,7 @@
return true;
}
-bool X86TargetLowering::isExtractSubvectorCheap(EVT ResVT,
+bool X86TargetLowering::isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
unsigned Index) const {
if (!isOperationLegalOrCustom(ISD::EXTRACT_SUBVECTOR, ResVT))
return false;
Index: llvm/trunk/lib/Target/X86/X86ISelLowering.h
===================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h
@@ -1036,7 +1036,8 @@
/// Return true if EXTRACT_SUBVECTOR is cheap for this result type
/// with this index.
- bool isExtractSubvectorCheap(EVT ResVT, unsigned Index) const override;
+ bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
+ unsigned Index) const override;
/// Intel processors have a unified instruction and data cache
const char * getClearCacheBuiltinName() const override {
Index: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
@@ -13402,7 +13402,7 @@
return true;
}
-bool ARMTargetLowering::isExtractSubvectorCheap(EVT ResVT,
+bool ARMTargetLowering::isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
unsigned Index) const {
if (!isOperationLegalOrCustom(ISD::EXTRACT_SUBVECTOR, ResVT))
return false;
Index: llvm/trunk/lib/Target/ARM/ARMISelLowering.h
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.h
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.h
@@ -459,7 +459,8 @@
/// Return true if EXTRACT_SUBVECTOR is cheap for this result type
/// with this index.
- bool isExtractSubvectorCheap(EVT ResVT, unsigned Index) const override;
+ bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
+ unsigned Index) const override;
/// \brief Returns true if an argument of type Ty needs to be passed in a
/// contiguous block of registers in calling convention CallConv.
Index: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -14212,7 +14212,7 @@
VecIn1 = DAG.getNode(ISD::CONCAT_VECTORS, DL, VT, ConcatOps);
VecIn2 = SDValue();
} else if (InVT1.getSizeInBits() == VT.getSizeInBits() * 2) {
- if (!TLI.isExtractSubvectorCheap(VT, NumElems))
+ if (!TLI.isExtractSubvectorCheap(VT, InVT1, NumElems))
return SDValue();
if (!VecIn2.getNode()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36649.110879.patch
Type: text/x-patch
Size: 4153 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170813/f919ef16/attachment.bin>
More information about the llvm-commits
mailing list