Skip to content

Commit cf1eb16

Browse files
committed
Merge branch 'main' into xegpu-reduction-unit-dim
2 parents b4761de + 8e17f80 commit cf1eb16

File tree

168 files changed

+7888
-6739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+7888
-6739
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

clang/test/PCH/leakfiles.test

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Test that compiling using a PCH doesn't leak file descriptors.
22
// https://bugs.chromium.org/p/chromium/issues/detail?id=924225
33
//
4-
// This test requires bash loops and ulimit.
5-
// REQUIRES: shell
6-
// UNSUPPORTED: target={{.*win32.*}}
4+
// This test uses ulimit.
5+
// UNSUPPORTED: system-windows
76
//
87
// Set up source files. lib/lib.h includes lots of lib*.h files in that dir.
98
// client.c includes lib/lib.h, and also the individual files directly.
@@ -12,10 +11,10 @@
1211
// RUN: mkdir %t
1312
// RUN: cd %t
1413
// RUN: mkdir lib
15-
// RUN: for i in {1..300}; do touch lib/lib$i.h; done
16-
// RUN: for i in {1..300}; do echo "#include \"lib$i.h\"" >> lib/lib.h; done
14+
// RUN: %python -c "from pathlib import Path; list(map(lambda i: Path(f'lib/lib{i}.h').touch(), range(1, 301)))"
15+
// RUN: %python -c "for i in range(1, 301): print(f'#include \"lib{i}.h\"')" > lib/lib.h
1716
// RUN: echo "#include \"lib/lib.h\"" > client.c
18-
// RUN: for i in {1..300}; do echo "#include \"lib/lib$i.h\"" >> client.c; done
17+
// RUN: %python -c "for i in range(1, 301): print(f'#include \"lib/lib{i}.h\"')" > client.c
1918
//
2019
// We want to verify that we don't hold all the files open at the same time.
2120
// This is important e.g. on mac, which has a low default FD limit.

clang/test/SemaCXX/PR51712-large-array-constexpr-check-oom.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Only run this test where ulimit is known to work well.
22
// (There's nothing really platform-specific being tested, this is just ulimit).
33
//
4-
// REQUIRES: shell
54
// REQUIRES: system-linux
65
// UNSUPPORTED: msan
76
// UNSUPPORTED: asan

libcxx/include/__vector/vector.h

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,24 +1161,6 @@ vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args) {
11611161
return this->__end_;
11621162
}
11631163

