diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-20 04:09:00 +0000 | 
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-20 04:09:00 +0000 | 
| commit | 727aa349ad3c49d590693961ae0d0dfb39d95089 (patch) | |
| tree | 507abcf56762fadf081b59c624f9bede246efe02 /llvm/test/Transforms/Inline | |
| parent | 8ed6f2aacfe83bb823de2eb7975e704b89d1264b (diff) | |
| download | bcm5719-llvm-727aa349ad3c49d590693961ae0d0dfb39d95089.tar.gz bcm5719-llvm-727aa349ad3c49d590693961ae0d0dfb39d95089.zip  | |
Have InlineCost check constant fcmps
llvm-svn: 186758
Diffstat (limited to 'llvm/test/Transforms/Inline')
| -rw-r--r-- | llvm/test/Transforms/Inline/inline_constprop.ll | 31 | 
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/inline_constprop.ll b/llvm/test/Transforms/Inline/inline_constprop.ll index 2371fbcf11a..b59a270468e 100644 --- a/llvm/test/Transforms/Inline/inline_constprop.ll +++ b/llvm/test/Transforms/Inline/inline_constprop.ll @@ -187,6 +187,37 @@ bb.false:    ret i64 %y8  } +define float @caller6() { +; Check that we can constant-prop through fcmp instructions +; +; CHECK-LABEL: @caller6( +; CHECK-NOT: call +; CHECK: ret +  %x = call float @callee6(float 42.0) +  ret float %x +} + +define float @callee6(float %x) { +  %icmp = fcmp ugt float %x, 42.0 +  br i1 %icmp, label %bb.true, label %bb.false + +bb.true: +  ; This block musn't be counted in the inline cost. +  %x1 = fadd float %x, 1.0 +  %x2 = fadd float %x1, 1.0 +  %x3 = fadd float %x2, 1.0 +  %x4 = fadd float %x3, 1.0 +  %x5 = fadd float %x4, 1.0 +  %x6 = fadd float %x5, 1.0 +  %x7 = fadd float %x6, 1.0 +  %x8 = fadd float %x7, 1.0 +  ret float %x8 + +bb.false: +  ret float %x +} + +  define i32 @PR13412.main() {  ; This is a somewhat complicated three layer subprogram that was reported to  | 

