1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
llvm-mirror/include/llvm/IR
Sanjay Patel 7177ce0576 [CodeGenPrepare] use branch weight metadata to decide if a select should be turned into a branch
This is part of solving PR27344:
https://llvm.org/bugs/show_bug.cgi?id=27344

CGP should undo the SimplifyCFG transform for the same reason that earlier patches have used this
same mechanism: it's possible that passes between SimplifyCFG and CGP may be able to optimize the
IR further with a select in place.

For the TLI hook default, >99% taken or not taken is chosen as the default threshold for a highly
predictable branch. Even the most limited HW branch predictors will be correct on this branch almost
all the time, so even a massive mispredict penalty perf loss would be overcome by the win from all
the times the branch was predicted correctly.

As a follow-up, we could make the default target hook less conservative by using the SchedMachineModel's
MispredictPenalty. Or we could just let targets override the default by implementing the hook with that
and other target-specific options. Note that trying to statically determine mispredict rates for 
close-to-balanced profile weight data is generally impossible if the HW is sufficiently advanced. Ie, 
50/50 taken/not-taken might still be 100% predictable.

Finally, note that this patch as-is will not solve PR27344 because the current __builtin_unpredictable()
branch weight default values are 4 and 64. A proposal to change that is in D19435.

Differential Revision: http://reviews.llvm.org/D19488

