This is an archive of the discontinued LLVM Phabricator instance.

[X86] In EFLAGS copy pass, don't emit EXTRACT_SUBREG instructions since we're after peephole
ClosedPublic

Authored by craig.topper on Aug 13 2018, 11:41 AM.

Details

Summary

Normally the peephole pass converts EXTRACT_SUBREG to COPY instructions. But we're after peephole so we can't rely on it to clean these up.

To fix this, the eflags pass now emits a COPY with a subreg input.

I also noticed that in 32-bit mode we need to constrain the input to the copy to ensure the subreg is valid. Otherwise we'll fail verify-machineinstrs

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 13 2018, 11:41 AM
chandlerc accepted this revision.Aug 16 2018, 2:27 PM

Yikes, good catch! LGTM.

test/CodeGen/X86/pr38539.ll
5 ↗(On Diff #160412)

nit: 80-columns?

176 ↗(On Diff #160412)

nit: 80-columns

This revision is now accepted and ready to land.Aug 16 2018, 2:27 PM
This revision was automatically updated to reflect the committed changes.