Skip to content

Commit 3ada984

Browse files
authored
Merge branch 'main' into semantic_info
2 parents e965775 + 1c837ec commit 3ada984

File tree

18 files changed

+206
-108
lines changed

18 files changed

+206
-108
lines changed

clang/test/DebugInfo/ObjC/property-2.m

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

clang/test/DebugInfo/ObjC/property-auto-synth.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
// FIXME: Check IR rather than asm, then triple is not needed.
2-
// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
3-
4-
// CHECK: AT_APPLE_property_name
5-
// CHECK-NOT: AT_APPLE_property_getter
6-
// CHECK-NOT: AT_APPLE_property_setter
7-
// CHECK: AT_APPLE_property_attribute
8-
// CHECK: AT_APPLE_property
1+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
92

3+
// CHECK-NOT: setter
4+
// CHECK-NOT: getter
105

116
@interface I1
127
@property int p1;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
2+
3+
// CHECK: !DIObjCProperty(name: "baseInt"
4+
// CHECK-SAME: setter: "mySetBaseInt:"
5+
// CHECK-SAME: getter: "myGetBaseInt"
6+
// CHECK-SAME: attributes: 2446
7+
// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
8+
//
9+
// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
10+
11+
@interface BaseClass2
12+
{
13+
int _baseInt;
14+
}
15+
- (int) myGetBaseInt;
16+
- (void) mySetBaseInt: (int) in_int;
17+
@property(getter=myGetBaseInt,setter=mySetBaseInt:) int baseInt;
18+
@end
19+
20+
@implementation BaseClass2
21+
22+
- (int) myGetBaseInt
23+
{
24+
return _baseInt;
25+
}
26+
27+
- (void) mySetBaseInt: (int) in_int
28+
{
29+
_baseInt = 2 * in_int;
30+
}
31+
@end
32+
33+
34+
void foo(BaseClass2 *ptr) {}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
2+
3+
// CHECK: ![[BASE_PROP:[0-9]+]] = !DIObjCProperty(name: "base"
4+
// CHECK-SAME: attributes: 2316
5+
// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
6+
//
7+
// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
8+
//
9+
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_customIvar"
10+
// CHECK-SAME: extraData: ![[BASE_PROP]]
11+
12+
@interface C {
13+
int _customIvar;
14+
}
15+
@property int base;
16+
@end
17+
18+
@implementation C
19+
@synthesize base = _customIvar;
20+
@end
21+
22+
void foo(C *cptr) {}

clang/test/DebugInfo/ObjC/property2.m

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

clang/test/DebugInfo/ObjC/property5.m

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

lldb/test/API/macosx/posix_spawn/TestLaunchProcessPosixSpawn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def rosetta_debugserver_installed():
2121
import platform
2222
version = platform.mac_ver()
2323
# Workaround for an undiagnosed problem on green dragon.
24-
print(version)
25-
if version[0] and version[0][0] == '15' and version[0][1] == '5':
24+
if version[0] == '15.5':
2625
return False
2726
return exists("/Library/Apple/usr/libexec/oah/debugserver")
2827

llvm/include/llvm/ADT/RadixTree.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <cstddef>
2121
#include <iterator>
2222
#include <list>
23+
#include <optional>
2324
#include <utility>
2425
#include <vector>
2526