llvm-svn: 267572
2016-04-26 17:11:17 +00:00
..
Argument.h Swift Calling Convention: add swifterror attribute. 2016-04-01 21:41:15 +00:00
AssemblyAnnotationWriter.h
Attributes.h Add the allocsize attribute to LLVM. 2016-04-12 01:05:35 +00:00
Attributes.td Add the allocsize attribute to LLVM. 2016-04-12 01:05:35 +00:00
AutoUpgrade.h IR: Stop upgrading !llvm.loop attachments via MDString 2016-03-25 00:56:13 +00:00
BasicBlock.h Introduce @llvm.experimental.deoptimize 2016-03-11 19:08:34 +00:00
CallingConv.h AMDGPU: Add a shader calling convention 2016-04-06 19:40:20 +00:00
CallSite.h Add utility function to manipulate attributes on CallSite. NFC 2016-04-21 21:29:10 +00:00
CFG.h
CMakeLists.txt
Comdat.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
Constant.h Simplify handleOperandChangeImpl() removing last argument (NFC) 2016-02-10 22:47:15 +00:00
ConstantFolder.h
ConstantRange.h [ConstantRange] Generalize makeGuaranteedNoWrapRegion to work on ranges 2016-03-03 18:31:16 +00:00
Constants.h IR: Introduce ConstantAggregate, NFC 2016-04-05 21:10:45 +00:00
DataLayout.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
DebugInfo.h DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
DebugInfoFlags.def
DebugInfoMetadata.h DebugInfo: Remove MDString-based type references 2016-04-23 21:08:00 +00:00
DebugLoc.h
DerivedTypes.h don't repeat names in documentation comments; NFC 2016-02-25 15:55:28 +00:00
DiagnosticInfo.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
DiagnosticPrinter.h
DIBuilder.h IR: Use SmallVector instead of std::vector of TrackingMDRef 2016-04-20 20:14:09 +00:00
Dominators.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
Function.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
GetElementPtrTypeIterator.h [opaque pointer types] [NFC] gep_type_{begin,end} now take source element type and address space. 2016-01-22 01:33:43 +00:00
GlobalAlias.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
GlobalIFunc.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
GlobalIndirectSymbol.h [GCC] Attribute ifunc support in llvm 2016-04-07 12:32:19 +00:00
GlobalObject.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
GlobalValue.h Revert "Declare GlobalValue::LinkageTypes based on unsigned." 2016-04-24 14:13:17 +00:00
GlobalVariable.h Don't IPO over functions that can be de-refined 2016-04-08 00:48:30 +00:00
GVMaterializer.h [ThinLTO] Remove post-pass metadata linking support 2016-03-29 18:24:19 +00:00
InlineAsm.h
InstIterator.h
InstrTypes.h [EarlyCSE] Take the intersection of flags on instructions 2016-04-22 06:37:45 +00:00
Instruction.def [IR] Remove terminatepad 2015-12-14 18:34:23 +00:00
Instruction.h [CodeGenPrepare] use branch weight metadata to decide if a select should be turned into a branch 2016-04-26 17:11:17 +00:00
Instructions.h [CodeGenPrepare] use branch weight metadata to decide if a select should be turned into a branch 2016-04-26 17:11:17 +00:00
InstVisitor.h [IR] Remove terminatepad 2015-12-14 18:34:23 +00:00
IntrinsicInst.h IR: Add DbgInfoIntrinsic::getVariableLocation 2016-03-29 18:56:03 +00:00
Intrinsics.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
Intrinsics.td Fix comment about Intr*Mem properties 2016-04-22 22:37:58 +00:00
IntrinsicsAArch64.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsAMDGPU.td AMDGPU: Add queue ptr intrinsic 2016-04-25 19:27:18 +00:00
IntrinsicsARM.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsBPF.td
IntrinsicsHexagon.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsMips.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsNVVM.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsPowerPC.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsSystemZ.td Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly 2016-04-21 17:48:02 +00:00
IntrinsicsWebAssembly.td
IntrinsicsX86.td Fixing wrong mask size error. From __mmask8 to __mmask16. 2016-04-25 05:27:51 +00:00
IntrinsicsXCore.td
IRBuilder.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
IRPrintingPasses.h
LegacyPassManager.h
LegacyPassManagers.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
LegacyPassNameParser.h
LLVMContext.h Re-commit optimization bisect support (r267022) without new pass manager support. 2016-04-22 22:06:11 +00:00
Mangler.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
MDBuilder.h
Metadata.def BitcodeReader: Avoid referencing unresolved nodes from distinct ones 2016-04-23 04:15:56 +00:00
Metadata.h BitcodeReader: Avoid referencing unresolved nodes from distinct ones 2016-04-23 04:15:56 +00:00
Module.h [ThinLTO] Prevent importing of "llvm.used" values 2016-04-20 14:39:45 +00:00
ModuleSlotTracker.h IR: Avoid mallocs in constructor of ModuleSlotTracker 2016-04-20 19:05:59 +00:00
ModuleSummaryIndex.h [ThinLTO] Introduce typedef for commonly-used map type (NFC) 2016-04-25 21:09:51 +00:00
NoFolder.h
OperandTraits.h
Operator.h [EarlyCSE] Take the intersection of flags on instructions 2016-04-22 06:37:45 +00:00
OptBisect.h Re-commit optimization bisect support (r267022) without new pass manager support. 2016-04-22 22:06:11 +00:00
PassManager.h PM: Remove some redundant name() methods 2016-04-22 17:25:43 +00:00
PassManagerInternal.h [PM] Make the AnalysisManager parameter to run methods a reference. 2016-03-11 11:05:24 +00:00
PatternMatch.h Add optimization for 'icmp slt (or A, B), A' and some related idioms based on knowledge of the sign bit for A and B. 2016-04-21 00:53:14 +00:00
PredIteratorCache.h
Statepoint.h Minor comment cleanup [NFC] 2016-04-21 16:15:19 +00:00
SymbolTableListTraits.h [GCC] Attribute ifunc support in llvm 2016-04-07 12:32:19 +00:00
TrackingMDRef.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
Type.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
TypeBuilder.h
TypeFinder.h Make more headers self-contained. 2016-01-27 18:03:37 +00:00
Use.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
UseListOrder.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
User.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
Value.def [GCC] Attribute ifunc support in llvm 2016-04-07 12:32:19 +00:00
Value.h Comment formating. NFC 2016-04-25 22:23:30 +00:00
ValueHandle.h
ValueMap.h Linker: Avoid constructing ValueMap::MDMapT 2016-04-19 16:57:24 +00:00
ValueSymbolTable.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00
Verifier.h Remove some unneeded headers and replace some headers with forward class declarations (NFC) 2016-04-16 07:51:28 +00:00