Skip to content

Commit 9787398

Browse files
authored
Merge branch 'main' into x86-concat-v2f64-shuffles
2 parents 9e9fe5e + 95b3fd6 commit 9787398

File tree

29 files changed

+1076
-362
lines changed

29 files changed

+1076
-362
lines changed

clang/bindings/python/clang/cindex.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,6 +2481,7 @@ def spelling(self):
24812481
OBJCSEL = 29
24822482
FLOAT128 = 30
24832483
HALF = 31
2484+
FLOAT16 = 32
24842485
IBM128 = 40
24852486
COMPLEX = 100
24862487
POINTER = 101

lldb/test/Shell/Settings/TestFrameFunctionInlined.test

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# Test the ${function.is-inlined} frame-format variable.
22

3+
# Windows' link.exe does not preserve DWARF information, and we cannot get
4+
# inlining information from PDB at this time, see:
5+
# https://github.com/llvm/llvm-project/issues/143104
6+
# REQUIRES: (system-windows && lld) || !system-windows
7+
38
# RUN: split-file %s %t
4-
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
9+
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out %if system-windows %{-fuse-ld=lld%}
510
# RUN: %lldb -x -b -s %t/commands.input %t.out -o exit 2>&1 \
611
# RUN: | FileCheck %s
712

@@ -28,7 +33,7 @@ run
2833
bt
2934

3035
# CHECK: (lldb) bt
31-
# CHECK: frame 'inlined1() (Inlined)'
32-
# CHECK-NEXT: frame 'regular()'
33-
# CHECK-NEXT: frame 'inlined2() (Inlined)'
36+
# CHECK: frame '{{.*}}inlined1({{.*}}) (Inlined)'
37+
# CHECK-NEXT: frame '{{.*}}regular({{.*}})'
38+
# CHECK-NEXT: frame '{{.*}}inlined2({{.*}}) (Inlined)'
3439
# CHECK-NEXT: frame 'main'

llvm/lib/CodeGen/MIRParser/MIRParser.cpp

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -763,22 +763,25 @@ bool MIRParserImpl::setupRegisterInfo(const PerFunctionMIParsingState &PFS,
763763
MachineRegisterInfo &MRI = MF.getRegInfo();
764764
const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
765765

766-
bool Error = false;
766+
SmallVector<std::string> Errors;
767+
767768
// Create VRegs
768769
auto populateVRegInfo = [&](const VRegInfo &Info, const Twine &Name) {
769770
Register Reg = Info.VReg;
770771
switch (Info.Kind) {
771772
case VRegInfo::UNKNOWN:
772-
error(Twine("Cannot determine class/bank of virtual register ") +
773-
Name + " in function '" + MF.getName() + "'");
774-
Error = true;
773+
Errors.push_back(
774+
(Twine("Cannot determine class/bank of virtual register ") + Name +
775+
" in function '" + MF.getName() + "'")
776+
.str());
775777
break;
776778
case VRegInfo::NORMAL:
777779
if (!Info.D.RC->isAllocatable()) {
778-
error(Twine("Cannot use non-allocatable class '") +
779-
TRI->getRegClassName(Info.D.RC) + "' for virtual register " +
780-
Name + " in function '" + MF.getName() + "'");
781-
Error = true;
780+
Errors.push_back((Twine("Cannot use non-allocatable class '") +
781+
TRI->getRegClassName(Info.D.RC) +
782+
"' for virtual register " + Name + " in function '" +
783+
MF.getName() + "'")
784+
.str());
782785
break;
783786
}
784787

@@ -820,7 +823,14 @@ bool MIRParserImpl::setupRegisterInfo(const PerFunctionMIParsingState &PFS,
820823
}
821824
}
822825

823-
return Error;
826+
if (Errors.empty())
827+
return false;
828+
829+
// Report errors in a deterministic order.
830+
sort(Errors);
831+
for (auto &E : Errors)
832+
error(E);
833+
return true;
824834
}
825835

826836
bool MIRParserImpl::initializeFrameInfo(PerFunctionMIParsingState &PFS,

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6634,8 +6634,12 @@ SDValue DAGTypeLegalizer::WidenVecRes_SETCC(SDNode *N) {
66346634
InOp1 = GetWidenedVector(InOp1);
66356635
InOp2 = GetWidenedVector(InOp2);
66366636
} else {
6637-
InOp1 = DAG.WidenVector(InOp1, SDLoc(N));
6638-
InOp2 = DAG.WidenVector(InOp2, SDLoc(N));
6637+
SDValue Poison = DAG.getPOISON(WidenInVT);
6638+
SDValue ZeroIdx = DAG.getVectorIdxConstant(0, SDLoc(N));
6639+
InOp1 = DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(N), WidenInVT, Poison,
6640+
InOp1, ZeroIdx);
6641+
InOp2 = DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(N), WidenInVT, Poison,
6642+
InOp2, ZeroIdx);
66396643
}
66406644

