Skip to content

Commit 5fe9e82

Browse files
committed
Fixed failing test.
1 parent 8dff19f commit 5fe9e82

File tree

3 files changed

+15
-39
lines changed

3 files changed

+15
-39
lines changed

clang/test/Misc/target-invalid-cpu-note.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@
8585

8686
// RUN: not %clang_cc1 -triple riscv64 -target-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix RISCV64
8787
// RISCV64: error: unknown target CPU 'not-a-cpu'
88-
// RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280{{$}}
88+
// RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1{{$}}
8989

9090
// RUN: not %clang_cc1 -triple riscv32 -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE-RISCV32
9191
// TUNE-RISCV32: error: unknown target CPU 'not-a-cpu'
9292
// TUNE-RISCV32-NEXT: note: valid target CPU values are: generic-rv32, rocket-rv32, sifive-e20, sifive-e21, sifive-e24, sifive-e31, sifive-e34, sifive-e76, syntacore-scr1-base, syntacore-scr1-max, generic, rocket, sifive-7-series{{$}}
9393

9494
// RUN: not %clang_cc1 -triple riscv64 -tune-cpu not-a-cpu -fsyntax-only %s 2>&1 | FileCheck %s --check-prefix TUNE-RISCV64
9595
// TUNE-RISCV64: error: unknown target CPU 'not-a-cpu'
96-
// TUNE-RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, generic, rocket, sifive-7-series, veyron-v1{{$}}
96+
// TUNE-RISCV64-NEXT: note: valid target CPU values are: generic-rv64, rocket-rv64, sifive-s21, sifive-s51, sifive-s54, sifive-s76, sifive-u54, sifive-u74, sifive-x280, veyron-v1, generic, rocket, sifive-7-series{{$}}

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11633,39 +11633,15 @@ static SDValue performXORCombine(SDNode *N, SelectionDAG &DAG,
1163311633
return combineSelectAndUseCommutative(N, DAG, /*AllOnes*/ false, Subtarget);
1163411634
}
1163511635

11636-
/// According to the property that indexed load/store instructions zero-extend
11637-
/// their indices, try to narrow the type of index operand.
11636+
// According to the property that indexed load/store instructions
11637+
// zero-extended their indices, \p narrowIndex tries to narrow the type of index
11638+
// operand if it is matched to pattern (shl (zext x to ty), C) and bits(x) + C <
11639+
// bits(ty).
1163811640
static bool narrowIndex(SDValue &N, ISD::MemIndexType IndexType, SelectionDAG &DAG) {
1163911641
if (isIndexTypeSigned(IndexType))
1164011642
return false;
1164111643

11642-
if (!N->hasOneUse())
11643-
return false;
11644-
11645-
EVT VT = N.getValueType();
11646-
SDLoc DL(N);
11647-
11648-
// In general, what we're doing here is seeing if we can sink a truncate to
11649-
// a smaller element type into the expression tree building our index.
11650-
// TODO: We can generalize this and handle a bunch more cases if useful.
11651-
11652-
// Narrow a buildvector to the narrowest element type. This requires less
11653-
// work and less register pressure at high LMUL, and creates smaller constants
11654-
// which may be cheaper to materialize.
11655-
if (ISD::isBuildVectorOfConstantSDNodes(N.getNode())) {
11656-
KnownBits Known = DAG.computeKnownBits(N);
11657-
unsigned ActiveBits = std::max(8u, Known.countMaxActiveBits());
11658-
LLVMContext &C = *DAG.getContext();
11659-
EVT ResultVT = EVT::getIntegerVT(C, ActiveBits).getRoundIntegerType(C);
11660-
if (ResultVT.bitsLT(VT.getVectorElementType())) {
11661-
N = DAG.getNode(ISD::TRUNCATE, DL,
11662-
VT.changeVectorElementType(ResultVT), N);
11663-
return true;
11664-
}
11665-
}
11666-
11667-
// Handle the pattern (shl (zext x to ty), C) and bits(x) + C < bits(ty).
11668-
if (N.getOpcode() != ISD::SHL)
11644+
if (N.getOpcode() != ISD::SHL || !N->hasOneUse())
1166911645
return false;
1167011646

1167111647
SDValue N0 = N.getOperand(0);

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-gather.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13027,17 +13027,17 @@ define <8 x i16> @mgather_strided_2xSEW(ptr %base) {
1302713027
; RV32-NEXT: lui a1, %hi(.LCPI107_0)
1302813028
; RV32-NEXT: addi a1, a1, %lo(.LCPI107_0)
1302913029
; RV32-NEXT: vsetivli zero, 8, e16, m1, ta, ma
13030-
; RV32-NEXT: vle8.v v9, (a1)
13031-
; RV32-NEXT: vluxei8.v v8, (a0), v9
13030+
; RV32-NEXT: vle32.v v10, (a1)
13031+
; RV32-NEXT: vluxei32.v v8, (a0), v10
1303213032
; RV32-NEXT: ret
1303313033
;
1303413034
; RV64V-LABEL: mgather_strided_2xSEW:
1303513035
; RV64V: # %bb.0:
1303613036
; RV64V-NEXT: lui a1, %hi(.LCPI107_0)
1303713037
; RV64V-NEXT: addi a1, a1, %lo(.LCPI107_0)
1303813038
; RV64V-NEXT: vsetivli zero, 8, e16, m1, ta, ma
13039-
; RV64V-NEXT: vle8.v v9, (a1)
13040-
; RV64V-NEXT: vluxei8.v v8, (a0), v9
13039+
; RV64V-NEXT: vle64.v v12, (a1)
13040+
; RV64V-NEXT: vluxei64.v v8, (a0), v12
1304113041
; RV64V-NEXT: ret
1304213042
;
1304313043
; RV64ZVE32F-LABEL: mgather_strided_2xSEW:
@@ -13144,17 +13144,17 @@ define <8 x i16> @mgather_gather_2xSEW(ptr %base) {
1314413144
; RV32-NEXT: lui a1, %hi(.LCPI108_0)
1314513145
; RV32-NEXT: addi a1, a1, %lo(.LCPI108_0)
1314613146
; RV32-NEXT: vsetivli zero, 8, e16, m1, ta, ma
13147-
; RV32-NEXT: vle8.v v9, (a1)
13148-
; RV32-NEXT: vluxei8.v v8, (a0), v9
13147+
; RV32-NEXT: vle32.v v10, (a1)
13148+
; RV32-NEXT: vluxei32.v v8, (a0), v10
1314913149
; RV32-NEXT: ret
1315013150
;
1315113151
; RV64V-LABEL: mgather_gather_2xSEW:
1315213152
; RV64V: # %bb.0:
1315313153
; RV64V-NEXT: lui a1, %hi(.LCPI108_0)
1315413154
; RV64V-NEXT: addi a1, a1, %lo(.LCPI108_0)
1315513155
; RV64V-NEXT: vsetivli zero, 8, e16, m1, ta, ma
13156-
; RV64V-NEXT: vle8.v v9, (a1)
13157-
; RV64V-NEXT: vluxei8.v v8, (a0), v9
13156+
; RV64V-NEXT: vle64.v v12, (a1)
13157+
; RV64V-NEXT: vluxei64.v v8, (a0), v12
1315813158
; RV64V-NEXT: ret
1315913159
;
1316013160
; RV64ZVE32F-LABEL: mgather_gather_2xSEW:

0 commit comments

Comments
 (0)