OSDN Git Service

[X86] In EFLAGS copy pass, don't emit EXTRACT_SUBREG instructions since we're after...
authorCraig Topper <craig.topper@intel.com>
Thu, 16 Aug 2018 21:54:02 +0000 (21:54 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 16 Aug 2018 21:54:02 +0000 (21:54 +0000)
commit2e94bd60b5ad3721b15f80dae39c35188138371f
treeed89bf56f3cb87d784ddbefb81bc28885006b39b
parentd2a106bf4ee9d334985f8f68b30d8a46ffd7f55d
[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/trunk@339945 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]