Skip to content

Commit 14d7091

Browse files
committed
merge main into amd-staging
2 parents f3d3a2b + a7c38b8 commit 14d7091

File tree

5 files changed

+74
-20
lines changed

5 files changed

+74
-20
lines changed

.ci/premerge_advisor_upload.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
import generate_test_report_lib
1414

15-
PREMERGE_ADVISOR_URL = (
16-
"http://premerge-advisor.premerge-advisor.svc.cluster.local:5000/upload"
17-
)
15+
# These are IP addresses of the two premerge advisor instances. They should
16+
# eventually be updated to domain names.
17+
PREMERGE_ADVISOR_URLS = [
18+
"http://34.82.126.63:5000/upload",
19+
"http://136.114.125.23:5000/upload",
20+
]
1821

1922

2023
def main(commit_sha, workflow_run_number, build_log_files):
@@ -41,7 +44,8 @@ def main(commit_sha, workflow_run_number, build_log_files):
4144
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
4245
for name, failure_message in ninja_failures:
4346
failure_info["failures"].append({"name": name, "message": failure_message})
44-
requests.post(PREMERGE_ADVISOR_URL, json=failure_info)
47+
for premerge_advisor_url in PREMERGE_ADVISOR_URLS:
48+
requests.post(premerge_advisor_url, json=failure_info)
4549

4650

4751
if __name__ == "__main__":

llvm/include/llvm/ADT/RadixTree.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <limits>
2323
#include <list>
2424
#include <utility>
25+
#include <vector>
2526

