llvm-project/llvm/lib
Chandler Carruth 5ecd81aab0 [x86][eflags] Fix PR37431 by teaching the EFLAGS copy lowering to
specially handle SETB_C* pseudo instructions.

Summary:
While the logic here is somewhat similar to the arithmetic lowering, it
is different enough that it made sense to have its own function.
I actually tried a bunch of different optimizations here and none worked
well so I gave up and just always do the arithmetic based lowering.

Looking at code from the PR test case, we actually pessimize a bunch of
code when generating these. Because SETB_C* pseudo instructions clobber
EFLAGS, we end up creating a bunch of copies of EFLAGS to feed multiple
SETB_C* pseudos from a single set of EFLAGS. This in turn causes the
lowering code to ruin all the clever code generation that SETB_C* was
hoping to achieve. None of this is needed. Whenever we're generating
multiple SETB_C* instructions from a single set of EFLAGS we should
instead generate a single maximally wide one and extract subregs for all
the different desired widths. That would result in substantially better
code generation. But this patch doesn't attempt to address that.

The test case from the PR is included as well as more directed testing
of the specific lowering pattern used for these pseudos.

Reviewers: craig.topper

Subscribers: sanjoy, mcrosier, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D46799

llvm-svn: 332389
2018-05-15 20:16:57 +00:00
..
Analysis [MemorySSA] Don't sort IDF blocks. 2018-05-15 18:40:29 +00:00
AsmParser [STLExtras] Add distance() for ranges, pred_size(), and succ_size() 2018-05-10 23:01:54 +00:00
BinaryFormat [WebAssembly] Move toString helpers to BinaryFormat 2018-05-14 22:42:07 +00:00
Bitcode [STLExtras] Add distance() for ranges, pred_size(), and succ_size() 2018-05-10 23:01:54 +00:00
CodeGen [DAG] propagate FMF for all FPMathOperators 2018-05-15 14:16:24 +00:00
DebugInfo Reapply "DWARFVerifier: Check "completeness" of .debug_names section" 2018-05-15 13:24:10 +00:00
Demangle [demangler] Add a partial demangling API for LLDB. 2018-04-12 20:41:38 +00:00
ExecutionEngine Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer [libFuzzer] Delete llvm/lib/Fuzzer 2017-10-16 20:48:19 +00:00
IR [Debugify] Add -debugify-each for testing each pass in a pipeline 2018-05-15 00:29:27 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
LineEditor
Linker [ThinLTO] Recommit of import global variables 2018-03-12 10:30:50 +00:00
MC [WebAssembly] Move toString helpers to BinaryFormat 2018-05-14 22:42:07 +00:00
Object Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
ObjectYAML Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
Option Revert "[Option] Fix PR37006 prefix choice in findNearest" 2018-05-14 22:36:47 +00:00
Passes Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
ProfileData Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
Support [NFC] pull a function into its own lambda 2018-05-15 04:23:48 +00:00
TableGen Revert r330742: Let TableGen write output only if it changed, instead of doing so in cmake. 2018-05-07 23:41:48 +00:00
Target [x86][eflags] Fix PR37431 by teaching the EFLAGS copy lowering to 2018-05-15 20:16:57 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers [COFF] Improve correctness of def parsing for GNU features 2018-05-09 09:21:53 +00:00
Transforms [InstCombine] fix binop-of-shuffles to check uses 2018-05-15 17:14:23 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt