summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-03-26 01:44:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-03-26 01:44:11 +0000
commitdf9b4adb821a5144ccafcb5840be92eb3d2e5c70 (patch)
tree4772de68fe5a36f226b5aff0fa0b276abf9ce946 /llvm/test
parent5fa0caafc0ccfb45c879219d4fb6962018e51b89 (diff)
downloadbcm5719-llvm-df9b4adb821a5144ccafcb5840be92eb3d2e5c70.tar.gz
bcm5719-llvm-df9b4adb821a5144ccafcb5840be92eb3d2e5c70.zip
Use the new range metadata in computeMaskedBits and add a new optimization to
instruction simplify that lets us remove an and when loding a boolean value. llvm-svn: 153423
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstSimplify/pr12251.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/pr12251.ll b/llvm/test/Transforms/InstSimplify/pr12251.ll
new file mode 100644
index 00000000000..f180f9f1eba
--- /dev/null
+++ b/llvm/test/Transforms/InstSimplify/pr12251.ll
@@ -0,0 +1,15 @@
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+define zeroext i1 @_Z3fooPb(i8* nocapture %x) {
+entry:
+ %a = load i8* %x, align 1, !range !0
+ %b = and i8 %a, 1
+ %tobool = icmp ne i8 %b, 0
+ ret i1 %tobool
+}
+
+; CHECK: %a = load i8* %x, align 1, !range !0
+; CHECK-NEXT: %tobool = icmp ne i8 %a, 0
+; CHECK-NEXT: ret i1 %tobool
+
+!0 = metadata !{i8 0, i8 2}
OpenPOWER on IntegriCloud