2627
namespace llvm {
2728

llvm/lib/Target/ARM/ARMInstrInfo.td

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6546,23 +6546,25 @@ def KCFI_CHECK_ARM
65466546
: PseudoInst<(outs), (ins GPR:$ptr, i32imm:$type), NoItinerary, []>,
65476547
Sched<[]>,
65486548
Requires<[IsARM]> {
6549-
let Size = 28; // 7 instructions (bic, ldr, 4x eor, beq, udf)
6549+
let Size = 40; // worst-case 10 instructions @ 4 bytes each
6550+
// (push, bic, ldr, 4x eor, pop, beq, udf)
65506551
}
65516552

65526553
def KCFI_CHECK_Thumb2
65536554
: PseudoInst<(outs), (ins GPR:$ptr, i32imm:$type), NoItinerary, []>,
65546555
Sched<[]>,
65556556
Requires<[IsThumb2]> {
6556-
let Size =
6557-
32; // worst-case 9 instructions (push, bic, ldr, 4x eor, pop, beq.w, udf)
6557+
let Size = 34; // worst-case (push.w[2], bic[4], ldr[4], 4x eor[16], pop.w[2],
6558+
// beq.w[4], udf[2])
65586559
}
65596560

65606561
def KCFI_CHECK_Thumb1
65616562
: PseudoInst<(outs), (ins GPR:$ptr, i32imm:$type), NoItinerary, []>,
65626563
Sched<[]>,
65636564
Requires<[IsThumb1Only]> {
6564-
let Size = 50; // worst-case 25 instructions (pushes, bic helper, type
6565-
// building, cmp, pops)
6565+
let Size = 38; // worst-case 19 instructions @ 2 bytes each
6566+
// (2x push, 3x bic-helper, subs+ldr, 13x type-building, cmp,
6567+
// 2x pop, beq, bkpt)
65666568
}
65676569

65686570
//===----------------------------------------------------------------------===//

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4721,9 +4721,6 @@ bool X86DAGToDAGISel::tryVPTERNLOG(SDNode *N) {
47214721
if (!(Subtarget->hasVLX() || NVT.is512BitVector()))
47224722
return false;
47234723

4724-
SDValue N0 = N->getOperand(0);
4725-
SDValue N1 = N->getOperand(1);
4726-
47274724
auto getFoldableLogicOp = [](SDValue Op) {
47284725
// Peek through single use bitcast.
47294726
if (Op.getOpcode() == ISD::BITCAST && Op.hasOneUse())
@@ -4740,13 +4737,47 @@ bool X86DAGToDAGISel::tryVPTERNLOG(SDNode *N) {
47404737
return SDValue();
47414738
};
47424739

4743-
SDValue A, FoldableOp;
4744-
if ((FoldableOp = getFoldableLogicOp(N1))) {
4745-
A = N0;
4746-
} else if ((FoldableOp = getFoldableLogicOp(N0))) {
4747-
A = N1;
4748-
} else
4749-
return false;
4740+
SDValue N0, N1, A, FoldableOp;
4741+
4742+
// Identify and (optionally) peel an outer NOT that wraps a pure logic tree
4743+
auto tryPeelOuterNotWrappingLogic = [&](SDNode *Op) {
4744+
if (Op->getOpcode() == ISD::XOR && Op->hasOneUse() &&
4745+
ISD::isBuildVectorAllOnes(Op->getOperand(1).getNode())) {
4746+
SDValue InnerOp = Op->getOperand(0);
4747+
4748+
if (!getFoldableLogicOp(InnerOp))
4749+
return SDValue();
4750+
4751+
N0 = InnerOp.getOperand(0);
4752+
N1 = InnerOp.getOperand(1);
4753+
if ((FoldableOp = getFoldableLogicOp(N1))) {
4754+
A = N0;
4755+
return InnerOp;
4756+
}
4757+
if ((FoldableOp = getFoldableLogicOp(N0))) {
4758+
A = N1;
4759+
return InnerOp;
4760+
}
4761+
}
4762+
return SDValue();
4763+
};
4764+
4765+
bool PeeledOuterNot = false;
4766+
SDNode *OriN = N;
4767+
if (SDValue InnerOp = tryPeelOuterNotWrappingLogic(N)) {
4768+
PeeledOuterNot = true;
4769+
N = InnerOp.getNode();
4770+
} else {
4771+
N0 = N->getOperand(0);
4772+
N1 = N->getOperand(1);
4773+
4774+
if ((FoldableOp = getFoldableLogicOp(N1)))
4775+
A = N0;
4776+
else if ((FoldableOp = getFoldableLogicOp(N0)))
4777+
A = N1;
4778+
else
4779+
return false;
4780+
}
47504781

47514782
SDValue B = FoldableOp.getOperand(0);
47524783
SDValue C = FoldableOp.getOperand(1);
@@ -4798,7 +4829,10 @@ bool X86DAGToDAGISel::tryVPTERNLOG(SDNode *N) {
47984829
case ISD::XOR: Imm ^= TernlogMagicA; break;
47994830
}
48004831

4801-
return matchVPTERNLOG(N, ParentA, ParentB, ParentC, A, B, C, Imm);
4832+
if (PeeledOuterNot)
4833+
Imm = ~Imm;
4834+
4835+
return matchVPTERNLOG(OriN, ParentA, ParentB, ParentC, A, B, C, Imm);
48024836
}
48034837

48044838
/// If the high bits of an 'and' operand are known zero, try setting the
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2+
; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=CHECK
3+
4+
define <8 x i64> @foo(<8 x i64> %a, <8 x i64> %b, <8 x i64> %c) {
5+
; CHECK-LABEL: foo:
6+
; CHECK: # %bb.0:
7+
; CHECK-NEXT: vpternlogq {{.*#+}} zmm0 = ~(zmm0 | zmm2 | zmm1)
8+
; CHECK-NEXT: retq
9+
%and.demorgan = or <8 x i64> %b, %a
10+
%and3.demorgan = or <8 x i64> %and.demorgan, %c
11+
%and3 = xor <8 x i64> %and3.demorgan, splat (i64 -1)
12+
ret <8 x i64> %and3
13+
}

0 commit comments

Comments
 (0)