@@ -92,7 +93,7 @@ template <typename KeyType, typename T> class RadixTree {
9293
/// If this node does not have a value (i.e., it's an internal node that
9394
/// only serves as a path to other values), this iterator will be equal
9495
/// to default constructed `ContainerType::iterator()`.
95-
typename ContainerType::iterator Value;
96+
std::optional<typename ContainerType::iterator> Value;
9697

9798
/// The first character of the Key. Used for fast child lookup.
9899
KeyValueType KeyFront;
@@ -215,7 +216,7 @@ template <typename KeyType, typename T> class RadixTree {
215216
KeyConstIteratorType{}};
216217

217218
void findNextValid() {
218-
while (Curr && Curr->Value == typename ContainerType::iterator())
219+
while (Curr && !Curr->Value.has_value())
219220
advance();
220221
}
221222

@@ -249,7 +250,7 @@ template <typename KeyType, typename T> class RadixTree {
249250
public:
250251
IteratorImpl() = default;
251252

252-
MappedType &operator*() const { return *Curr->Value; }
253+
MappedType &operator*() const { return **Curr->Value; }
253254

254255
IteratorImpl &operator++() {
255256
advance();
@@ -315,12 +316,12 @@ template <typename KeyType, typename T> class RadixTree {
315316
const value_type &NewValue = KeyValuePairs.emplace_front(
316317
std::move(Key), T(std::forward<Ts>(Args)...));
317318
Node &Node = findOrCreate(NewValue.first);
318-
bool HasValue = Node.Value != typename ContainerType::iterator();
319+
bool HasValue = Node.Value.has_value();
319320
if (!HasValue)
320321
Node.Value = KeyValuePairs.begin();
321322
else
322323
KeyValuePairs.pop_front();
323-
return {Node.Value, !HasValue};
324+
return {*Node.Value, !HasValue};
324325
}
325326

326327
///

llvm/lib/Target/AMDGPU/SOPInstructions.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,10 @@ def S_CBRANCH_G_FORK : SOP2_Pseudo <
838838
let SubtargetPredicate = isGFX6GFX7GFX8GFX9;
839839
}
840840

841-
let Defs = [SCC] in {
842-
def S_ABSDIFF_I32 : SOP2_32 <"s_absdiff_i32">;
843-
} // End Defs = [SCC]
841+
let isCommutable = 1, Defs = [SCC] in
842+
def S_ABSDIFF_I32 : SOP2_32 <"s_absdiff_i32",
843+
[(set i32:$sdst, (UniformUnaryFrag<abs> (sub_oneuse i32:$src0, i32:$src1)))]
844+
>;
844845

845846
let SubtargetPredicate = isGFX8GFX9 in {
846847
def S_RFE_RESTORE_B64 : SOP2_Pseudo <
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2+
; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx900 < %s | FileCheck %s
3+
4+
define amdgpu_ps i16 @absdiff_i16_false(i16 inreg %arg0, i16 inreg %arg1) {
5+
; CHECK-LABEL: absdiff_i16_false:
6+
; CHECK: ; %bb.0:
7+
; CHECK-NEXT: s_sub_i32 s0, s0, s1
8+
; CHECK-NEXT: s_sext_i32_i16 s1, s0
9+
; CHECK-NEXT: s_sub_i32 s0, 0, s0
10+
; CHECK-NEXT: s_sext_i32_i16 s0, s0
11+
; CHECK-NEXT: s_max_i32 s0, s1, s0
12+
; CHECK-NEXT: ; return to shader part epilog
13+
%diff = sub i16 %arg0, %arg1
14+
%res = call i16 @llvm.abs.i16(i16 %diff, i1 false) ; INT_MIN input returns INT_MIN
15+
ret i16 %res
16+
}
17+
18+
define amdgpu_ps i16 @absdiff_i16_true(i16 inreg %arg0, i16 inreg %arg1) {
19+
; CHECK-LABEL: absdiff_i16_true:
20+
; CHECK: ; %bb.0:
21+
; CHECK-NEXT: s_sub_i32 s0, s0, s1
22+
; CHECK-NEXT: s_sext_i32_i16 s1, s0
23+
; CHECK-NEXT: s_sub_i32 s0, 0, s0
24+
; CHECK-NEXT: s_sext_i32_i16 s0, s0
25+
; CHECK-NEXT: s_max_i32 s0, s1, s0
26+
; CHECK-NEXT: ; return to shader part epilog
27+
%diff = sub i16 %arg0, %arg1
28+
%res = call i16 @llvm.abs.i16(i16 %diff, i1 true) ; INT_MIN input returns poison
29+
ret i16 %res
30+
}
31+
32+
define amdgpu_ps i32 @absdiff_i32_false(i32 inreg %arg0, i32 inreg %arg1) {
33+
; CHECK-LABEL: absdiff_i32_false:
34+
; CHECK: ; %bb.0:
35+
; CHECK-NEXT: s_absdiff_i32 s0, s0, s1
36+
; CHECK-NEXT: ; return to shader part epilog
37+
%diff = sub i32 %arg0, %arg1
38+
%res = call i32 @llvm.abs.i32(i32 %diff, i1 false) ; INT_MIN input returns INT_MIN
39+
ret i32 %res
40+
}
41+
42+
define amdgpu_ps i32 @absdiff_i32_true(i32 inreg %arg0, i32 inreg %arg1) {
43+
; CHECK-LABEL: absdiff_i32_true:
44+
; CHECK: ; %bb.0:
45+
; CHECK-NEXT: s_absdiff_i32 s0, s0, s1
46+
; CHECK-NEXT: ; return to shader part epilog
47+
%diff = sub i32 %arg0, %arg1
48+
%res = call i32 @llvm.abs.i32(i32 %diff, i1 true) ; INT_MIN input returns poison
49+
ret i32 %res
50+
}
51+
52+
; Multiple uses of %diff. No benefit for using s_absdiff_i32.
53+
define amdgpu_ps i32 @absdiff_i32_false_multi_use(i32 inreg %arg0, i32 inreg %arg1) {
54+
; CHECK-LABEL: absdiff_i32_false_multi_use:
55+
; CHECK: ; %bb.0:
56+
; CHECK-NEXT: s_sub_i32 s1, s0, s1
57+
; CHECK-NEXT: s_abs_i32 s0, s1
58+
; CHECK-NEXT: ;;#ASMSTART
59+
; CHECK-NEXT: ; use s1
60+
; CHECK-NEXT: ;;#ASMEND
61+
; CHECK-NEXT: ; return to shader part epilog
62+
%diff = sub i32 %arg0, %arg1
63+
%res = call i32 @llvm.abs.i32(i32 %diff, i1 false) ; INT_MIN input returns INT_MIN
64+
call void asm "; use $0", "s"(i32 %diff)
65+
ret i32 %res
66+
}
67+
68+
define <2 x i32> @absdiff_2xi32_false(<2 x i32> %arg0, <2 x i32> %arg1) {
69+
; CHECK-LABEL: absdiff_2xi32_false:
70+
; CHECK: ; %bb.0:
71+
; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
72+
; CHECK-NEXT: v_sub_u32_e32 v0, v0, v2
73+
; CHECK-NEXT: v_sub_u32_e32 v1, v1, v3
74+
; CHECK-NEXT: v_sub_u32_e32 v2, 0, v0
75+
; CHECK-NEXT: v_max_i32_e32 v0, v2, v0
76+
; CHECK-NEXT: v_sub_u32_e32 v2, 0, v1
77+
; CHECK-NEXT: v_max_i32_e32 v1, v2, v1
78+
; CHECK-NEXT: s_setpc_b64 s[30:31]
79+
%diff = sub <2 x i32> %arg0, %arg1
80+
%res = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %diff, i1 false) ; INT_MIN input returns INT_MIN
81+
ret <2 x i32> %res
82+
}
83+
84+
define <4 x i32> @absdiff_4xi32_false(<4 x i32> %arg0, <4 x i32> %arg1) {
85+
; CHECK-LABEL: absdiff_4xi32_false:
86+
; CHECK: ; %bb.0:
87+
; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
88+
; CHECK-NEXT: v_sub_u32_e32 v0, v0, v4
89+
; CHECK-NEXT: v_sub_u32_e32 v1, v1, v5
90+
; CHECK-NEXT: v_sub_u32_e32 v4, 0, v0
91+
; CHECK-NEXT: v_sub_u32_e32 v2, v2, v6
92+
; CHECK-NEXT: v_max_i32_e32 v0, v4, v0
93+
; CHECK-NEXT: v_sub_u32_e32 v4, 0, v1
94+
; CHECK-NEXT: v_sub_u32_e32 v3, v3, v7
95+
; CHECK-NEXT: v_max_i32_e32 v1, v4, v1
96+
; CHECK-NEXT: v_sub_u32_e32 v4, 0, v2
97+
; CHECK-NEXT: v_max_i32_e32 v2, v4, v2
98+
; CHECK-NEXT: v_sub_u32_e32 v4, 0, v3
99+
; CHECK-NEXT: v_max_i32_e32 v3, v4, v3
100+
; CHECK-NEXT: s_setpc_b64 s[30:31]
101+
%diff = sub <4 x i32> %arg0, %arg1
102+
%res = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %diff, i1 false) ; INT_MIN input returns INT_MIN
103+
ret <4 x i32> %res
104+
}

0 commit comments

Comments
 (0)