OSDN Git Service

Merging r339945:
authorHans Wennborg <hans@hanshq.net>
Fri, 17 Aug 2018 07:38:52 +0000 (07:38 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 17 Aug 2018 07:38:52 +0000 (07:38 +0000)
commitdff83e99c9120289d8da0cbd89ab0b9ddd3e8971
treedbfdfc6a5df2cc1a5cccd3c64d5b2ab2377f57cd
parente7782a92f7f754ecf3ef0c4c0041a77d745f590e
Merging r339945:
------------------------------------------------------------------------
r339945 | ctopper | 2018-08-16 23:54:02 +0200 (Thu, 16 Aug 2018) | 9 lines

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

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

Differential Revision: https://reviews.llvm.org/D50656
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_70@339999 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FlagsCopyLowering.cpp
test/CodeGen/X86/flags-copy-lowering.mir
test/CodeGen/X86/pr38539.ll [new file with mode: 0644]