1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/include/llvm/Target
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
..
CostTable.h Remove templates from CostTableLookup functions. All instantiations had the same type. 2015-10-28 04:02:12 +00:00
GenericOpcodes.td [GlobalISel][Target] Add an opcode for unconditional branch. 2016-03-11 17:27:38 +00:00
Target.td Introduce a "patchable-function" function attribute 2016-04-19 05:24:47 +00:00
TargetCallingConv.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
TargetCallingConv.td Swift Calling Convention: add swifterror attribute. 2016-04-01 21:41:15 +00:00
TargetFrameLowering.h Change eliminateCallFramePseudoInstr() to return an iterator 2016-03-31 18:33:38 +00:00
TargetInstrInfo.h [MachineCombiner] Support for floating-point FMA on ARM64 (re-commit r267098) 2016-04-24 05:14:01 +00:00
TargetIntrinsicInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
TargetItinerary.td Hexagon V60/HVX DFA scheduler support 2015-11-21 20:00:45 +00:00
TargetLowering.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
TargetLoweringObjectFile.h CodeGen: Use PLT relocations for relative references to unnamed_addr functions. 2016-04-22 20:40:10 +00:00
TargetMachine.h C API: Remove LLVMGetDataLayout that was deprecated in 3.7 2016-02-12 06:22:00 +00:00
TargetOpcodes.def Introduce a "patchable-function" function attribute 2016-04-19 05:24:47 +00:00
TargetOpcodes.h [Target] Add a helper function to check if an opcode is invalid after isel. 2016-02-11 21:16:56 +00:00
TargetOptions.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
TargetRecip.h Unbreak building LLVMTarget on Windows after r266595. 2016-04-18 13:38:58 +00:00
TargetRegisterInfo.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
TargetSchedule.td Remove MinLatency in SchedMachineModel. NFC. 2016-04-26 00:37:46 +00:00
TargetSelectionDAG.td AMDGPU: Implement canonicalize 2016-04-14 01:42:16 +00:00
TargetSubtargetInfo.h [Target] Remove a deprecated comment. 2016-04-05 23:04:54 +00:00