diff options
author | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-12-11 11:37:27 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@linux.vnet.ibm.com> | 2013-12-11 11:37:27 +0000 |
commit | 3c14ba596248d64cc3f464e244d23abf934cde3e (patch) | |
tree | d5d3f8003e20fbecafa55ffd539482bea1322546 /test/CodeGen/SystemZ | |
parent | 255ee7df297976f93bf1e1b4a00fd78d13a4a449 (diff) | |
download | llvm-3c14ba596248d64cc3f464e244d23abf934cde3e.tar.gz llvm-3c14ba596248d64cc3f464e244d23abf934cde3e.tar.bz2 llvm-3c14ba596248d64cc3f464e244d23abf934cde3e.tar.xz |
Extend (truncate (load)) folding
DAGCombiner could fold (truncate (load)) -> smaller load if the original
load was the width of the truncation result or wider. This patch extends
it to handle cases where the original load was narrower (and so the
extension type stays the same).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197030 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ')
-rw-r--r-- | test/CodeGen/SystemZ/insert-06.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/insert-06.ll b/test/CodeGen/SystemZ/insert-06.ll index edcd0c5dcc..81a9c87707 100644 --- a/test/CodeGen/SystemZ/insert-06.ll +++ b/test/CodeGen/SystemZ/insert-06.ll @@ -178,3 +178,17 @@ define i64 @f14(i64 %a, i64 %b) { %ext = sext i1 %res to i64 ret i64 %ext } + +; Check another representation of f8. +define i64 @f15(i64 %a, i8 *%src) { +; CHECK-LABEL: f15: +; CHECK-NOT: {{%r[23]}} +; CHECK: lb %r2, 0(%r3) +; CHECK: br %r14 + %byte = load i8 *%src + %b = sext i8 %byte to i64 + %low = and i64 %b, 4294967295 + %high = and i64 %a, -4294967296 + %res = or i64 %high, %low + ret i64 %res +} |