1164-
// This makes the compiler inline `__else()` if `__cond` is known to be false. Currently LLVM doesn't do that without
1165-
// the `__builtin_constant_p`, since it considers `__else` unlikely even through it's known to be run.
1166-
// See https://llvm.org/PR154292
1167-
template <class _If, class _Else>
1168-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void __if_likely_else(bool __cond, _If __if, _Else __else) {
1169-
if (__builtin_constant_p(__cond)) {
1170-
if (__cond)
1171-
__if();
1172-
else
1173-
__else();
1174-
} else {
1175-
if (__cond) [[__likely__]]
1176-
__if();
1177-
else
1178-
__else();
1179-
}
1180-
}
1181-
11821164
template <class _Tp, class _Allocator>
11831165
template <class... _Args>
11841166
_LIBCPP_CONSTEXPR_SINCE_CXX20 inline
@@ -1189,14 +1171,12 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20 inline
11891171
#endif
11901172
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args) {
11911173
pointer __end = this->__end_;
1192-
std::__if_likely_else(
1193-
__end < this->__cap_,
1194-
[&] {
1195-
__emplace_back_assume_capacity(std::forward<_Args>(__args)...);
1196-
++__end;
1197-
},
1198-
[&] { __end = __emplace_back_slow_path(std::forward<_Args>(__args)...); });
1199-
1174+
if (__end < this->__cap_) {
1175+
__emplace_back_assume_capacity(std::forward<_Args>(__args)...);
1176+
++__end;
1177+
} else {
1178+
__end = __emplace_back_slow_path(std::forward<_Args>(__args)...);
1179+
}
12001180
this->__end_ = __end;
12011181
#if _LIBCPP_STD_VER >= 17
12021182
return *(__end - 1);

lldb/include/lldb/Utility/ArchSpec.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ class ArchSpec {
327327
/// \return a boolean value.
328328
bool IsMIPS() const;
329329

330+
/// If NVPTX architecture return true.
331+
///
332+
/// \return a boolean value.
333+
bool IsNVPTX() const;
334+
330335
/// Returns a string representing current architecture as a target CPU for
331336
/// tools like compiler, disassembler etc.
332337
///

lldb/source/Utility/ArchSpec.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ const char *ArchSpec::GetArchitectureName() const {
545545

546546
bool ArchSpec::IsMIPS() const { return GetTriple().isMIPS(); }
547547

548+
bool ArchSpec::IsNVPTX() const { return GetTriple().isNVPTX(); }
549+
548550
std::string ArchSpec::GetTargetABI() const {
549551

550552
std::string abi;

llvm/include/llvm/ObjectYAML/DXContainerYAML.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct RootDescriptorYaml {
9292
};
9393

9494
struct DescriptorRangeYaml {
95-
uint32_t RangeType;
95+
dxil::ResourceClass RangeType;
9696
uint32_t NumDescriptors;
9797
uint32_t BaseShaderRegister;
9898
uint32_t RegisterSpace;
@@ -111,12 +111,12 @@ struct DescriptorTableYaml {
111111
};
112112

113113
struct RootParameterHeaderYaml {
114-
uint32_t Type;
115-
uint32_t Visibility;
114+
dxbc::RootParameterType Type;
115+
dxbc::ShaderVisibility Visibility;
116116
uint32_t Offset;
117117

118118
RootParameterHeaderYaml(){};
119-
RootParameterHeaderYaml(uint32_t T) : Type(T) {}
119+
RootParameterHeaderYaml(dxbc::RootParameterType T) : Type(T) {}
120120
};
121121

122122
struct RootParameterLocationYaml {
@@ -165,21 +165,19 @@ struct RootParameterYamlDesc {
165165
};
166166

167167
struct StaticSamplerYamlDesc {
168-
uint32_t Filter = llvm::to_underlying(dxbc::SamplerFilter::Anisotropic);
169-
uint32_t AddressU = llvm::to_underlying(dxbc::TextureAddressMode::Wrap);
170-
uint32_t AddressV = llvm::to_underlying(dxbc::TextureAddressMode::Wrap);
171-
uint32_t AddressW = llvm::to_underlying(dxbc::TextureAddressMode::Wrap);
168+
dxbc::SamplerFilter Filter = dxbc::SamplerFilter::Anisotropic;
169+
dxbc::TextureAddressMode AddressU = dxbc::TextureAddressMode::Wrap;
170+
dxbc::TextureAddressMode AddressV = dxbc::TextureAddressMode::Wrap;
171+
dxbc::TextureAddressMode AddressW = dxbc::TextureAddressMode::Wrap;
172172
float MipLODBias = 0.f;
173173
uint32_t MaxAnisotropy = 16u;
174-
uint32_t ComparisonFunc =
175-
llvm::to_underlying(dxbc::ComparisonFunc::LessEqual);
176-
uint32_t BorderColor =
177-
llvm::to_underlying(dxbc::StaticBorderColor::OpaqueWhite);
174+
dxbc::ComparisonFunc ComparisonFunc = dxbc::ComparisonFunc::LessEqual;
175+
dxbc::StaticBorderColor BorderColor = dxbc::StaticBorderColor::OpaqueWhite;
178176
float MinLOD = 0.f;
179177
float MaxLOD = std::numeric_limits<float>::max();
180178
uint32_t ShaderRegister;
181179
uint32_t RegisterSpace;
182-
uint32_t ShaderVisibility;
180+
dxbc::ShaderVisibility ShaderVisibility;
183181
};
184182

185183
struct RootSignatureYamlDesc {
@@ -321,6 +319,13 @@ LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::PSV::ResourceKind)
321319
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::D3DSystemValue)
322320
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::SigComponentType)
323321
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::SigMinPrecision)
322+
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::RootParameterType)
323+
LLVM_YAML_DECLARE_ENUM_TRAITS(dxil::ResourceClass)
324+
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::SamplerFilter)
325+
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::StaticBorderColor)
326+
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::TextureAddressMode)
327+
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::ShaderVisibility)
328+
LLVM_YAML_DECLARE_ENUM_TRAITS(llvm::dxbc::ComparisonFunc)
324329