66416645
// Assume that the input and output will be widen appropriately. If not,

llvm/lib/Support/Unix/Threading.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ static int computeHostNumHardwareThreads() {
318318
return CPU_COUNT(&mask);
319319
#elif defined(__linux__)
320320
cpu_set_t Set;
321+
CPU_ZERO(&Set);
321322
if (sched_getaffinity(0, sizeof(Set), &Set) == 0)
322323
return CPU_COUNT(&Set);
323324
#endif

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5993,12 +5993,19 @@ InstructionCost X86TTIImpl::getIntImmCostInst(unsigned Opcode, unsigned Idx,
59935993
// This is an imperfect hack to prevent constant hoisting of
59945994
// compares that might be trying to check if a 64-bit value fits in
59955995
// 32-bits. The backend can optimize these cases using a right shift by 32.
5996-
// Ideally we would check the compare predicate here. There also other
5997-
// similar immediates the backend can use shifts for.
5996+
// There are other predicates and immediates the backend can use shifts for.
59985997
if (Idx == 1 && ImmBitWidth == 64) {
59995998
uint64_t ImmVal = Imm.getZExtValue();
60005999
if (ImmVal == 0x100000000ULL || ImmVal == 0xffffffff)
60016000
return TTI::TCC_Free;
6001+
6002+
if (auto *Cmp = dyn_cast_or_null<CmpInst>(Inst)) {
6003+
if (Cmp->isEquality()) {
6004+
KnownBits Known = computeKnownBits(Cmp->getOperand(0), DL);
6005+
if (Known.countMinTrailingZeros() >= 32)
6006+
return TTI::TCC_Free;
6007+
}
6008+
}
60026009
}
60036010
ImmIdx = 1;
60046011
break;

llvm/test/Analysis/BasicAA/captures.ll

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,42 @@ define void @address_capture_and_full_capture() {
4040
load i32, ptr %a
4141
ret void
4242
}
43+
44+
; CHECK-LABEL: address_capture_and_full_capture_commuted
45+
; CHECK: MayAlias: i32* %a, i32* %p
46+
; CHECK: Both ModRef: Ptr: i32* %a <-> %p = call ptr @get_ptr()
47+
define void @address_capture_and_full_capture_commuted() {
48+
%a = alloca i32
49+
call void @capture(ptr %a)
50+
call void @capture(ptr captures(address) %a)
51+
%p = call ptr @get_ptr()
52+
store i32 0, ptr %p
53+
load i32, ptr %a
54+
ret void
55+
}
56+
57+
; CHECK-LABEL: read_only_capture_and_full_capture
58+
; CHECK: MayAlias: i32* %a, i32* %p
59+
; CHECK: Both ModRef: Ptr: i32* %a <-> %p = call ptr @get_ptr()
60+
define void @read_only_capture_and_full_capture() {
61+
%a = alloca i32
62+
call void @capture(ptr captures(address, read_provenance) %a)
63+
call void @capture(ptr %a)
64+
%p = call ptr @get_ptr()
65+
store i32 0, ptr %p
66+
load i32, ptr %a
67+
ret void
68+
}
69+
70+
; CHECK-LABEL: read_only_capture_and_full_capture_commuted
71+
; CHECK: MayAlias: i32* %a, i32* %p
72+
; CHECK: Both ModRef: Ptr: i32* %a <-> %p = call ptr @get_ptr()
73+
define void @read_only_capture_and_full_capture_commuted() {
74+
%a = alloca i32
75+
call void @capture(ptr %a)
76+
call void @capture(ptr captures(address, read_provenance) %a)
77+
%p = call ptr @get_ptr()
78+
store i32 0, ptr %p
79+
load i32, ptr %a
80+
ret void
81+
}

llvm/test/CodeGen/AArch64/arm64-neon-v1i1-setcc.ll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,19 @@ if.then:
249249
if.end:
250250
ret i32 1;
251251
}
252+
253+
define <1 x i64> @test_zext_half(<1 x half> %v1) {
254+
; CHECK-LABEL: test_zext_half:
255+
; CHECK: // %bb.0:
256+
; CHECK-NEXT: // kill: def $h0 killed $h0 def $d0
257+
; CHECK-NEXT: mov w8, #1 // =0x1
258+
; CHECK-NEXT: fcvtl v0.4s, v0.4h
259+
; CHECK-NEXT: fmov d1, x8
260+
; CHECK-NEXT: fcmgt v0.4s, v0.4s, #0.0
261+
; CHECK-NEXT: xtn v0.4h, v0.4s
262+
; CHECK-NEXT: and v0.8b, v0.8b, v1.8b
263+
; CHECK-NEXT: ret
264+
%1 = fcmp ogt <1 x half> %v1, zeroinitializer
265+
%2 = zext <1 x i1> %1 to <1 x i64>
266+
ret <1 x i64> %2
267+
}

llvm/test/CodeGen/MIR/AMDGPU/virtreg-uses-unallocatable-class.mir

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
# UNSUPPORTED: reverse_iteration
21
# RUN: not llc -mtriple=amdgcn-- -mcpu=gfx900 -run-pass=none -o - %s 2>&1 | FileCheck %s
32

43
# Check a diagnostic is emitted if non-allocatable classes are used
54
# with virtual registers, and there's no assert.
65

7-
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register named_use in function 'virtreg_unallocatable'
8-
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register named_def in function 'virtreg_unallocatable'
96
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register 0 in function 'virtreg_unallocatable'
10-
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register 2 in function 'virtreg_unallocatable'
117
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register 1 in function 'virtreg_unallocatable'
8+
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register 2 in function 'virtreg_unallocatable'
9+
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register named_def in function 'virtreg_unallocatable'
10+
# CHECK: error: {{.*}}: Cannot use non-allocatable class 'TTMP_32' for virtual register named_use in function 'virtreg_unallocatable'
1211

1312
---
1413
name: virtreg_unallocatable

llvm/test/CodeGen/X86/pr142513.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ define i64 @foo(i64 %x) {
2121
; X64-NEXT: cmpl $65509, %edi # imm = 0xFFE5
2222
; X64-NEXT: je .LBB0_1
2323
; X64-NEXT: # %bb.2: # %if.end
24-
; X64-NEXT: movabsq $9219572124669181952, %rax # imm = 0x7FF2800000000000
25-
; X64-NEXT: addq $3, %rax
24+
; X64-NEXT: movabsq $9219572124669181955, %rax # imm = 0x7FF2800000000003
2625
; X64-NEXT: retq
2726
; X64-NEXT: .LBB0_1: # %if.then
2827
entry:

0 commit comments

Comments
 (0)