1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/include/llvm
John Brawn 9f05fb5e02 [BPI] Don't assume that strcmp returning >0 is more likely than <0
The zero heuristic assumes that integers are more likely positive than negative,
but this also has the effect of assuming that strcmp return values are more
likely positive than negative. Given that for nonzero strcmp return values it's
the ordering of arguments that determines the sign of the result there's no
reason to assume that's true.

Fix this by inspecting the LHS of the compare and using TargetLibraryInfo to
decide if it's strcmp-like, and if so only assume that nonzero is more likely
than zero i.e. strings are more often different than the same. This causes a
slight code generation change in the spec2006 benchmark 403.gcc, but with no
noticeable performance impact. The intent of this patch is to allow better
optimisation of dhrystone on Cortex-M cpus, but currently it won't as there are
also some changes that need to be made to if-conversion.

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

llvm-svn: 304970
2017-06-08 09:44:40 +00:00
..
ADT [APInt] Fix the documentation for isOneValue. NFC 2017-06-07 07:40:43 +00:00
Analysis [BPI] Don't assume that strcmp returning >0 is more likely than <0 2017-06-08 09:44:40 +00:00
AsmParser
BinaryFormat Add #include <system_error> 2017-06-07 03:55:31 +00:00
Bitcode Remove ignore-empty-index-file option 2017-05-12 19:32:11 +00:00
CodeGen [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-06-07 23:53:32 +00:00
Config [cmake] Enable reverse iteration by default through build macro 2017-06-06 00:36:09 +00:00
DebugInfo Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
Demangle Add an c++ itanium demangler to llvm. 2016-09-06 19:16:48 +00:00
ExecutionEngine Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
IR [InstCombine][InstSimplify] Use APInt::isNullValue/isOneValue to reduce compiled code for comparing APInts with 0 and 1. NFC 2017-06-07 07:40:37 +00:00
IRReader
LineEditor Apply clang-tidy's misc-move-constructor-init throughout LLVM. 2016-05-27 14:27:24 +00:00
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
LTO Symbols re-defined with -wrap and -defsym need to be excluded from inter- 2017-06-05 16:24:25 +00:00
MC Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
Object Object: Factor out the code for creating the irsymtab for an arbitrary bitcode file. 2017-06-08 01:26:14 +00:00
ObjectYAML Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
Option Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Passes [PM/ThinLTO] Port the ThinLTO pipeline (both components) to the new PM. 2017-06-01 11:39:39 +00:00
ProfileData Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Support Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
TableGen [TableGen] Remove a couple unused methods from Record that take a StringRef argument. NFC 2017-06-02 05:56:47 +00:00
Target [DAG] Move SelectionDAG::isCommutativeBinOp to TargetLowering. 2017-06-07 14:05:04 +00:00
ToolDrivers/llvm-lib Move lib/LibDriver -> lib/ToolDrivers/llvm-lib. NFCI. 2017-05-13 22:06:46 +00:00
Transforms [SLP] Comment fix, NFC. 2017-06-07 20:37:24 +00:00
XRay [XRay][tools] Add option to llvm-xray extract to symbolize functions 2017-04-18 23:23:54 +00:00
CMakeLists.txt Support: Add a VCSRevision.h header file. 2017-04-13 01:26:12 +00:00
InitializePasses.h Change code formatting to look like the surrounding code 2017-06-02 23:07:58 +00:00
LinkAllIR.h Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
LinkAllPasses.h Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
module.modulemap Add BinaryFormat module definition 2017-06-07 17:16:25 +00:00
module.modulemap.build Fix module map to create a module for the configured header Config/abi-breaking.h 2016-12-01 19:08:38 +00:00
Pass.h Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
PassAnalysisSupport.h Reverted: Track validity of pass results 2017-01-15 10:23:18 +00:00
PassInfo.h [LegacyPassManager] Remove TargetMachine constructors 2017-05-18 17:21:13 +00:00
PassRegistry.h
PassSupport.h [LegacyPassManager] Remove TargetMachine constructors 2017-05-18 17:21:13 +00:00