diff options
| author | Davide Italiano <davide@freebsd.org> | 2017-01-26 00:42:42 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2017-01-26 00:42:42 +0000 |
| commit | ccbbc8313fce35fdd305a0ef7eeb213af7e9708f (patch) | |
| tree | 973dfa44f2398f99c755675fe0401a0e9551d542 /llvm/test/Transforms | |
| parent | 916923e689527e99bb6c1675c95a7ce9c0d53713 (diff) | |
| download | bcm5719-llvm-ccbbc8313fce35fdd305a0ef7eeb213af7e9708f.tar.gz bcm5719-llvm-ccbbc8313fce35fdd305a0ef7eeb213af7e9708f.zip | |
[NewGVN] Skip uses in unreachable blocks.
Otherwise we ask for a domtree node that's not there, and we crash.
Differential Revision: https://reviews.llvm.org/D29145
llvm-svn: 293122
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/NewGVN/pr31758.ll | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/llvm/test/Transforms/NewGVN/pr31758.ll b/llvm/test/Transforms/NewGVN/pr31758.ll new file mode 100644 index 00000000000..ca33299a104 --- /dev/null +++ b/llvm/test/Transforms/NewGVN/pr31758.ll @@ -0,0 +1,37 @@ +; RUN: opt -newgvn %s -S -o - | FileCheck %s + +%struct.dipsy = type {} +%struct.fluttershy = type { %struct.dipsy* } +%struct.patatino = type {} + +define void @tinkywinky() { +bb: + br label %bb90 + +bb90: + %tmp = getelementptr inbounds %struct.fluttershy, %struct.fluttershy* undef, i64 0, i32 0 + %tmp91 = bitcast %struct.dipsy** %tmp to %struct.patatino** + %tmp92 = load %struct.patatino*, %struct.patatino** %tmp91, align 8 + %tmp99 = getelementptr inbounds %struct.patatino, %struct.patatino* %tmp92 + %tmp134 = getelementptr inbounds %struct.fluttershy, %struct.fluttershy* undef, i64 0, i32 0 + %tmp135 = bitcast %struct.dipsy** %tmp134 to %struct.patatino** + %tmp136 = load %struct.patatino*, %struct.patatino** %tmp135, align 8 + br label %bb90 + +bb138: + %tmp139 = getelementptr inbounds %struct.patatino, %struct.patatino* %tmp136 + br label %bb138 +} + +; CHECK-LABEL: tinkywinky +; CHECK-NEXT: bb: +; CHECK-NEXT: br label %bb90 +; CHECK-NEXT +; CHECK: bb90: +; CHECK: %tmp91 = bitcast %struct.dipsy** undef to %struct.patatino** +; CHECK-NEXT: %tmp92 = load %struct.patatino*, %struct.patatino** %tmp91, align 8 +; CHECK-NEXT: %tmp136 = load %struct.patatino*, %struct.patatino** %tmp91, align 8 +; CHECK-NEXT: br label %bb90 +; CHECK: bb138: +; CHECK-NEXT: br label %bb138 +; CHECK-NEXT: } |

