diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-12-19 20:58:01 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-12-19 20:58:01 +0000 |
commit | 5379f412bc6ac6171f3bd73930197bfce88c2faa (patch) | |
tree | 255acf30b79f9f0173c042e7a9f638df376871b8 /test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll | |
parent | de8c611c089d4c6327721367f3ed23b496692478 (diff) | |
download | llvm-5379f412bc6ac6171f3bd73930197bfce88c2faa.tar.gz llvm-5379f412bc6ac6171f3bd73930197bfce88c2faa.tar.bz2 llvm-5379f412bc6ac6171f3bd73930197bfce88c2faa.tar.xz |
Fix PR3149. If an early clobber def is a physical register and it is tied to an input operand, it effectively extends the live range of the physical register. Currently we do not have a good way to represent this.
172 %ECX<def> = MOV32rr %reg1039<kill>
180 INLINEASM <es:subl $5,$1
sbbl $3,$0>, 10, %EAX<def>, 14, %ECX<earlyclobber,def>, 9, %EAX<kill>,
36, <fi#0>, 1, %reg0, 0, 9, %ECX<kill>, 36, <fi#1>, 1, %reg0, 0
188 %EAX<def> = MOV32rr %EAX<kill>
196 %ECX<def> = MOV32rr %ECX<kill>
204 %ECX<def> = MOV32rr %ECX<kill>
212 %EAX<def> = MOV32rr %EAX<kill>
220 %EAX<def> = MOV32rr %EAX
228 %reg1039<def> = MOV32rr %ECX<kill>
The early clobber operand ties ECX input to the ECX def.
The live interval of ECX is represented as this:
%reg20,inf = [46,47:1)[174,230:0) 0@174-(230) 1@46-(47)
The right way to represent this is something like
%reg20,inf = [46,47:2)[174,182:1)[181:230:0) 0@174-(182) 1@181-230 @2@46-(47)
Of course that won't work since that means overlapping live ranges defined by two val#.
The workaround for now is to add a bit to val# which says the val# is redefined by a early clobber def somewhere. This prevents the move at 228 from being optimized away by SimpleRegisterCoalescing::AdjustCopiesBackFrom.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll')
-rw-r--r-- | test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll b/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll index 2466f4fc8e..ba0f8fe1b7 100644 --- a/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll +++ b/test/CodeGen/PowerPC/2007-04-30-InlineAsmEarlyClobber.ll @@ -17,7 +17,7 @@ target triple = "powerpc-apple-darwin8.8.0" ; return ((long long)Y << 32) | X; ;} -define i64 @test(i32 %A, i32 %B, i32 %C) { +define i64 @test(i32 %A, i32 %B, i32 %C) nounwind { entry: %Y = alloca i32, align 4 ; <i32*> [#uses=2] %tmp4 = call i32 asm "subf${3:I}c $1,$4,$3\0A\09subfze $0,$2", "=r,=*&r,r,rI,r"( i32* %Y, i32 %A, i32 %B, i32 %C ) ; <i32> [#uses=1] |