-
Notifications
You must be signed in to change notification settings - Fork 0
/
10_0_fix_for_1844.patch
18 lines (17 loc) · 974 Bytes
/
10_0_fix_for_1844.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Fix for #1844, affects avx512skx-x64 and avx512skx-x32.
# It's a port of 11.0 commit edcfb47ff6d5562e22207f364c65f84302aa346b
# https://reviews.llvm.org/D76312
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index f88950fc872..7a68d18ef9b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -11023,7 +11023,9 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
// Attempt to pre-truncate BUILD_VECTOR sources.
if (N0.getOpcode() == ISD::BUILD_VECTOR && !LegalOperations &&
- TLI.isTruncateFree(SrcVT.getScalarType(), VT.getScalarType())) {
+ TLI.isTruncateFree(SrcVT.getScalarType(), VT.getScalarType()) &&
+ // Avoid creating illegal types if running after type legalizer.
+ (!LegalTypes || TLI.isTypeLegal(VT.getScalarType()))) {
SDLoc DL(N);
EVT SVT = VT.getScalarType();
SmallVector<SDValue, 8> TruncOps;