summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-03-31 18:14:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-03-31 18:14:00 +0000
commit80c540e656c536918b7c3d6966cf745358ce18b3 (patch)
tree51cf37feed6062f5d3d73331e1393c806e9c436c /llvm/test
parent51861b4855853158b9b35d78d46000af8cc1f500 (diff)
downloadbcm5719-llvm-80c540e656c536918b7c3d6966cf745358ce18b3.tar.gz
bcm5719-llvm-80c540e656c536918b7c3d6966cf745358ce18b3.zip
Teach CodeGen's version of computeMaskedBits to understand the range metadata.
This is the CodeGen equivalent of r153747. I tested that there is not noticeable performance difference with any combination of -O0/-O2 /-g when compiling gcc as a single compilation unit. llvm-svn: 153817
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/pr12360.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/pr12360.ll b/llvm/test/CodeGen/X86/pr12360.ll
new file mode 100644
index 00000000000..c0af432cc8b
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pr12360.ll
@@ -0,0 +1,14 @@
+; RUN: llc < %s -march=x86-64 | FileCheck %s
+
+define zeroext i1 @f1(i8* %x) {
+entry:
+ %0 = load i8* %x, align 1, !range !0
+ %tobool = trunc i8 %0 to i1
+ ret i1 %tobool
+}
+
+; CHECK: f1:
+; CHECK: movb (%rdi), %al
+; CHECK-NEXT: ret
+
+!0 = metadata !{i8 0, i8 2}
OpenPOWER on IntegriCloud