Skip to content

Commit c4a99e6

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:89d0937348ebd4b55f17d503910be9300aa44a13 into amd-gfx:414c0c907997
Local branch amd-gfx 414c0c9 Merged main:d102ee63e849cdaa586fd1aaae900c1399bf2b76 into amd-gfx:4b601c68e317 Remote branch main 89d0937 [llvm] Use StringRef::contains (NFC) (llvm#92710)
2 parents 414c0c9 + 89d0937 commit c4a99e6

File tree

6 files changed

+60
-7
lines changed

6 files changed

+60
-7
lines changed

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 499147
19+
#define LLVM_MAIN_REVISION 499149
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,6 +3033,7 @@ bool DAGTypeLegalizer::SplitVectorOperand(SDNode *N, unsigned OpNo) {
30333033
"operand!\n");
30343034

30353035
case ISD::VP_SETCC:
3036+
case ISD::STRICT_FSETCC:
30363037
case ISD::SETCC: Res = SplitVecOp_VSETCC(N); break;
30373038
case ISD::BITCAST: Res = SplitVecOp_BITCAST(N); break;
30383039
case ISD::EXTRACT_SUBVECTOR: Res = SplitVecOp_EXTRACT_SUBVECTOR(N); break;
@@ -3997,14 +3998,16 @@ SDValue DAGTypeLegalizer::SplitVecOp_TruncateHelper(SDNode *N) {
39973998
}
39983999

39994000
SDValue DAGTypeLegalizer::SplitVecOp_VSETCC(SDNode *N) {
4001+
bool isStrict = N->getOpcode() == ISD::STRICT_FSETCC;
40004002
assert(N->getValueType(0).isVector() &&
4001-
N->getOperand(0).getValueType().isVector() &&
4003+
N->getOperand(isStrict ? 1 : 0).getValueType().isVector() &&
40024004
"Operand types must be vectors");
40034005
// The result has a legal vector type, but the input needs splitting.
40044006
SDValue Lo0, Hi0, Lo1, Hi1, LoRes, HiRes;
40054007
SDLoc DL(N);
4006-
GetSplitVector(N->getOperand(0), Lo0, Hi0);
4007-
GetSplitVector(N->getOperand(1), Lo1, Hi1);
4008+
GetSplitVector(N->getOperand(isStrict ? 1 : 0), Lo0, Hi0);
4009+
GetSplitVector(N->getOperand(isStrict ? 2 : 1), Lo1, Hi1);
4010+
40084011
auto PartEltCnt = Lo0.getValueType().getVectorElementCount();
40094012

40104013
LLVMContext &Context = *DAG.getContext();
@@ -4014,6 +4017,16 @@ SDValue DAGTypeLegalizer::SplitVecOp_VSETCC(SDNode *N) {
40144017
if (N->getOpcode() == ISD::SETCC) {
40154018
LoRes = DAG.getNode(ISD::SETCC, DL, PartResVT, Lo0, Lo1, N->getOperand(2));
40164019
HiRes = DAG.getNode(ISD::SETCC, DL, PartResVT, Hi0, Hi1, N->getOperand(2));
4020+
} else if (N->getOpcode() == ISD::STRICT_FSETCC) {
4021+
LoRes = DAG.getNode(ISD::STRICT_FSETCC, DL,
4022+
DAG.getVTList(PartResVT, N->getValueType(1)),
4023+
N->getOperand(0), Lo0, Lo1, N->getOperand(3));
4024+
HiRes = DAG.getNode(ISD::STRICT_FSETCC, DL,
4025+
DAG.getVTList(PartResVT, N->getValueType(1)),
4026+
N->getOperand(0), Hi0, Hi1, N->getOperand(3));
4027+
SDValue NewChain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other,
4028+
LoRes.getValue(1), HiRes.getValue(1));
4029+
ReplaceValueWith(SDValue(N, 1), NewChain);
40174030
} else {
40184031
assert(N->getOpcode() == ISD::VP_SETCC && "Expected VP_SETCC opcode");
40194032
SDValue MaskLo, MaskHi, EVLLo, EVLHi;

llvm/lib/IR/Mangler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void llvm::emitLinkerFlagsForUsedCOFF(raw_ostream &OS, const GlobalValue *GV,
292292

293293
std::optional<std::string> llvm::getArm64ECMangledFunctionName(StringRef Name) {
294294
bool IsCppFn = Name[0] == '?';
295-
if (IsCppFn && Name.find("$$h") != std::string::npos)
295+
if (IsCppFn && Name.contains("$$h"))
296296
return std::nullopt;
297297
if (!IsCppFn && Name[0] == '#')
298298
return std::nullopt;

llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1886,7 +1886,7 @@ static bool buildEnqueueKernel(const SPIRV::IncomingCall *Call,
18861886
// Local sizes arguments: Sizes of block invoke arguments. Clang generates
18871887
// local size operands as an array, so we need to unpack them.
18881888
SmallVector<Register, 16> LocalSizes;
1889-
if (Call->Builtin->Name.find("_varargs") != StringRef::npos || IsSpirvOp) {
1889+
if (Call->Builtin->Name.contains("_varargs") || IsSpirvOp) {
18901890
const unsigned LocalSizeArrayIdx = HasEvents ? 9 : 6;
18911891
Register GepReg = Call->Arguments[LocalSizeArrayIdx];
18921892
MachineInstr *GepMI = MRI->getUniqueVRegDef(GepReg);

llvm/lib/TextAPI/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ llvm::Expected<Regex> llvm::MachO::createRegexFromGlob(StringRef Glob) {
184184
break;
185185
}
186186
default:
187-
if (RegexMetachars.find(C) != StringRef::npos)
187+
if (RegexMetachars.contains(C))
188188
RegexString.push_back('\\');
189189
RegexString.push_back(C);
190190
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc < %s -mtriple=x86_64 -mcpu=skx | FileCheck %s --check-prefixes=SKX
3+
4+
;; Test no crash for AVX512 targets without prefer-vector-width=512.
5+
6+
define <16 x i32> @test_v16f32_oeq_q(<16 x i32> %a, <16 x i32> %b, <16 x float> %f1, <16 x float> %f2) #0 {
7+
; SKX-LABEL: test_v16f32_oeq_q:
8+
; SKX: # %bb.0:
9+
; SKX-NEXT: vcmpeqps %ymm7, %ymm5, %k1
10+
; SKX-NEXT: vcmpeqps %ymm6, %ymm4, %k2
11+
; SKX-NEXT: vpblendmd %ymm0, %ymm2, %ymm0 {%k2}
12+
; SKX-NEXT: vpblendmd %ymm1, %ymm3, %ymm1 {%k1}
13+
; SKX-NEXT: retq
14+
%cond = call <16 x i1> @llvm.experimental.constrained.fcmp.v16f32(
15+
<16 x float> %f1, <16 x float> %f2, metadata !"oeq",
16+
metadata !"fpexcept.strict") #0
17+
%res = select <16 x i1> %cond, <16 x i32> %a, <16 x i32> %b
18+
ret <16 x i32> %res
19+
}
20+
21+
define <8 x i32> @test_v8f64_oeq_q(<8 x i32> %a, <8 x i32> %b, <8 x double> %f1, <8 x double> %f2) #0 {
22+
; SKX-LABEL: test_v8f64_oeq_q:
23+
; SKX: # %bb.0:
24+
; SKX-NEXT: vcmpeqpd %ymm4, %ymm2, %k0
25+
; SKX-NEXT: vcmpeqpd %ymm5, %ymm3, %k1
26+
; SKX-NEXT: kshiftlb $4, %k1, %k1
27+
; SKX-NEXT: korb %k1, %k0, %k1
28+
; SKX-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
29+
; SKX-NEXT: retq
30+
%cond = call <8 x i1> @llvm.experimental.constrained.fcmp.v8f64(
31+
<8 x double> %f1, <8 x double> %f2, metadata !"oeq",
32+
metadata !"fpexcept.strict") #0
33+
%res = select <8 x i1> %cond, <8 x i32> %a, <8 x i32> %b
34+
ret <8 x i32> %res
35+
}
36+
37+
declare <16 x i1> @llvm.experimental.constrained.fcmp.v16f32(<16 x float>, <16 x float>, metadata, metadata)
38+
declare <8 x i1> @llvm.experimental.constrained.fcmp.v8f64(<8 x double>, <8 x double>, metadata, metadata)
39+
40+
attributes #0 = { nounwind strictfp "min-legal-vector-width"="0" }

0 commit comments

Comments
 (0)