summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch')
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch61
1 files changed, 0 insertions, 61 deletions
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch
deleted file mode 100644
index e03c279f..00000000
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm10-0013-ispc-10_0_k_reg_mov_avx512_i8_i16.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1From 9cdff0785d5cf9effc8e922d3330311c4d3dda78 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Fri, 27 Aug 2021 12:09:42 +0800
4Subject: [PATCH 2/2] This patch is needed for avx512skx-i8x64 and
5 avx512skx-i16x32 targets.
6
7This is combination of two commits:
8- 0cd6712a7af0fa2702b5d4cc733500eb5e62e7d0 - stability fix.
9- d8ad7cc0885f32104a7cd83c77191aec15fd684f - performance follow up.
10
11Upstream-Status: Backport
12
13Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
14---
15 llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 23 +++++++++++++++++--
16 1 file changed, 21 insertions(+), 2 deletions(-)
17
18diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
19index 439a8367dabe..b1639c7f275d 100644
20--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
21+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
22@@ -18471,6 +18471,26 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
23
24 // Allow targets to opt-out.
25 EVT VT = Extract->getValueType(0);
26+
27+ // We can only create byte sized loads.
28+ if (!VT.isByteSized())
29+ return SDValue();
30+
31+ unsigned Index = ExtIdx->getZExtValue();
32+ unsigned NumElts = VT.getVectorNumElements();
33+
34+ // If the index is a multiple of the extract element count, we can offset the
35+ // address by the store size multiplied by the subvector index. Otherwise if
36+ // the scalar type is byte sized, we can just use the index multiplied by
37+ // the element size in bytes as the offset.
38+ unsigned Offset;
39+ if (Index % NumElts == 0)
40+ Offset = (Index / NumElts) * VT.getStoreSize();
41+ else if (VT.getScalarType().isByteSized())
42+ Offset = Index * VT.getScalarType().getStoreSize();
43+ else
44+ return SDValue();
45+
46 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
47 if (!TLI.shouldReduceLoadWidth(Ld, Ld->getExtensionType(), VT))
48 return SDValue();
49@@ -18478,8 +18498,7 @@ static SDValue narrowExtractedVectorLoad(SDNode *Extract, SelectionDAG &DAG) {
50 // The narrow load will be offset from the base address of the old load if
51 // we are extracting from something besides index 0 (little-endian).
52 SDLoc DL(Extract);
53- SDValue BaseAddr = Ld->getOperand(1);
54- unsigned Offset = ExtIdx->getZExtValue() * VT.getScalarType().getStoreSize();
55+ SDValue BaseAddr = Ld->getBasePtr();
56
57 // TODO: Use "BaseIndexOffset" to make this more effective.
58 SDValue NewAddr = DAG.getMemBasePlusOffset(BaseAddr, Offset, DL);
59--
602.17.1
61