[PATCH] Mark vastart_save_xmm_regs as changing EFLAGS

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Dec 16 23:29:40 PST 2013

On 2013 Dec 16, at 22:17, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:

> On 2013 Dec 16, at 22:12, Andrew Trick <atrick at apple.com> wrote:
>> On Dec 15, 2013, at 12:25 AM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>>> This patch marks vastart_save_xmm_regs as changing EFLAGS.
>>> The vastart_save_xmm_regs pseudo-instruction expands to a test and a
>>> branch, so it modifies EFLAGS.  Mark it so, or else the scheduler might
>>> place it in the middle of another test+branch.
>>> This fixes a bug exposed by r192750, which turned on the MI Scheduler
>>> for X86.
>> LGTM.
>> For the record, the SD scheduler was the one reordering the TEST/VASTART. The change that caused it was moving to source order scheduling. As a result the TEST ended up in a totally different MI block.
>> Incidentally, MI Scheduler still fails to schedule the test+je together because test appears to have unmodelled side effects (unrelated issue).
>> -Andy
> Thanks for the review!  In r197469.

FYI, I pulled this out in r197481 because of failing buildbots.  "make check” passes for me.

Was adding “Defs = [EFLAGS]” the wrong way to mark that VASTART_SAVE_XMM_REGS clobbers EFLAGS, or have I done something else wrong here?  (I’ll look into it tomorrow.)

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/4652 (sanitizer):

> *** Bad machine code: Using an undefined physical register ***
> - function:    _ZL8vaargsfniz
> - basic block: BB#1 entry (0xd6c59c0)
> - instruction: MOVAPSmr <fi#5>, 1, %noreg, 176, %noreg, %EFLAGS; mem:ST16[FixedStack5+176]
> - operand 5:   %EFLAGS

http://lab.llvm.org:8011/builders/dragonegg-x86_64-linux-gcc-4.5-self-host/builds/5986 (dragonegg):

> /tmp/cc1UDbG2.s: Assembler messages:
> /tmp/cc1UDbG2.s:19909: Error: bad register name `%flags'
> /tmp/cc1UDbG2.s:68387: Error: bad register name `%flags'
> /tmp/cc1UDbG2.s:73048: Error: bad register name `%flags'
> make: *** [Convert.o] Error 1

More information about the llvm-commits mailing list