[llvm] r229101 - [SimplifyCFG] Add test for r229099
James Molloy
james.molloy at arm.com
Fri Feb 13 03:08:40 PST 2015
Author: jamesm
Date: Fri Feb 13 05:08:40 2015
New Revision: 229101
URL: http://llvm.org/viewvc/llvm-project?rev=229101&view=rev
Log:
[SimplifyCFG] Add test for r229099
Add extra test that was accidentally not staged.
Added:
llvm/trunk/test/Transforms/SimplifyCFG/clamp.ll
Added: llvm/trunk/test/Transforms/SimplifyCFG/clamp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SimplifyCFG/clamp.ll?rev=229101&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SimplifyCFG/clamp.ll (added)
+++ llvm/trunk/test/Transforms/SimplifyCFG/clamp.ll Fri Feb 13 05:08:40 2015
@@ -0,0 +1,22 @@
+; RUN: opt < %s -simplifycfg -S | FileCheck %s
+
+define float @clamp(float %a, float %b, float %c) {
+; CHECK-LABEL: @clamp
+; CHECK: %cmp = fcmp ogt float %a, %c
+; CHECK: %cmp1 = fcmp olt float %a, %b
+; CHECK: %cond = select i1 %cmp1, float %b, float %a
+; CHECK: %cond5 = select i1 %cmp, float %c, float %cond
+; CHECK: ret float %cond5
+entry:
+ %cmp = fcmp ogt float %a, %c
+ br i1 %cmp, label %cond.end4, label %cond.false
+
+cond.false: ; preds = %entry
+ %cmp1 = fcmp olt float %a, %b
+ %cond = select i1 %cmp1, float %b, float %a
+ br label %cond.end4
+
+cond.end4: ; preds = %entry, %cond.false
+ %cond5 = phi float [ %cond, %cond.false ], [ %c, %entry ]
+ ret float %cond5
+}
More information about the llvm-commits
mailing list