llvm.org GIT mirror llvm / 9b4509a
AArch64: Re-enable AArch64AddressTypePromotion This reverts commits r212189 and r212190. While this pass was accidentally disabled (until r212073), r205437 slipped in a use of `auto` that should have been `auto&`. This fixes PR20188. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212201 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 6 years ago
4 changed file(s) with 58 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
383383 if (ToRemove.count(Inst))
384384 continue;
385385 bool inserted = false;
386 for (auto Pt : CurPts) {
386 for (auto &Pt : CurPts) {
387387 if (DT.dominates(Inst, Pt)) {
388388 DEBUG(dbgs() << "Replace all uses of:\n" << *Pt << "\nwith:\n"
389389 << *Inst << '\n');
154154 addPass(createAArch64PromoteConstantPass());
155155 if (TM->getOptLevel() != CodeGenOpt::None)
156156 addPass(createGlobalMergePass(TM));
157 if (TM->getOptLevel() != CodeGenOpt::None)
158 addPass(createAArch64AddressTypePromotionPass());
157159
158160 return false;
159161 }
0 ; RUN: llc -O3 -mcpu=cortex-a53 -mtriple=aarch64--linux-gnu %s -o - | FileCheck %s
1 ; PR20188: don't crash when merging sexts.
2
3 ; CHECK: foo:
4 define void @foo() unnamed_addr align 2 {
5 entry:
6 br label %invoke.cont145
7
8 invoke.cont145:
9 %or.cond = and i1 undef, false
10 br i1 %or.cond, label %if.then274, label %invoke.cont145
11
12 if.then274:
13 %0 = load i32* null, align 4
14 br i1 undef, label %invoke.cont291, label %if.else313
15
16 invoke.cont291:
17 %idxprom.i.i.i605 = sext i32 %0 to i64
18 %arrayidx.i.i.i607 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i605
19 %idxprom.i.i.i596 = sext i32 %0 to i64
20 %arrayidx.i.i.i598 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i596
21 br label %if.end356
22
23 if.else313:
24 %cmp314 = fcmp olt double undef, 0.000000e+00
25 br i1 %cmp314, label %invoke.cont317, label %invoke.cont353
26
27 invoke.cont317:
28 br i1 undef, label %invoke.cont326, label %invoke.cont334
29
30 invoke.cont326:
31 %idxprom.i.i.i587 = sext i32 %0 to i64
32 %arrayidx.i.i.i589 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i587
33 %sub329 = fsub fast double undef, undef
34 br label %invoke.cont334
35
36 invoke.cont334:
37 %lo.1 = phi double [ %sub329, %invoke.cont326 ], [ undef, %invoke.cont317 ]
38 br i1 undef, label %invoke.cont342, label %if.end356
39
40 invoke.cont342:
41 %idxprom.i.i.i578 = sext i32 %0 to i64
42 %arrayidx.i.i.i580 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i578
43 br label %if.end356
44
45 invoke.cont353:
46 %idxprom.i.i.i572 = sext i32 %0 to i64
47 %arrayidx.i.i.i574 = getelementptr inbounds double* undef, i64 %idxprom.i.i.i572
48 br label %if.end356
49
50 if.end356:
51 %lo.2 = phi double [ 0.000000e+00, %invoke.cont291 ], [ %lo.1, %invoke.cont342 ], [ undef, %invoke.cont353 ], [ %lo.1, %invoke.cont334 ]
52 call void null(i32 %0, double %lo.2)
53 unreachable
54 }
0 ; RUN: llc < %s -o - | FileCheck %s
1 ; XFAIL: *
21
32 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32:64"
43 target triple = "arm64-apple-macosx10.9"