1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
llvm-mirror/test/Transforms/SimplifyCFG
Sanjay Patel 5a59407f3b [MIPS] add overrides for isCheapToSpeculateCttz() and isCheapToSpeculateCtlz()
MIPS32 has instructions for efficient count-leading/trailing-zeros, so this should be
considered a cheap operation (and therefore fair game for speculation) for any MIPS32
implementation.

The net result of allowing this speculation for the regression tests in this patch is
that we get this code:

ctlz:
  jr  $ra
  clz  $2, $4

cttz:
  addiu  $1, $4, -1
  not  $2, $4
  and  $1, $2, $1
  clz  $1, $1
  addiu  $2, $zero, 32
  jr  $ra
  subu  $2, $2, $1

Instead of:

ctlz:
  beqz  $4, $BB0_2
  addiu  $2, $zero, 32
  clz  $2, $4
$BB0_2:
  jr  $ra
  nop

cttz:
  beqz  $4, $BB1_2
  addiu  $2, $zero, 32
  addiu  $1, $4, -1
  not  $2, $4
  and  $1, $2, $1
  clz  $1, $1
  addiu  $2, $zero, 32
  subu  $2, $2, $1
$BB1_2:
  jr  $ra
  nop

See D14469 for the larger motivation.

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

llvm-svn: 252755
2015-11-11 17:24:56 +00:00
..
AArch64 [AArch64] add overrides for isCheapToSpeculateCttz() and isCheapToSpeculateCtlz() 2015-11-10 18:11:37 +00:00
AMDGPU AMDGPU: Fix some places missed in rename 2015-06-19 17:39:03 +00:00
ARM [ARM] add overrides for isCheapToSpeculateCttz() and isCheapToSpeculateCtlz() 2015-11-10 19:24:31 +00:00
Mips [MIPS] add overrides for isCheapToSpeculateCttz() and isCheapToSpeculateCtlz() 2015-11-11 17:24:56 +00:00
PowerPC
SPARC
X86 Changed renaming of local symbols by inserting a dot vefore the numeric suffix. 2015-05-12 16:47:30 +00:00
2002-05-21-PHIElimination.ll
2002-09-24-PHIAssertion.ll
2003-03-07-DominateProblem.ll
2003-08-05-InvokeCrash.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
2003-08-17-BranchFold.ll
2003-08-17-BranchFoldOrdering.ll
2003-08-17-FoldSwitch-dbg.ll
2003-08-17-FoldSwitch.ll
2004-12-10-SimplifyCFGCrash.ll
2005-06-16-PHICrash.ll
2005-08-01-PHIUpdateFail.ll
2005-10-02-InvokeSimplify.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
2005-12-03-IncorrectPHIFold.ll
2006-02-17-InfiniteUnroll.ll
2006-06-12-InfLoop.ll
2006-08-03-Crash.ll
2006-10-19-UncondDiv.ll
2006-12-08-Ptr-ICmp-Branch.ll
2007-11-22-InvokeNoUnwind.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
2007-12-21-Crash.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
2008-01-02-hoist-fp-add.ll
2008-05-16-PHIBlockMerge.ll
2008-07-13-InfLoopMiscompile.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
2008-09-08-MultiplePred.ll
2008-09-17-SpeculativeHoist.ll
2008-10-03-SpeculativelyExecuteBeforePHI.ll
2008-12-06-SingleEntryPhi.ll
2008-12-16-DCECond.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
2009-01-18-PHIPropCrash.ll
2009-01-19-UnconditionalTrappingConstantExpr.ll
2009-05-12-externweak.ll
2010-03-30-InvokeCrash.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
2011-03-08-UnreachableUse.ll
2011-09-05-TrivialLPad.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
assume.ll
attr-noduplicate.ll
basictest.ll DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
branch-cond-merge.ll
branch-cond-prop.ll
branch-fold-dbg.ll DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
branch-fold-test.ll
branch-fold-threshold.ll
branch-fold.ll
branch-phi-thread.ll
BrUnwind.ll
clamp.ll
common-dest-folding.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
CoveredLookupTable.ll
dbginfo.ll
dce-cond-after-folding-terminator.ll
DeadSetCC.ll
duplicate-landingpad.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
duplicate-phis.ll
empty-cleanuppad.ll [WinEH] Pull Adjectives and CatchObj out of the catchpad arg list 2015-09-16 20:16:27 +00:00
EmptyBlockMerge.ll
EqualPHIEdgeBlockMerge.ll
extract-cost.ll
ForwardSwitchConditionToPHI.ll
hoist-common-code.ll
hoist-dbgvalue.ll DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
hoist-with-range.ll
HoistCode.ll
implied-cond.ll [SimplifyCFG] Constant fold a branch implied by it's incoming edge 2015-10-29 03:11:49 +00:00
indirectbr.ll
invoke_unwind.ll Revert rL251061 [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad. 2015-10-23 21:13:01 +00:00
invoke.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
iterative-simplify.ll
lifetime.ll
MagicPointer.ll
merge-cond-stores.ll [SimplifyCFG] Merge conditional stores 2015-11-04 15:28:04 +00:00
multiple-phis.ll
no_speculative_loads_with_asan.ll [asan] Disabling speculative loads under asan. Patch by Mike Aizatsky 2015-10-14 00:21:05 +00:00
no_speculative_loads_with_tsan.ll
noreturn-call.ll
phi-undef-loadstore.ll
PhiBlockMerge2.ll
PhiBlockMerge.ll
PhiEliminate2.ll
PhiEliminate3.ll
PhiEliminate.ll
PHINode.ll
PhiNoEliminate.ll
PR9946.ll
PR16069.ll
PR17073.ll
PR25267.ll [SimplifyCFG] Don't use-after-free an SSA value 2015-10-21 18:22:24 +00:00
preserve-branchweights-partial.ll
preserve-branchweights-switch-create.ll
preserve-branchweights.ll
preserve-load-metadata-2.ll Preserve load alignment and dereferenceable metadata during some transformations 2015-11-02 17:53:51 +00:00
preserve-load-metadata-3.ll Preserve load alignment and dereferenceable metadata during some transformations 2015-11-02 17:53:51 +00:00
preserve-load-metadata.ll Preserve load alignment and dereferenceable metadata during some transformations 2015-11-02 17:53:51 +00:00
preserve-make-implicit-on-switch-to-br.ll [ConstantFoldTerminator] Preserve make.implicit metadata when converting SwitchInst to BranchInst 2015-08-07 19:30:12 +00:00
return-merge.ll
seh-nounwind.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
select-gep.ll
sink-common-code.ll
speculate-math.ll set div/rem default values to 'expensive' in TargetTransformInfo's cost model 2015-09-23 22:28:18 +00:00
speculate-store.ll
speculate-vector-ops.ll
speculate-with-offset.ll
SpeculativeExec.ll Revert "Strip metadata when speculatively hoisting instructions" 2015-11-10 18:01:16 +00:00
statepoint-invoke-unwind.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
switch_create.ll
switch_switch_fold.ll
switch_thread.ll
switch-dead-default.ll [SimplifyCFG] Use known bits to eliminate dead switch defaults 2015-09-10 17:44:47 +00:00
switch-masked-bits.ll
switch-on-const-select.ll
switch-range-to-icmp.ll
switch-simplify-crash.ll
switch-to-br.ll
switch-to-icmp.ll
switch-to-select-multiple-edge-per-block-phi.ll
switch-to-select-two-case.ll
trap-debugloc.ll DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
trapping-load-unreachable.ll
two-entry-phi-return.ll
UncondBranchToReturn.ll
unreachable-blocks.ll
UnreachableEliminate.ll Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
volatile-phioper.ll [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
wineh-unreachable.ll [SimplifyCFG] Don't DCE catchret because the successor is unreachable 2015-10-27 22:43:56 +00:00