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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 13 11:41:39 PDT 2018


craig.topper created this revision.
craig.topper added reviewers: chandlerc, rnk.

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


https://reviews.llvm.org/D50656

Files:
  lib/Target/X86/X86FlagsCopyLowering.cpp
  test/CodeGen/X86/flags-copy-lowering.mir
  test/CodeGen/X86/pr38539.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50656.160412.patch
Type: text/x-patch
Size: 13232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180813/f0346227/attachment.bin>


More information about the llvm-commits mailing list