summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2019-06-13 02:47:47 +0000
committerShawn Landden <shawn@git.icu>2019-06-13 02:47:47 +0000
commitc6cba2957d520b41de7fef7dfbfc8edc35c228e3 (patch)
treeb1f879ad01b422e9d219e0e48628623e9d4830dd /llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
parentf93b99b2b6a429f020aca2ea8c503e7553f3777c (diff)
downloadbcm5719-llvm-c6cba2957d520b41de7fef7dfbfc8edc35c228e3.tar.gz
bcm5719-llvm-c6cba2957d520b41de7fef7dfbfc8edc35c228e3.zip
[SimplifyCFG] revert the last commit.
I ran ALL the test suite locally, so I will look into this... llvm-svn: 363223
Diffstat (limited to 'llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll')
-rw-r--r--llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll32
1 files changed, 16 insertions, 16 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll b/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
index b7bf8054a6f..c42568ffa93 100644
--- a/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
+++ b/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
@@ -1,4 +1,3 @@
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -simplifycfg -switch-to-lookup < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
; RUN: opt -S -passes='simplify-cfg<switch-to-lookup>' < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
@@ -6,24 +5,25 @@
target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-darwin12.0.0"
+; When we have a covered lookup table, make sure we don't delete PHINodes that
+; are cached in PHIs.
+; CHECK-LABEL: @test
+; CHECK: entry:
+; CHECK-NEXT: sub i3 %arg, -4
+; CHECK-NEXT: zext i3 %switch.tableidx to i4
+; CHECK-NEXT: getelementptr inbounds [8 x i64], [8 x i64]* @switch.table.test, i32 0, i4 %switch.tableidx.zext
+; CHECK-NEXT: load i64, i64* %switch.gep
+; CHECK-NEXT: add i64
+; CHECK-NEXT: ret i64
define i64 @test(i3 %arg) {
-; CHECK-LABEL: @test(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[SWITCH_TABLEIDX:%.*]] = sub i3 [[ARG:%.*]], -4
-; CHECK-NEXT: [[SWITCH_TABLEIDX_ZEXT:%.*]] = zext i3 [[SWITCH_TABLEIDX]] to i4
-; CHECK-NEXT: [[SWITCH_GEP:%.*]] = getelementptr inbounds [8 x i64], [8 x i64]* @switch.table.test, i32 0, i4 [[SWITCH_TABLEIDX_ZEXT]]
-; CHECK-NEXT: [[SWITCH_LOAD:%.*]] = load i64, i64* [[SWITCH_GEP]]
-; CHECK-NEXT: [[V3:%.*]] = add i64 [[SWITCH_LOAD]], 0
-; CHECK-NEXT: ret i64 [[V3]]
-;
entry:
switch i3 %arg, label %Default [
- i3 -2, label %Label6
- i3 1, label %Label1
- i3 2, label %Label2
- i3 3, label %Label3
- i3 -4, label %Label4
- i3 -3, label %Label5
+ i3 -2, label %Label6
+ i3 1, label %Label1
+ i3 2, label %Label2
+ i3 3, label %Label3
+ i3 -4, label %Label4
+ i3 -3, label %Label5
]
Default:
OpenPOWER on IntegriCloud