Skip to content

Commit e7d52d2

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merge llvm/main into amd-debug
2 parents 458a46b + c4c56a0 commit e7d52d2

File tree

10 files changed

+285
-61
lines changed

10 files changed

+285
-61
lines changed

lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def minidump_deterministic_difference(self):
608608

609609
@skipUnlessPlatform(["linux"])
610610
@skipUnlessArch("x86_64")
611-
def minidump_saves_fs_base_region(self):
611+
def minidump_saves_tls(self):
612612
self.build()
613613
exe = self.getBuildArtifact("a.out")
614614
try:

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,10 +1061,6 @@ defvar DefaultRuntimeLibcallImpls =
10611061
DefaultRuntimeLibcallImpls_f80),
10621062
DefaultRuntimeLibcallImpls_ppcf128);
10631063

1064-
defvar DefaultRuntimeLibcallImpls_atomic =
1065-
!filter(entry, DefaultRuntimeLibcallImpls,
1066-
!match(!cast<string>(entry.Provides), "ATOMIC"));
1067-
10681064
/// Default set of libcall impls for 32-bit architectures.
10691065
defvar DefaultLibcallImpls32 = DefaultRuntimeLibcallImpls;
10701066

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5512,7 +5512,8 @@ static SDValue optimizeIncrementingWhile(SDNode *N, SelectionDAG &DAG,
55125512
unsigned Op0 = N->getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 1 : 0;
55135513
unsigned Op1 = N->getOpcode() == ISD::INTRINSIC_WO_CHAIN ? 2 : 1;
55145514

5515-
if (!isa<ConstantSDNode>(N->getOperand(Op1)))
5515+
if (!N->getValueType(0).isScalableVector() ||
5516+
!isa<ConstantSDNode>(N->getOperand(Op1)))
55165517
return SDValue();
55175518

55185519
SDLoc DL(N);

llvm/lib/Target/AArch64/AArch64SchedNeoverseV2.td

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def V2Write_20c_1V0 : SchedWriteRes<[V2UnitV0]> { let Latency = 20;
157157
def V2Write_2c_1V1 : SchedWriteRes<[V2UnitV1]> { let Latency = 2; }
158158
def V2Write_2c_1V13 : SchedWriteRes<[V2UnitV13]> { let Latency = 2; }
159159
def V2Write_3c_1V1 : SchedWriteRes<[V2UnitV1]> { let Latency = 3; }
160+
def V2Write_3c_1V13 : SchedWriteRes<[V2UnitV13]> { let Latency = 3; }
160161
def V2Write_4c_1V1 : SchedWriteRes<[V2UnitV1]> { let Latency = 4; }
161162
def V2Write_4c_1V13 : SchedWriteRes<[V2UnitV13]> { let Latency = 4; }
162163
def V2Write_6c_1V1 : SchedWriteRes<[V2UnitV1]> { let Latency = 6; }
@@ -256,8 +257,8 @@ def V2Write_4c_1L01_1V01 : SchedWriteRes<[V2UnitL01, V2UnitV01]> {
256257
let NumMicroOps = 2;
257258
}
258259

259-
def V2Write_4c_1V13_1V : SchedWriteRes<[V2UnitV13, V2UnitV]> {
260-
let Latency = 4;
260+
def V2Write_5c_1V13_1V : SchedWriteRes<[V2UnitV13, V2UnitV]> {
261+
let Latency = 5;
261262
let NumMicroOps = 2;
262263
}
263264

@@ -376,8 +377,8 @@ def V2Write_6c_1L_1S : SchedWriteRes<[V2UnitL, V2UnitS]> {
376377
let NumMicroOps = 2;
377378
}
378379

379-
def V2Write_4c_2V13 : SchedWriteRes<[V2UnitV13, V2UnitV13]> {
380-
let Latency = 4;
380+
def V2Write_6c_2V13 : SchedWriteRes<[V2UnitV13, V2UnitV13]> {
381+
let Latency = 6;
381382
let NumMicroOps = 2;
382383
}
383384

@@ -1468,14 +1469,14 @@ def : SchedAlias<WriteVq, V2Write_2c_1V>;
14681469
def : InstRW<[V2Wr_VA, V2Rd_VA], (instregex "^[SU]ABAL?v")>;
14691470

14701471
// ASIMD arith, reduce, 4H/4S
1471-
def : InstRW<[V2Write_2c_1V13], (instregex "^(ADDV|[SU]ADDLV)v4(i16|i32)v$")>;
1472+
def : InstRW<[V2Write_3c_1V13], (instregex "^(ADDV|[SU]ADDLV)v4(i16|i32)v$")>;
14721473

14731474
// ASIMD arith, reduce, 8B/8H
1474-
def : InstRW<[V2Write_4c_1V13_1V],
1475+
def : InstRW<[V2Write_5c_1V13_1V],
14751476
(instregex "^(ADDV|[SU]ADDLV)v8(i8|i16)v$")>;
14761477

14771478
// ASIMD arith, reduce, 16B
1478-
def : InstRW<[V2Write_4c_2V13], (instregex "^(ADDV|[SU]ADDLV)v16i8v$")>;
1479+
def : InstRW<[V2Write_6c_2V13], (instregex "^(ADDV|[SU]ADDLV)v16i8v$")>;
14791480

14801481
// ASIMD dot product
14811482
// ASIMD dot product using signed and unsigned integers
@@ -1486,15 +1487,15 @@ def : InstRW<[V2Wr_VDOT, V2Rd_VDOT],
14861487
def : InstRW<[V2Wr_VMMA, V2Rd_VMMA], (instrs SMMLA, UMMLA, USMMLA)>;
14871488

14881489
// ASIMD max/min, reduce, 4H/4S
1489-
def : InstRW<[V2Write_2c_1V13], (instregex "^[SU](MAX|MIN)Vv4i16v$",
1490+
def : InstRW<[V2Write_3c_1V13], (instregex "^[SU](MAX|MIN)Vv4i16v$",
14901491
"^[SU](MAX|MIN)Vv4i32v$")>;
14911492

14921493
// ASIMD max/min, reduce, 8B/8H
1493-
def : InstRW<[V2Write_4c_1V13_1V], (instregex "^[SU](MAX|MIN)Vv8i8v$",
1494+
def : InstRW<[V2Write_5c_1V13_1V], (instregex "^[SU](MAX|MIN)Vv8i8v$",
14941495
"^[SU](MAX|MIN)Vv8i16v$")>;
14951496

14961497
// ASIMD max/min, reduce, 16B
1497-
def : InstRW<[V2Write_4c_2V13], (instregex "[SU](MAX|MIN)Vv16i8v$")>;
1498+
def : InstRW<[V2Write_6c_2V13], (instregex "[SU](MAX|MIN)Vv16i8v$")>;
14981499

14991500
// ASIMD multiply
15001501
def : InstRW<[V2Write_4c_1V02], (instregex "^MULv", "^SQ(R)?DMULHv")>;

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15032,10 +15032,15 @@ static SDValue combineBinOpToReduce(SDNode *N, SelectionDAG &DAG,
1503215032

1503315033
// Optimize (add (shl x, c0), (shl y, c1)) ->
1503415034
// (SLLI (SH*ADD x, y), c0), if c1-c0 equals to [1|2|3].
15035+
// or
15036+
// (SLLI (QC.SHLADD x, y, c1 - c0), c0), if 4 <= (c1-c0) <=31.
1503515037
static SDValue transformAddShlImm(SDNode *N, SelectionDAG &DAG,
1503615038
const RISCVSubtarget &Subtarget) {
15037-
// Perform this optimization only in the zba/xandesperf extension.
15038-
if (!Subtarget.hasStdExtZba() && !Subtarget.hasVendorXAndesPerf())
15039+
const bool HasStdExtZba = Subtarget.hasStdExtZba();
15040+
const bool HasVendorXAndesPerf = Subtarget.hasVendorXAndesPerf();
15041+
const bool HasVendorXqciac = Subtarget.hasVendorXqciac();
15042+
// Perform this optimization only in the zba/xandesperf/xqciac extension.
15043+
if (!HasStdExtZba && !HasVendorXAndesPerf && !HasVendorXqciac)
1503915044
return SDValue();
1504015045

1504115046
// Skip for vector types and larger types.
@@ -15060,14 +15065,22 @@ static SDValue transformAddShlImm(SDNode *N, SelectionDAG &DAG,
1506015065
if (C0 <= 0 || C1 <= 0)
1506115066
return SDValue();
1506215067

15063-
// Skip if SH1ADD/SH2ADD/SH3ADD are not applicable.
15064-
int64_t Bits = std::min(C0, C1);
1506515068
int64_t Diff = std::abs(C0 - C1);
15066-
if (Diff != 1 && Diff != 2 && Diff != 3)
15069+
bool IsShXaddDiff = Diff == 1 || Diff == 2 || Diff == 3;
15070+
bool HasShXadd = HasStdExtZba || HasVendorXAndesPerf;
15071+
15072+
// Skip if SH1ADD/SH2ADD/SH3ADD are not applicable.
15073+
if ((!IsShXaddDiff && HasShXadd && !HasVendorXqciac) ||
15074+
(IsShXaddDiff && !HasShXadd && HasVendorXqciac))
15075+
return SDValue();
15076+
15077+
// Skip if QC_SHLADD is not applicable.
15078+
if (Diff == 0 || Diff > 31)
1506715079
return SDValue();
1506815080

1506915081
// Build nodes.
1507015082
SDLoc DL(N);
15083+
int64_t Bits = std::min(C0, C1);
1507115084
SDValue NS = (C0 < C1) ? N0->getOperand(0) : N1->getOperand(0);
1507215085
SDValue NL = (C0 > C1) ? N0->getOperand(0) : N1->getOperand(0);
1507315086
SDValue SHADD = DAG.getNode(RISCVISD::SHL_ADD, DL, VT, NL,

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,6 +2823,9 @@ bool RISCVInstrInfo::verifyInstruction(const MachineInstr &MI,
28232823
case RISCVOp::OPERAND_UIMM5_NONZERO:
28242824
Ok = isUInt<5>(Imm) && (Imm != 0);
28252825
break;
2826+
case RISCVOp::OPERAND_UIMM5_GT3:
2827+
Ok = isUInt<5>(Imm) && (Imm > 3);
2828+
break;
28262829
case RISCVOp::OPERAND_UIMM5_PLUS1:
28272830
Ok = (isUInt<5>(Imm) && (Imm != 0)) || (Imm == 32);
28282831
break;

llvm/lib/Target/RISCV/RISCVInstrInfoXqci.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,10 @@ class SelectQCbi<CondCode Cond, DAGOperand InTyImm, Pseudo OpNode >
13591359
let Predicates = [HasVendorXqciac, IsRV32] in {
13601360
def : Pat<(i32 (add GPRNoX0:$rd, (mul GPRNoX0:$rs1, simm12:$imm12))),
13611361
(QC_MULIADD GPRNoX0:$rd, GPRNoX0:$rs1, simm12:$imm12)>;
1362+
def : Pat<(i32 (add_like_non_imm12 (shl GPRNoX0:$rs1, uimm5gt3:$imm), GPRNoX0:$rs2)),
1363+
(QC_SHLADD GPRNoX0:$rs2, GPRNoX0:$rs1, uimm5gt3:$imm)>;
1364+
def : Pat<(i32 (riscv_shl_add GPRNoX0:$rs1, uimm5gt3:$imm, GPRNoX0:$rs2)),
1365+
(QC_SHLADD GPRNoX0:$rs2, GPRNoX0:$rs1, uimm5gt3:$imm)>;
13621366
} // Predicates = [HasVendorXqciac, IsRV32]
13631367

13641368
/// Simple arithmetic operations

llvm/test/CodeGen/AArch64/active_lane_mask.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,18 @@ entry:
460460
ret <vscale x 16 x i1> %active.lane.mask
461461
}
462462

463+
define <8 x i1> @lane_mask_v8i1_imm3() {
464+
; CHECK-LABEL: lane_mask_v8i1_imm3:
465+
; CHECK: // %bb.0: // %entry
466+
; CHECK-NEXT: ptrue p0.b, vl3
467+
; CHECK-NEXT: mov z0.b, p0/z, #-1 // =0xffffffffffffffff
468+
; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
469+
; CHECK-NEXT: ret
470+
entry:
471+
%active.lane.mask = call <8 x i1> @llvm.get.active.lane.mask.v8i1.i64(i64 0, i64 3)
472+
ret <8 x i1> %active.lane.mask
473+
}
474+
463475
declare <vscale x 32 x i1> @llvm.get.active.lane.mask.nxv32i1.i32(i32, i32)
464476
declare <vscale x 16 x i1> @llvm.get.active.lane.mask.nxv16i1.i32(i32, i32)
465477
declare <vscale x 8 x i1> @llvm.get.active.lane.mask.nxv8i1.i32(i32, i32)

0 commit comments

Comments
 (0)