325330
namespace llvm {
326331

llvm/include/llvm/Support/DXILABI.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ const unsigned MinWaveSize = 4;
102102
const unsigned MaxWaveSize = 128;
103103

104104
LLVM_ABI StringRef getResourceClassName(ResourceClass RC);
105-
106105
} // namespace dxil
107106
} // namespace llvm
108107

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3217,26 +3217,18 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
32173217
}
32183218

32193219
// Try to fold (C1 * D /u C2) -> C1/C2 * D, if C1 and C2 are powers-of-2,
3220-
// D is a multiple of C2, and C1 is a multiple of C2. If C2 is a multiple
3221-
// of C1, fold to (D /u (C2 /u C1)).
3220+
// D is a multiple of C2, and C1 is a multiple of C2.
32223221
const SCEV *D;
32233222
APInt C1V = LHSC->getAPInt();
3224-
// (C1 * D /u C2) == -1 * -C1 * D /u C2 when C1 != INT_MIN. Don't treat -1
3225-
// as -1 * 1, as it won't enable additional folds.
3226-
if (C1V.isNegative() && !C1V.isMinSignedValue() && !C1V.isAllOnes())
3223+
// (C1 * D /u C2) == -1 * -C1 * D /u C2 when C1 != INT_MIN.
3224+
if (C1V.isNegative() && !C1V.isMinSignedValue())
32273225
C1V = C1V.abs();
32283226
const SCEVConstant *C2;
32293227
if (C1V.isPowerOf2() &&
32303228
match(Ops[1], m_scev_UDiv(m_SCEV(D), m_SCEVConstant(C2))) &&
3231-
C2->getAPInt().isPowerOf2() &&
3229+
C2->getAPInt().isPowerOf2() && C1V.uge(C2->getAPInt()) &&
32323230
C1V.logBase2() <= getMinTrailingZeros(D)) {
3233-
const SCEV *NewMul;
3234-
if (C1V.uge(C2->getAPInt())) {
3235-
NewMul = getMulExpr(getUDivExpr(getConstant(C1V), C2), D);
3236-
} else {
3237-
assert(C1V.ugt(1) && "C1 <= 1 should have been folded earlier");
3238-
NewMul = getUDivExpr(D, getUDivExpr(C2, getConstant(C1V)));
3239-
}
3231+
const SCEV *NewMul = getMulExpr(getUDivExpr(getConstant(C1V), C2), D);
32403232
return C1V == LHSC->getAPInt() ? NewMul : getNegativeSCEV(NewMul);
32413233
}
32423234
}

llvm/lib/IR/Intrinsics.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -740,14 +740,6 @@ Intrinsic::ID Intrinsic::lookupIntrinsicID(StringRef Name) {
740740
#include "llvm/IR/IntrinsicImpl.inc"
741741
#undef GET_INTRINSIC_ATTRIBUTES
742742

743-
AttributeSet Intrinsic::getFnAttributes(LLVMContext &C, ID id) {
744-
if (id == 0)
745-
return AttributeSet();
746-
uint16_t PackedID = IntrinsicsToAttributesMap[id - 1];
747-
uint8_t FnAttrID = PackedID >> 8;
748-
return getIntrinsicFnAttributeSet(C, FnAttrID);
749-
}
750-
751743
Function *Intrinsic::getOrInsertDeclaration(Module *M, ID id,
752744
ArrayRef<Type *> Tys) {
753745
// There can never be multiple globals with the same name of different types,

0 commit comments

Comments
 (0)