Skip to content

Commit 7af3f50

Browse files
authored
Merge branch 'main' into bytecode-bmi-elementwise
2 parents dc8513e + 0fc972d commit 7af3f50

File tree

6 files changed

+46
-204
lines changed

6 files changed

+46
-204
lines changed

clang/lib/Headers/avxintrin.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2311,10 +2311,9 @@ _mm256_cvttps_epi32(__m256 __a)
23112311
/// \param __a
23122312
/// A 256-bit vector of [4 x double].
23132313
/// \returns A 64 bit double containing the first element of the input vector.
2314-
static __inline double __DEFAULT_FN_ATTRS
2315-
_mm256_cvtsd_f64(__m256d __a)
2316-
{
2317-
return __a[0];
2314+
static __inline double __DEFAULT_FN_ATTRS_CONSTEXPR
2315+
_mm256_cvtsd_f64(__m256d __a) {
2316+
return __a[0];
23182317
}
23192318

23202319
/// Returns the first element of the input vector of [8 x i32].
@@ -2327,11 +2326,10 @@ _mm256_cvtsd_f64(__m256d __a)
23272326
/// \param __a
23282327
/// A 256-bit vector of [8 x i32].
23292328
/// \returns A 32 bit integer containing the first element of the input vector.
2330-
static __inline int __DEFAULT_FN_ATTRS
2331-
_mm256_cvtsi256_si32(__m256i __a)
2332-
{
2333-
__v8si __b = (__v8si)__a;
2334-
return __b[0];
2329+
static __inline int __DEFAULT_FN_ATTRS_CONSTEXPR
2330+
_mm256_cvtsi256_si32(__m256i __a) {
2331+
__v8si __b = (__v8si)__a;
2332+
return __b[0];
23352333
}
23362334

23372335
/// Returns the first element of the input vector of [8 x float].
@@ -2344,10 +2342,9 @@ _mm256_cvtsi256_si32(__m256i __a)
23442342
/// \param __a
23452343
/// A 256-bit vector of [8 x float].
23462344
/// \returns A 32 bit float containing the first element of the input vector.
2347-
static __inline float __DEFAULT_FN_ATTRS
2348-
_mm256_cvtss_f32(__m256 __a)
2349-
{
2350-
return __a[0];
2345+
static __inline float __DEFAULT_FN_ATTRS_CONSTEXPR
2346+
_mm256_cvtss_f32(__m256 __a) {
2347+
return __a[0];
23512348
}
23522349

23532350
/* Vector replicate */

clang/test/CodeGen/X86/avx-builtins.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,18 +985,21 @@ double test_mm256_cvtsd_f64(__m256d __a) {
985985
// CHECK: extractelement <4 x double> %{{.*}}, i32 0
986986
return _mm256_cvtsd_f64(__a);
987987
}
988+
TEST_CONSTEXPR(_mm256_cvtsd_f64((__m256d){8.0, 7.0, 6.0, 5.0}) == 8.0);
988989

989990
int test_mm256_cvtsi256_si32(__m256i __a) {
990991
// CHECK-LABEL: test_mm256_cvtsi256_si32
991992
// CHECK: extractelement <8 x i32> %{{.*}}, i32 0
992993
return _mm256_cvtsi256_si32(__a);
993994
}
995+
TEST_CONSTEXPR(_mm256_cvtsi256_si32((__m256i)(__v8si){8, 7, 6, 5, 4, 3, 2, 1}) == 8);
994996

995997
float test_mm256_cvtss_f32(__m256 __a) {
996998
// CHECK-LABEL: test_mm256_cvtss_f32
997999
// CHECK: extractelement <8 x float> %{{.*}}, i32 0
9981000
return _mm256_cvtss_f32(__a);
9991001
}
1002+
TEST_CONSTEXPR(_mm256_cvtss_f32((__m256){8.0f, 7.0f, 6.0f, 5.0f, 4.0f, 3.0f, 2.0f, 1.0f}) == 8.0f);
10001003

10011004
__m128i test_mm256_cvttpd_epi32(__m256d A) {
10021005
// CHECK-LABEL: test_mm256_cvttpd_epi32

llvm/lib/Support/VirtualFileSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ class llvm::vfs::RedirectingFileSystemParser {
19731973
EC = FS->makeAbsolute(FullPath, Name);
19741974
Name = canonicalize(Name);
19751975
} else {
1976-
EC = sys::fs::make_absolute(Name);
1976+
EC = FS->makeAbsolute(Name);
19771977
}
19781978
if (EC) {
19791979
assert(NameValueNode && "Name presence should be checked earlier");

llvm/unittests/Support/VirtualFileSystemTest.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1941,7 +1941,7 @@ TEST_F(VFSFromYAMLTest, ReturnsExternalPathVFSHit) {
19411941
EXPECT_EQ(0, NumDiagnostics);
19421942
}
19431943

1944-
TEST_F(VFSFromYAMLTest, RootRelativeTest) {
1944+
TEST_F(VFSFromYAMLTest, RootRelativeToOverlayDirTest) {
19451945
auto Lower = makeIntrusiveRefCnt<DummyFileSystem>();
19461946
Lower->addDirectory("//root/foo/bar");
19471947
Lower->addRegularFile("//root/foo/bar/a");
@@ -2004,6 +2004,35 @@ TEST_F(VFSFromYAMLTest, RootRelativeTest) {
20042004
#endif
20052005
}
20062006

2007+
TEST_F(VFSFromYAMLTest, RootRelativeToCWDTest) {
2008+
auto Lower = makeIntrusiveRefCnt<DummyFileSystem>();
2009+
Lower->addDirectory("//root/foo/bar");
2010+
Lower->addRegularFile("//root/foo/bar/a");
2011+
Lower->addDirectory("//root/foo/bar/cwd");
2012+
Lower->addRegularFile("//root/foo/bar/cwd/a");
2013+
Lower->setCurrentWorkingDirectory("//root/foo/bar/cwd");
2014+
IntrusiveRefCntPtr<vfs::FileSystem> FS =
2015+
getFromYAMLString("{\n"
2016+
" 'case-sensitive': false,\n"
2017+
" 'root-relative': 'cwd',\n"
2018+
" 'roots': [\n"
2019+
" { 'name': 'b', 'type': 'file',\n"
2020+
" 'external-contents': '//root/foo/bar/a'\n"
2021+
" }\n"
2022+
" ]\n"
2023+
"}",
2024+
Lower, "//root/foo/bar/overlay");
2025+
2026+
ASSERT_NE(FS.get(), nullptr);
2027+
2028+
ErrorOr<vfs::Status> S1 = FS->status("//root/foo/bar/b");
2029+
ASSERT_TRUE(S1.getError());
2030+
2031+
ErrorOr<vfs::Status> S2 = FS->status("//root/foo/bar/cwd/b");
2032+
ASSERT_FALSE(S2.getError());
2033+
EXPECT_EQ("//root/foo/bar/a", S2->getName());
2034+
}
2035+
20072036
TEST_F(VFSFromYAMLTest, ReturnsInternalPathVFSHit) {
20082037
auto BaseFS = makeIntrusiveRefCnt<vfs::InMemoryFileSystem>();
20092038
BaseFS->addFile("//root/foo/realname", 0,
@@ -2489,6 +2518,7 @@ TEST_F(VFSFromYAMLTest, RelativePaths) {
24892518
SmallString<128> CWD;
24902519
EC = llvm::sys::fs::current_path(CWD);
24912520
ASSERT_FALSE(EC);
2521+
Lower->setCurrentWorkingDirectory(CWD);
24922522

24932523
// Filename at root level without a parent directory.
24942524
IntrusiveRefCntPtr<vfs::FileSystem> FS = getFromYAMLString(

offload/DeviceRTL/CMakeLists.txt

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

openmp/device/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ set_target_properties(libompdevice PROPERTIES
6464
RUNTIME_OUTPUT_NAME libomptarget-${target_name}.bc)
6565

6666
# If the user built with the GPU C library enabled we will use that instead.
67-
if(LIBOMPTARGET_GPU_LIBC_SUPPORT)
67+
if(TARGET libc)
6868
target_compile_definitions(libompdevice PRIVATE OMPTARGET_HAS_LIBC)
6969
endif()
7070
target_compile_definitions(libompdevice PRIVATE SHARED_SCRATCHPAD_SIZE=512)

0 commit comments

Comments
 (0)