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:24:24 +0000
committerShawn Landden <shawn@git.icu>2019-06-13 02:24:24 +0000
commitf93b99b2b6a429f020aca2ea8c503e7553f3777c (patch)
tree3da484444848c18ab5bb7532d5c6b3e83e05d3ed /llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
parentf3356722184362c2e99ad6590f26eacadb507377 (diff)
downloadbcm5719-llvm-f93b99b2b6a429f020aca2ea8c503e7553f3777c.tar.gz
bcm5719-llvm-f93b99b2b6a429f020aca2ea8c503e7553f3777c.zip
[SimplifyCFG] NFC, update Switch tests to HEAD so I can
see if my changes change anything Also add baseline tests to show effect of later patches. Differential Revision: https://reviews.llvm.org/D61150 llvm-svn: 363222
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 c42568ffa93..b7bf8054a6f 100644
--- a/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
+++ b/llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
@@ -1,3 +1,4 @@
+; 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
@@ -5,25 +6,24 @@
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