summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-08-21 23:42:53 +0000
committerVedant Kumar <vsk@apple.com>2018-08-21 23:42:53 +0000
commit8d652b756e33b6deb4e469ac7494d0967a22aab7 (patch)
treef05d753f5f757179d456eae072544d0436376ace /llvm/test
parent00e7558edde5ce7d065468b40167a5f31f0a44be (diff)
downloadbcm5719-llvm-8d652b756e33b6deb4e469ac7494d0967a22aab7.tar.gz
bcm5719-llvm-8d652b756e33b6deb4e469ac7494d0967a22aab7.zip
[CodeGenPrepare] Pre-commit debug info test for optimizeSelectInst
This test shows that optimizeSelectInst splits a select and sinks a `fdiv` operation to one side of the diamond. However, the dbg.value for the operation isn't moved. llvm-svn: 340369
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/CodeGenPrepare/X86/select.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/CodeGenPrepare/X86/select.ll b/llvm/test/Transforms/CodeGenPrepare/X86/select.ll
index 58d81b55be1..9abb2861595 100644
--- a/llvm/test/Transforms/CodeGenPrepare/X86/select.ll
+++ b/llvm/test/Transforms/CodeGenPrepare/X86/select.ll
@@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -codegenprepare -S < %s | FileCheck %s
+; RUN: opt -debugify -codegenprepare -S < %s | FileCheck %s -check-prefix=DEBUG
target triple = "x86_64-unknown-unknown"
@@ -35,6 +36,20 @@ define float @fdiv_true_sink(float %a, float %b) {
; CHECK-NEXT: [[SEL:%.*]] = phi float [ [[DIV]], [[SELECT_TRUE_SINK]] ], [ 2.000000e+00, [[ENTRY:%.*]] ]
; CHECK-NEXT: ret float [[SEL]]
;
+; DEBUG-LABEL: @fdiv_true_sink(
+; DEBUG-NEXT: entry:
+; DEBUG-NEXT: call void @llvm.dbg.value(metadata float [[DIV:%[^,]+]]
+; DEBUG-NEXT: [[CMP:%.*]] = fcmp ogt float [[A:%.*]], 1.000000e+00
+; DEBUG-NEXT: call void @llvm.dbg.value(metadata i1 [[CMP]]
+; DEBUG-NEXT: br i1 [[CMP]], label [[SELECT_TRUE_SINK:%.*]], label [[SELECT_END:%[^,]+]]
+; DEBUG: select.true.sink:
+; DEBUG-NEXT: [[DIV]] = fdiv float [[A]], [[B:%.*]]
+; DEBUG-NEXT: br label [[SELECT_END]]
+; DEBUG: select.end:
+; DEBUG-NEXT: [[SEL:%.*]] = phi float [ [[DIV]], [[SELECT_TRUE_SINK]] ], [ 2.000000e+00, [[ENTRY:%.*]] ]
+; DEBUG-NEXT: call void @llvm.dbg.value(metadata float [[SEL]]
+; DEBUG-NEXT: ret float [[SEL]]
+;
entry:
%div = fdiv float %a, %b
%cmp = fcmp ogt float %a, 1.0
OpenPOWER on IntegriCloud