[PATCH] FIx bug in x87 FP stackifier pass

Akira Hatanaka ahatanak at gmail.com
Tue Jul 1 16:55:02 PDT 2014


The x87 FP stackifier pass has a bug where the liveness of an ST register
defined by an inline-asm instruction is not tracked precisely.

This causes the assertion on line 1365 to fail when an ST register defined
by an inline-asm is live across another inline-asm, as shown in the
following example:

INLINEASM <es:frndint> [sideeffect] [attdialect], $0:[regdef],
%ST0<imp-def,tied5>, $1:[reguse tiedto:$0], %ST0<tied3>, $2:[clobber],
%EFLAGS<earlyclobber,imp-def,dead>

INLINEASM <es:fldcw $0> [sideeffect] [mayload] [attdialect], $0:[mem],
%EAX<undef>, 1, %noreg, 0, %noreg, $1:[clobber],
%EFLAGS<earlyclobber,imp-def,dead>
%FP0<def> = COPY %ST0 // %ST0 is defined by the first inline-asm
instruction.

In order to fix this bug, the attached patch uses FP registers for function
returns and inline-asm instructions where previously ST registers were
being used and adds kill flags that are missing in FP register operands.

rdar://problem/16952634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140701/f67c5dbe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x87stackifier1.patch
Type: application/octet-stream
Size: 34498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140701/f67c5dbe/attachment.obj>


More information about the llvm-commits mailing list