Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 366b5fa

Browse files
committed
Merging r310481, r310492 and r310510:
------------------------------------------------------------------------ r310481 | davide | 2017-08-09 08:13:50 -0700 (Wed, 09 Aug 2017) | 8 lines [ValueTracking] Honour recursion limit. The recently improved support for `icmp` in ValueTracking (r307304) exposes the fact that `isImplied` condition doesn't really bail out if we hit the recursion limit (and calls `computeKnownBits` which increases the depth and asserts). Differential Revision: https://reviews.llvm.org/D36512 ------------------------------------------------------------------------ ------------------------------------------------------------------------ r310492 | davide | 2017-08-09 09:06:04 -0700 (Wed, 09 Aug 2017) | 1 line [ValueTracking] Update tests to unbreak the bots. ------------------------------------------------------------------------ ------------------------------------------------------------------------ r310510 | spatel | 2017-08-09 11:56:26 -0700 (Wed, 09 Aug 2017) | 6 lines [SimplifyCFG] remove checks for crasher test from r310481 Not sure why the earlier version would fail, but trying to get the bots (and my local machine) to pass again. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@310634 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 926f393 commit 366b5fa

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4458,6 +4458,10 @@ Optional<bool> llvm::isImpliedCondition(const Value *LHS, const Value *RHS,
44584458
unsigned Depth, AssumptionCache *AC,
44594459
const Instruction *CxtI,
44604460
const DominatorTree *DT) {
4461+
// Bail out when we hit the limit.
4462+
if (Depth == MaxDepth)
4463+
return None;
4464+
44614465
// A mismatch occurs when we compare a scalar cmp to a vector cmp, for example.
44624466
if (LHS->getType() != RHS->getType())
44634467
return None;
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
; RUN: opt -simplifycfg -S < %s | FileCheck %s
2+
3+
; Just checking for lack of crash here, but we should be able to check the IR?
4+
; Earlier version using auto-generated checks from utils/update_test_checks.py
5+
; had bot problems though...
6+
7+
define void @patatino() {
8+
9+
; CHECK-LABEL: @patatino
10+
11+
br label %bb1
12+
bb1: ; preds = %bb36, %0
13+
br label %bb2
14+
bb2: ; preds = %bb3, %bb1
15+
br i1 undef, label %bb4, label %bb3
16+
bb3: ; preds = %bb4, %bb2
17+
br i1 undef, label %bb2, label %bb5
18+
bb4: ; preds = %bb2
19+
switch i32 undef, label %bb3 [
20+
]
21+
bb5: ; preds = %bb3
22+
br label %bb6
23+
bb6: ; preds = %bb5
24+
br i1 undef, label %bb7, label %bb9
25+
bb7: ; preds = %bb6
26+
%tmp = or i64 undef, 1
27+
%tmp8 = icmp ult i64 %tmp, 0
28+
br i1 %tmp8, label %bb12, label %bb9
29+
bb9: ; preds = %bb35, %bb34, %bb33, %bb32, %bb31, %bb30, %bb27, %bb24, %bb21, %bb18, %bb16, %bb14, %bb12, %bb7, %bb6
30+
br label %bb11
31+
bb10: ; preds = %bb36
32+
br label %bb11
33+
bb11: ; preds = %bb10, %bb9
34+
ret void
35+
bb12: ; preds = %bb7
36+
%tmp13 = icmp ult i64 0, 0
37+
br i1 %tmp13, label %bb14, label %bb9
38+
bb14: ; preds = %bb12
39+
%tmp15 = icmp ult i64 undef, 0
40+
br i1 %tmp15, label %bb16, label %bb9
41+
bb16: ; preds = %bb14
42+
%tmp17 = icmp ult i64 undef, 0
43+
br i1 %tmp17, label %bb18, label %bb9
44+
bb18: ; preds = %bb16
45+
%tmp19 = or i64 undef, 5
46+
%tmp20 = icmp ult i64 %tmp19, 0
47+
br i1 %tmp20, label %bb21, label %bb9
48+
bb21: ; preds = %bb18
49+
%tmp22 = or i64 undef, 6
50+
%tmp23 = icmp ult i64 %tmp22, 0
51+
br i1 %tmp23, label %bb24, label %bb9
52+
bb24: ; preds = %bb21
53+
%tmp25 = or i64 undef, 7
54+
%tmp26 = icmp ult i64 %tmp25, 0
55+
br i1 %tmp26, label %bb27, label %bb9
56+
bb27: ; preds = %bb24
57+
%tmp28 = or i64 undef, 8
58+
%tmp29 = icmp ult i64 %tmp28, 0
59+
br i1 %tmp29, label %bb30, label %bb9
60+
bb30: ; preds = %bb27
61+
br i1 undef, label %bb31, label %bb9
62+
bb31: ; preds = %bb30
63+
br i1 undef, label %bb32, label %bb9
64+
bb32: ; preds = %bb31
65+
br i1 undef, label %bb33, label %bb9
66+
bb33: ; preds = %bb32
67+
br i1 undef, label %bb34, label %bb9
68+
bb34: ; preds = %bb33
69+
br i1 undef, label %bb35, label %bb9
70+
bb35: ; preds = %bb34
71+
br i1 undef, label %bb36, label %bb9
72+
bb36: ; preds = %bb35
73+
br i1 undef, label %bb1, label %bb10
74+
}

0 commit comments

Comments
 (0)