This is an archive of the discontinued LLVM Phabricator instance.

[x86] Switch EFLAGS copy lowering to use reg-reg form of testing for a zero register.
ClosedPublic

Authored by chandlerc on Apr 9 2018, 11:59 PM.

Details

Summary

Previously I tried this and saw LLVM unable to transform this to fold
with memory operands such as spill slot rematerialization. However, it
clearly works as shown in this patch. We turn these into `cmpb $0,
<mem>` when useful for folding a memory operand without issue. This form
has no disadvantage compared te testb $-1, <mem>. So overall, this is
likely no worse and may be slightly smaller in some cases due to the
testb %reg, %reg form.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.Apr 9 2018, 11:59 PM
This revision is now accepted and ready to land.Apr 11 2018, 10:43 AM
This revision was automatically updated to reflect the committed changes.