diff options
author | Evgeny Stupachenko <evstupac@gmail.com> | 2017-06-06 20:04:16 +0000 |
---|---|---|
committer | Evgeny Stupachenko <evstupac@gmail.com> | 2017-06-06 20:04:16 +0000 |
commit | 3b88291581c1d79aeb0b2aca8f55dfc4b4c7460c (patch) | |
tree | 2a2e957278f1712ac3c8a18358d2f8adeb8956e0 /llvm/test/CodeGen/X86/atom-fixup-lea3.ll | |
parent | 4d4cd8bb97a252dabe5734e97e0337d408f6649a (diff) | |
download | bcm5719-llvm-3b88291581c1d79aeb0b2aca8f55dfc4b4c7460c.tar.gz bcm5719-llvm-3b88291581c1d79aeb0b2aca8f55dfc4b4c7460c.zip |
Fix PR23384 (part 3 of 3)
Summary:
The patch makes instruction count the highest priority for
LSR solution for X86 (previously registers had highest priority).
Reviewers: qcolombet
Differential Revision: http://reviews.llvm.org/D30562
From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 304824
Diffstat (limited to 'llvm/test/CodeGen/X86/atom-fixup-lea3.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/atom-fixup-lea3.ll | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/X86/atom-fixup-lea3.ll b/llvm/test/CodeGen/X86/atom-fixup-lea3.ll index ed2df277480..e79d2e69e34 100644 --- a/llvm/test/CodeGen/X86/atom-fixup-lea3.ll +++ b/llvm/test/CodeGen/X86/atom-fixup-lea3.ll @@ -1,6 +1,8 @@ ; RUN: llc < %s -mcpu=atom -mtriple=i686-linux | FileCheck %s -; CHECK: addl ([[reg:%[a-z]+]]) -; CHECK-NEXT: addl $4, [[reg]] +; CHECK: addl ({{%[a-z]+}},[[reg:%[a-z]+]],4) +; CHECK-NEXT: movl +; CHECK-NEXT: addl 4({{%[a-z]+}},[[reg:%[a-z]+]],4) +; CHECK-NEXT: incl ; Test for the FixupLEAs pre-emit pass. ; An LEA should NOT be substituted for the ADD instruction @@ -20,7 +22,7 @@ ; return sum; ;} -define i32 @test(i32 %n, i32* nocapture %array, i32* nocapture %m, i32* nocapture %array2) #0 { +define i32 @test(i32 %n, i32* nocapture %array, i32* nocapture %k, i32* nocapture %l, i32* nocapture %m, i32* nocapture %array2) #0 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %for.body.lr.ph, label %for.end @@ -35,6 +37,9 @@ for.body: ; preds = %for.body, %for.body %j.09 = phi i32 [ 0, %for.body.lr.ph ], [ %inc1, %for.body ] %inc1 = add nsw i32 %j.09, 1 %arrayidx = getelementptr inbounds i32, i32* %array2, i32 %j.09 + store i32 %0, i32* %m, align 4 + store i32 %sum.010, i32* %m, align 4 + store i32 %0, i32* %m, align 4 %1 = load i32, i32* %arrayidx, align 4 %add = add nsw i32 %0, %1 store i32 %add, i32* %m, align 4 |