summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorChuang-Yu Cheng <cycheng@multicorewareinc.com>2016-04-01 02:05:29 +0000
committerChuang-Yu Cheng <cycheng@multicorewareinc.com>2016-04-01 02:05:29 +0000
commit35c6181982900a7f27f224d40c9e1a230803bd94 (patch)
tree0fa101565be946df44e933935a4ca99deda1b8a0 /llvm/test
parent4ea9e9c9bbb6c0697fb1bf5db5cf35975e6a6937 (diff)
downloadbcm5719-llvm-35c6181982900a7f27f224d40c9e1a230803bd94.tar.gz
bcm5719-llvm-35c6181982900a7f27f224d40c9e1a230803bd94.zip
Fix Sub-register Rewriting in Aggressive Anti-Dependence Breaker
Previously, HandleLastUse would delete RegRef information for sub-registers if they were dead even if their corresponding super-register were still live. If the super-register were later renamed, then the definitions of the sub-register would not be updated appropriately. This patch alters the behavior so that RegInfo information for sub-registers is only deleted when the sub-register and super-register are both dead. This resolves PR26775. This is the mirror image of Hal's r227311 commit. Author: Tom Jablin (tjablin) Reviewers: kbarton uweigand nemanjai hfinkel http://reviews.llvm.org/D18448 llvm-svn: 265097
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/PowerPC/aggressive-anti-dep-breaker-subreg.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/aggressive-anti-dep-breaker-subreg.ll b/llvm/test/CodeGen/PowerPC/aggressive-anti-dep-breaker-subreg.ll
new file mode 100644
index 00000000000..c57588668d8
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/aggressive-anti-dep-breaker-subreg.ll
@@ -0,0 +1,24 @@
+; RUN: llc %s -mtriple=powerpc64-unknown-linux-gnu -O2 -o - -optimize-regalloc=false -regalloc=fast | FileCheck %s
+
+declare void @func(i8*, i64, i64)
+
+define void @test(i8* %context, i32** %elementArrayPtr, i32 %value) {
+entry:
+ %cmp = icmp eq i32 %value, 0
+ br i1 %cmp, label %lreturn, label %lnext
+
+lnext:
+ %elementArray = load i32*, i32** %elementArrayPtr, align 8
+; CHECK: lwz [[LDREG:[0-9]+]], 124(1) # 4-byte Folded Reload
+; CHECK: # implicit-def: %X[[TEMPREG:[0-9]+]]
+ %element = load i32, i32* %elementArray, align 4
+; CHECK: mr [[TEMPREG]], [[LDREG]]
+; CHECK: clrldi 4, [[TEMPREG]], 32
+ %element.ext = zext i32 %element to i64
+ %value.ext = zext i32 %value to i64
+ call void @func(i8* %context, i64 %value.ext, i64 %element.ext)
+ br label %lreturn
+
+lreturn:
+ ret void
+}
OpenPOWER on IntegriCloud