Skip to content

Commit a061f08

Browse files
authored
Merge branch 'main' into x86-pmullw-vXi8
2 parents 4867614 + f12ad95 commit a061f08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+172
-1238
lines changed

clang/test/CodeGen/builtins.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,10 @@ void test_builtin_ctzg(unsigned char uc, unsigned short us, unsigned int ui,
12891289
// CHECK-LABEL: define{{.*}} void @test_builtin_bswapg
12901290
void test_builtin_bswapg(unsigned char uc, unsigned short us, unsigned int ui,
12911291
unsigned long ul, unsigned long long ull,
1292-
unsigned __int128 ui128, _BitInt(8) bi8,
1292+
#ifdef __SIZEOF_INT128__
1293+
unsigned __int128 ui128,
1294+
#endif
1295+
_BitInt(8) bi8,
12931296
_BitInt(16) bi16, _BitInt(32) bi32,
12941297
_BitInt(64) bi64, _BitInt(128) bi128) {
12951298
uc = __builtin_bswapg(uc);
@@ -1303,8 +1306,10 @@ void test_builtin_bswapg(unsigned char uc, unsigned short us, unsigned int ui,
13031306
// CHECK: call i64 @llvm.bswap.i64
13041307
ull = __builtin_bswapg(ull);
13051308
// CHECK: call i64 @llvm.bswap.i64
1309+
#ifdef __SIZEOF_INT128__
13061310
ui128 = __builtin_bswapg(ui128);
13071311
// CHECK: call i128 @llvm.bswap.i128
1312+
#endif
13081313
bi8 = __builtin_bswapg(bi8);
13091314
// CHECK: %17 = load i8, ptr %bi8.addr, align 1
13101315
// CHECK: store i8 %17, ptr %bi8.addr

libcxx/test/std/language.support/support.dynamic/hardware_inference_size.compile.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: c++03, c++11, c++14
10-
// UNSUPPORTED: (clang || apple-clang) && stdlib=libc++
1110

1211
#include <new>
1312

Lines changed: 77 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,99 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
22
; RUN: llc -O3 < %s -mtriple=aarch64 | FileCheck %s
33

4-
; The seemingly redundant mov where src_reg == dst_reg shouldn't be removed,
5-
; because it has the effect of zeroing the upper bits in x8.
4+
; The seemingly redundant wreg mov where src_reg == dst_reg shouldn't be
5+
; removed, because it has the effect of zeroing the upper bits in the matching
6+
; xreg.
67

7-
define i32 @ham(i32 %arg, i1 %arg1, i1 %arg2, ptr %arg3) nounwind {
8-
; CHECK-LABEL: ham:
8+
define i32 @widget(i32 %arg, i32 %arg1, i1 %arg2, ptr %arg3, i1 %arg4) #0 nounwind {
9+
; CHECK-LABEL: widget:
910
; CHECK: // %bb.0: // %bb
10-
; CHECK-NEXT: stp x30, x21, [sp, #-32]! // 16-byte Folded Spill
11-
; CHECK-NEXT: stp x20, x19, [sp, #16] // 16-byte Folded Spill
12-
; CHECK-NEXT: tbnz w1, #0, .LBB0_3
13-
; CHECK-NEXT: // %bb.1: // %bb4
14-
; CHECK-NEXT: tbnz w2, #0, .LBB0_3
15-
; CHECK-NEXT: // %bb.2: // %bb5
16-
; CHECK-NEXT: mov x19, x3
17-
; CHECK-NEXT: mov w21, w1
18-
; CHECK-NEXT: mov w20, w0
19-
; CHECK-NEXT: bl zot
20-
; CHECK-NEXT: tbz w21, #0, .LBB0_4
21-
; CHECK-NEXT: .LBB0_3: // %bb6
22-
; CHECK-NEXT: ldp x20, x19, [sp, #16] // 16-byte Folded Reload
23-
; CHECK-NEXT: mov w0, wzr
24-
; CHECK-NEXT: ldp x30, x21, [sp], #32 // 16-byte Folded Reload
11+
; CHECK-NEXT: tbz w2, #0, .LBB0_2
12+
; CHECK-NEXT: // %bb.1:
13+
; CHECK-NEXT: mov w0, #1 // =0x1
14+
; CHECK-NEXT: ret
15+
; CHECK-NEXT: .LBB0_2: // %bb5
16+
; CHECK-NEXT: tbz w4, #0, .LBB0_4
17+
; CHECK-NEXT: // %bb.3:
18+
; CHECK-NEXT: mov w0, #0 // =0x0
2519
; CHECK-NEXT: ret
26-
; CHECK-NEXT: .LBB0_4:
27-
; CHECK-NEXT: mov w8, w20
28-
; CHECK-NEXT: mov w20, wzr
20+
; CHECK-NEXT: .LBB0_4: // %bb6
21+
; CHECK-NEXT: str x30, [sp, #-48]! // 8-byte Folded Spill
22+
; CHECK-NEXT: stp x22, x21, [sp, #16] // 16-byte Folded Spill
23+
; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
24+
; CHECK-NEXT: mov x19, x3
25+
; CHECK-NEXT: mov x20, x0
26+
; CHECK-NEXT: mov x21, x1
27+
; CHECK-NEXT: bl baz
28+
; CHECK-NEXT: mov w0, #0 // =0x0
29+
; CHECK-NEXT: cbnz wzr, .LBB0_11
30+
; CHECK-NEXT: // %bb.5: // %bb6
31+
; CHECK-NEXT: mov w10, #1 // =0x1
32+
; CHECK-NEXT: cbnz w10, .LBB0_11
33+
; CHECK-NEXT: // %bb.6: // %bb7
34+
; CHECK-NEXT: cbnz w10, .LBB0_10
35+
; CHECK-NEXT: // %bb.7: // %bb8
36+
; CHECK-NEXT: mov x8, x21
37+
; CHECK-NEXT: mov x9, x20
38+
; CHECK-NEXT: mov w20, #0 // =0x0
39+
; CHECK-NEXT: mov w9, w9
40+
; CHECK-NEXT: mov x21, x9
2941
; CHECK-NEXT: mov w8, w8
30-
; CHECK-NEXT: mov w21, w8
31-
; CHECK-NEXT: .LBB0_5: // %bb7
42+
; CHECK-NEXT: mov x22, x8
43+
; CHECK-NEXT: .LBB0_8: // %bb10
3244
; CHECK-NEXT: // =>This Inner Loop Header: Depth=1
3345
; CHECK-NEXT: strb w20, [x19]
34-
; CHECK-NEXT: cbnz x21, .LBB0_5
35-
; CHECK-NEXT: // %bb.6: // %bb8
36-
; CHECK-NEXT: // in Loop: Header=BB0_5 Depth=1
37-
; CHECK-NEXT: bl quux
38-
; CHECK-NEXT: b .LBB0_5
46+
; CHECK-NEXT: cbnz x21, .LBB0_8
47+
; CHECK-NEXT: // %bb.9: // %bb12
48+
; CHECK-NEXT: // in Loop: Header=BB0_8 Depth=1
49+
; CHECK-NEXT: bl snork
50+
; CHECK-NEXT: cbnz x22, .LBB0_8
51+
; CHECK-NEXT: .LBB0_10:
52+
; CHECK-NEXT: mov w0, #0 // =0x0
53+
; CHECK-NEXT: .LBB0_11:
54+
; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
55+
; CHECK-NEXT: ldp x22, x21, [sp, #16] // 16-byte Folded Reload
56+
; CHECK-NEXT: ldr x30, [sp], #48 // 8-byte Folded Reload
57+
; CHECK-NEXT: ret
3958
bb:
40-
br i1 %arg1, label %bb6, label %bb4
41-
42-
bb4:
43-
%load = load ptr, ptr null, align 8
44-
br i1 %arg2, label %bb6, label %bb5
59+
br i1 %arg2, label %bb14, label %bb5
4560

4661
bb5:
47-
%call = call i32 @zot() #0
48-
%zext = zext i32 %arg to i64
49-
br i1 %arg1, label %bb6, label %bb7
62+
%load = load ptr, ptr null, align 8
63+
br i1 %arg4, label %bb14, label %bb6
5064

5165
bb6:
52-
ret i32 0
66+
%call = call i32 @baz() #1
67+
%or = or i1 false, true
68+
br i1 %or, label %bb14, label %bb7
5369

5470
bb7:
55-
store i8 0, ptr %arg3, align 1
56-
%icmp = icmp eq i64 %zext, 0
57-
br i1 %icmp, label %bb8, label %bb7
71+
%icmp = icmp eq i32 0, 0
72+
%zext = zext i32 %arg to i64
73+
br i1 %icmp, label %bb14, label %bb8
5874

5975
bb8:
60-
call void @quux()
61-
br label %bb7
76+
%zext9 = zext i32 %arg1 to i64
77+
br label %bb10
78+
79+
bb10:
80+
store i8 0, ptr %arg3, align 1
81+
%icmp11 = icmp eq i64 %zext, 0
82+
br i1 %icmp11, label %bb12, label %bb10
83+
84+
bb12:
85+
call void @snork()
86+
%icmp13 = icmp eq i64 0, %zext9
87+
br i1 %icmp13, label %bb14, label %bb10
88+
89+
bb14:
90+
%phi = phi i32 [ 0, %bb6 ], [ 0, %bb7 ], [ 0, %bb12 ], [ 1, %bb ], [ 0, %bb5 ]
91+
ret i32 %phi
6292
}
6393

64-
declare i32 @zot()
94+
declare i32 @baz()
6595

66-
declare void @quux()
96+
declare void @snork()
6797

68-
attributes #0 = { returns_twice }
98+
attributes #0 = { "target-cpu"="apple-m1" }
99+
attributes #1 = { returns_twice }

llvm/test/Transforms/LoopVectorize/vplan-printing.ll

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ for.end:
329329
ret void
330330
}
331331

332-
define void @debug_loc_vpinstruction(ptr nocapture %asd, ptr nocapture %bsd) !dbg !5 {
333-
; CHECK-LABEL: Checking a loop in 'debug_loc_vpinstruction'
332+
define void @recipe_debug_loc_location(ptr nocapture %src) !dbg !5 {
333+
; CHECK-LABEL: Checking a loop in 'recipe_debug_loc_location'
334334
; CHECK: VPlan 'Initial VPlan for VF={4},UF>=1' {
335335
; CHECK-NEXT: Live-in vp<[[VF:%.]]> = VF
336336
; CHECK-NEXT: Live-in vp<[[VFxUF:%.]]> = VF * UF
@@ -347,14 +347,20 @@ define void @debug_loc_vpinstruction(ptr nocapture %asd, ptr nocapture %bsd) !db
347347
; CHECK-NEXT: vector.body:
348348
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION ir<0>, vp<[[CAN_IV_NEXT:%.+]]>
349349
; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[CAN_IV]]>, ir<1>, vp<[[VF]]>
350-
; CHECK-NEXT: CLONE ir<%isd> = getelementptr inbounds ir<%asd>, vp<[[STEPS]]>
350+
; CHECK-NEXT: CLONE ir<%isd> = getelementptr inbounds ir<%src>, vp<[[STEPS]]>
351+
; CHECK-NOT: !dbg
351352
; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-pointer ir<%isd>
353+
; CHECK-NOT: !dbg
352354
; CHECK-NEXT: WIDEN ir<%lsd> = load vp<[[VEC_PTR]]>
355+
; CHECK-NOT: !dbg
353356
; CHECK-NEXT: WIDEN ir<%psd> = add nuw nsw ir<%lsd>, ir<23>
357+
; CHECK-NOT: !dbg
354358
; CHECK-NEXT: WIDEN ir<%cmp1> = icmp slt ir<%lsd>, ir<100>
355-
; CHECK-NEXT: EMIT vp<[[NOT1:%.+]]> = not ir<%cmp1>, !dbg /tmp/s.c:5:3
359+
; CHECK-NOT: !dbg
360+
; CHECK-NEXT: EMIT vp<[[NOT1:%.+]]> = not ir<%cmp1>, !dbg /tmp/s.c:9:3
356361
; CHECK-NEXT: WIDEN ir<%cmp2> = icmp sge ir<%lsd>, ir<200>
357-
; CHECK-NEXT: EMIT vp<[[SEL1:%.+]]> = logical-and vp<[[NOT1]]>, ir<%cmp2>, !dbg /tmp/s.c:5:21
362+
; CHECK-NOT: !dbg
363+
; CHECK-NEXT: EMIT vp<[[SEL1:%.+]]> = logical-and vp<[[NOT1]]>, ir<%cmp2>, !dbg /tmp/s.c:11:3
358364
; CHECK-NEXT: EMIT vp<[[OR1:%.+]]> = or vp<[[SEL1]]>, ir<%cmp1>
359365
; CHECK-NEXT: Successor(s): pred.sdiv
360366
; CHECK-EMPTY:
@@ -365,18 +371,23 @@ define void @debug_loc_vpinstruction(ptr nocapture %asd, ptr nocapture %bsd) !db
365371
; CHECK-EMPTY:
366372
; CHECK-NEXT: pred.sdiv.if:
367373
; CHECK-NEXT: REPLICATE ir<%sd1> = sdiv ir<%psd>, ir<%lsd> (S->V)
374+
; CHECK-NOT: !dbg
368375
; CHECK-NEXT: Successor(s): pred.sdiv.continue
369376
; CHECK-EMPTY:
370377
; CHECK-NEXT: pred.sdiv.continue:
371378
; CHECK-NEXT: PHI-PREDICATED-INSTRUCTION vp<[[PHI:%.+]]> = ir<%sd1>
379+
; CHECK-NOT: !dbg
372380
; CHECK-NEXT: No successors
373381
; CHECK-NEXT: }
374382
; CHECK-NEXT: Successor(s): if.then.0
375383
; CHECK-EMPTY:
376384
; CHECK-NEXT: if.then.0:
377385
; CHECK-NEXT: BLEND ir<%ysd.0> = ir<%psd> vp<[[PHI]]>/vp<[[OR1]]>
386+
; CHECK-NOT: !dbg
378387
; CHECK-NEXT: vp<[[VEC_PTR2:%.+]]> = vector-pointer ir<%isd>
388+
; CHECK-NOT: !dbg
379389
; CHECK-NEXT: WIDEN store vp<[[VEC_PTR2]]>, ir<%ysd.0>
390+
; CHECK-NOT: !dbg
380391
; CHECK-NEXT: EMIT vp<[[CAN_IV_NEXT]]> = add nuw vp<[[CAN_IV]]>, vp<[[VFxUF]]>
381392
; CHECK-NEXT: EMIT branch-on-count vp<[[CAN_IV_NEXT]]>, vp<[[VTC]]>
382393
; CHECK-NEXT: No successors
@@ -406,23 +417,23 @@ entry:
406417

407418
loop:
408419
%iv = phi i64 [ 0, %entry ], [ %iv.next, %if.end ]
409-
%isd = getelementptr inbounds i32, ptr %asd, i64 %iv
410-
%lsd = load i32, ptr %isd, align 4
411-
%psd = add nuw nsw i32 %lsd, 23
412-
%cmp1 = icmp slt i32 %lsd, 100
413-
br i1 %cmp1, label %if.then, label %check, !dbg !7
420+
%isd = getelementptr inbounds i32, ptr %src, i64 %iv, !dbg !7
421+
%lsd = load i32, ptr %isd, align 4, !dbg !8
422+
%psd = add nuw nsw i32 %lsd, 23, !dbg !9
423+
%cmp1 = icmp slt i32 %lsd, 100, !dbg !10
424+
br i1 %cmp1, label %if.then, label %check, !dbg !11
414425

415426
check:
416-
%cmp2 = icmp sge i32 %lsd, 200
417-
br i1 %cmp2, label %if.then, label %if.end, !dbg !8
427+
%cmp2 = icmp sge i32 %lsd, 200, !dbg !12
428+
br i1 %cmp2, label %if.then, label %if.end, !dbg !13
418429

419430
if.then:
420-
%sd1 = sdiv i32 %psd, %lsd
431+
%sd1 = sdiv i32 %psd, %lsd, !dbg !14
421432
br label %if.end
422433

423434
if.end:
424-
%ysd.0 = phi i32 [ %sd1, %if.then ], [ %psd, %check ]
425-
store i32 %ysd.0, ptr %isd, align 4
435+
%ysd.0 = phi i32 [ %sd1, %if.then ], [ %psd, %check ], !dbg !16
436+
store i32 %ysd.0, ptr %isd, align 4, !dbg !17
426437
%iv.next = add nuw nsw i64 %iv, 1
427438
%exitcond = icmp eq i64 %iv.next, 128
428439
br i1 %exitcond, label %exit, label %loop
@@ -1078,4 +1089,15 @@ attributes #0 = { readonly nounwind "vector-function-abi-variant"="_ZGV_LLVM_M2v
10781089
!5 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 4, type: !6, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
10791090
!6 = !DISubroutineType(types: !2)
10801091
!7 = !DILocation(line: 5, column: 3, scope: !5)
1081-
!8 = !DILocation(line: 5, column: 21, scope: !5)
1092+
!8 = !DILocation(line: 6, column: 3, scope: !5)
1093+
!9 = !DILocation(line: 7, column: 3, scope: !5)
1094+
!10 = !DILocation(line: 8, column: 3, scope: !5)
1095+
!11 = !DILocation(line: 9, column: 3, scope: !5)
1096+
!12 = !DILocation(line: 10, column: 3, scope: !5)
1097+
!13 = !DILocation(line: 11, column: 3, scope: !5)
1098+
!14 = !DILocation(line: 12, column: 3, scope: !5)
1099+
!15 = !DILocation(line: 13, column: 3, scope: !5)
1100+
!16 = !DILocation(line: 14, column: 3, scope: !5)
1101+
!17 = !DILocation(line: 15, column: 3, scope: !5)
1102+
!18 = !DILocation(line: 16, column: 3, scope: !5)
1103+
!19 = !DILocation(line: 17, column: 3, scope: !5)

polly/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ In Polly |version| the following important changes have been incorporated.
1717

1818
* Polly's support for the legacy pass manager has been removed.
1919

20+
* The infrastructure around ScopPasses has been removed.
21+

polly/include/polly/CodeGen/CodeGeneration.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
#define POLLY_CODEGENERATION_H
1111

1212
#include "polly/CodeGen/IRBuilder.h"
13-
#include "polly/ScopPass.h"
14-
#include "llvm/IR/PassManager.h"
13+
14+
namespace llvm {
15+
class RegionInfo;
16+
}
1517

1618
namespace polly {
1719
class IslAstInfo;
1820

21+
using llvm::BasicBlock;
22+
1923
enum VectorizerChoice {
2024
VECTORIZER_NONE,
2125
VECTORIZER_STRIPMINE,
@@ -28,11 +32,6 @@ extern VectorizerChoice PollyVectorizerChoice;
2832
/// UnreachableInst.
2933
void markBlockUnreachable(BasicBlock &Block, PollyIRBuilder &Builder);
3034

31-
struct CodeGenerationPass final : PassInfoMixin<CodeGenerationPass> {
32-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
33-
ScopStandardAnalysisResults &AR, SPMUpdater &U);
34-
};
35-
3635
extern bool PerfMonitoring;
3736

3837
bool runCodeGeneration(Scop &S, llvm::RegionInfo &RI, IslAstInfo &AI);

polly/include/polly/CodeGen/IslAst.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
#define POLLY_ISLAST_H
2323

2424
#include "polly/DependenceInfo.h"
25-
#include "polly/ScopPass.h"
2625
#include "llvm/ADT/SmallPtrSet.h"
27-
#include "llvm/IR/PassManager.h"
2826
#include "isl/ctx.h"
2927

3028
namespace polly {
29+
using llvm::raw_ostream;
3130
using llvm::SmallPtrSet;
3231

3332
class Dependences;
@@ -164,24 +163,6 @@ class IslAstInfo {
164163
///}
165164
};
166165

167-
struct IslAstAnalysis : AnalysisInfoMixin<IslAstAnalysis> {
168-
static AnalysisKey Key;
169-
170-
using Result = IslAstInfo;
171-
172-
IslAstInfo run(Scop &S, ScopAnalysisManager &SAM,
173-
ScopStandardAnalysisResults &SAR);
174-
};
175-
176-
struct IslAstPrinterPass final : PassInfoMixin<IslAstPrinterPass> {
177-
IslAstPrinterPass(raw_ostream &OS) : OS(OS) {}
178-
179-
PreservedAnalyses run(Scop &S, ScopAnalysisManager &SAM,
180-
ScopStandardAnalysisResults &, SPMUpdater &U);
181-
182-
raw_ostream &OS;
183-
};
184-
185166
std::unique_ptr<IslAstInfo> runIslAstGen(Scop &S,
186167
DependenceAnalysis::Result &DA);
187168
} // namespace polly

polly/include/polly/CodePreparation.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,16 @@
1313
#ifndef POLLY_CODEPREPARATION_H
1414
#define POLLY_CODEPREPARATION_H
1515

16-
#include "llvm/IR/PassManager.h"
17-
1816
namespace llvm {
1917
class DominatorTree;
18+
class Function;
2019
class LoopInfo;
2120
class RegionInfo;
2221
} // namespace llvm
2322

2423
namespace polly {
25-
struct CodePreparationPass final : llvm::PassInfoMixin<CodePreparationPass> {
26-
llvm::PreservedAnalyses run(llvm::Function &F,
27-
llvm::FunctionAnalysisManager &FAM);
28-
};
24+
bool runCodePreparation(llvm::Function &F, llvm::DominatorTree *DT,
25+
llvm::LoopInfo *LI, llvm::RegionInfo *RI);
2926
} // namespace polly
3027

3128
#endif /* POLLY_CODEPREPARATION_H */

0 commit comments

Comments
 (0)