1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/test/Transforms
Craig Topper b74172394c [LoopIdiomRecognize] Add a test case to show incorrect transformation of an infinite loop with side effets into a countable loop using ctlz.
We currently recognize this idiom where x is signed and thus the shift in an ashr.

int cnt = 0;
while (x) {
  x >>= 1; // arithmetic shift right
  ++cnt;
}

and turn it into (bitwidth - ctlz(x)). And if there is anything else in the loop we will create a new loop that runs that many times.

If x is initially negative, the shift result will never be 0 and thus the loop is infinite. If you put something with side effects in the loop, that side effect will now only happen bitwidth times instead of an infinite number of times.

So this transform is only safe for logical shift right (which we don't currently recognize) or if we can prove that x cannot be negative before the loop.

llvm-svn: 331493
2018-05-03 23:50:29 +00:00
..
ADCE
AddDiscriminators
AggressiveInstCombine [AggressiveInstCombine] convert a chain of 'or-shift' bits into masked compare 2018-05-01 21:02:09 +00:00
AlignmentFromAssumptions
ArgumentPromotion
AtomicExpand
BDCE
BlockExtractor
BranchFolding
CalledValuePropagation
CallSiteSplitting [CallSiteSplit] Make sure we remove nonnull if the parameter turns out to be a constant. 2018-04-23 20:09:08 +00:00
CodeExtractor [PartialInlining] Fix Crash from holding a reference to a destructed ORE. 2018-04-20 19:56:26 +00:00
CodeGenPrepare Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
ConstantHoisting
ConstantMerge
ConstProp
Coroutines [coroutines] Respect alloca alignment requirements when building coroutine frame 2018-04-03 20:54:20 +00:00
CorrelatedValuePropagation [CVP] simplify phi with constant incoming values that match common variable edge values 2018-04-10 20:42:39 +00:00
CrossDSOCFI
DCE
DeadArgElim [DeadArgElim] Remove allocsize attributes on callsites 2018-04-12 02:06:01 +00:00
DeadStoreElimination perform DSE through launder.invariant.group 2018-05-03 11:03:53 +00:00
DivRemPairs
EarlyCSE
EliminateAvailableExternally
EntryExitInstrumenter EntryExitInstrumenter: Handle musttail calls 2018-04-06 10:14:09 +00:00
ExpandMemCmp/X86
Float2Int
ForcedFunctionAttrs
FunctionAttrs
FunctionImport [ThinLTO] Add an import cutoff for debugging/triaging 2018-04-01 15:54:40 +00:00
GCOVProfiling [GCOV] Emit the writeout function as nested loops of global data. 2018-05-02 22:24:39 +00:00
GlobalDCE
GlobalMerge
GlobalOpt Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
GlobalSplit
GuardWidening [LoopGuardWidening] Make PostDomTree optional 2018-04-27 23:15:56 +00:00
GVN Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
GVNHoist [NFC] fix trivial typos in documents and comments 2018-04-12 05:53:20 +00:00
GVNSink
IndirectBrExpand
IndVarSimplify [SCEV] Prove implications for SCEVUnknown Phis 2018-04-04 05:46:47 +00:00
InferAddressSpaces
InferFunctionAttrs
Inline Don't inline @llvm.icall.branch.funnel 2018-04-04 21:46:27 +00:00
InstCombine [InstCombine] refine select-of-constants to bitwise ops 2018-05-03 21:58:44 +00:00
InstMerge
InstNamer
InstSimplify Reland r301880(!): "[InstSimplify] Handle selects of GEPs with 0 offset" 2018-04-24 00:25:01 +00:00
InterleavedAccess
Internalize
IPConstantProp
IRCE [IRCE] Only check for NSW on equality predicates 2018-04-18 13:50:28 +00:00
JumpThreading Fix the issue that ComputeValueKnownInPredecessors only handles the case when 2018-05-01 14:47:24 +00:00
LCSSA
LICM [MustExecute/LICM] Special case first instruction in throwing header 2018-04-27 20:44:01 +00:00
LoadStoreVectorizer [LoadStoreVectorize] Ignore interleaved invariant loads. 2018-04-24 15:28:47 +00:00
LoopDataPrefetch
LoopDeletion
LoopDistribute
LoopIdiom [LoopIdiomRecognize] Add a test case to show incorrect transformation of an infinite loop with side effets into a countable loop using ctlz. 2018-05-03 23:50:29 +00:00
LoopInterchange [LoopInterchange] Allow some loops with PHI nodes in the exit block. 2018-04-27 13:52:51 +00:00
LoopLoadElim
LoopPredication
LoopReroll
LoopRotate [LoopRotate] Fix incorrect SCEV invalidation in loop rotation 2018-04-23 12:33:31 +00:00
LoopSimplify Re-enable "[SCEV] Make computeExitLimit more simple and more powerful" 2018-05-03 02:37:55 +00:00
LoopSimplifyCFG
LoopStrengthReduce
LoopUnroll [LoopUnroll] Only peel if a predicate becomes known in the loop body. 2018-04-18 12:29:24 +00:00
LoopUnswitch [NFC] Use FileCheck in test 2018-04-24 04:42:37 +00:00
LoopVectorize [LV] Move test/Transforms/LoopVectorize/pr23997.ll 2018-05-01 16:40:45 +00:00
LoopVersioning
LoopVersioningLICM
LowerAtomic
LowerExpectIntrinsic
LowerGuardIntrinsic
LowerInvoke
LowerSwitch
LowerTypeTests [LowerTypeTests] Mark .cfi.jumptable nounwind. 2018-04-27 00:32:24 +00:00
Mem2Reg [Mem2Reg] Create merged debug locations for inserted phis 2018-04-17 22:03:08 +00:00
MemCpyOpt [MemCpyOpt] Skip optimizing basic blocks not reachable from entry 2018-04-23 19:55:04 +00:00
MergeFunc
MergeICmps [MergeICmp] Split blocks that do other work. 2018-04-09 13:14:06 +00:00
MetaRenamer
NameAnonGlobals
NaryReassociate
NewGVN Rename invariant.group.barrier to launder.invariant.group 2018-05-03 11:03:01 +00:00
ObjCARC [ObjCARC] Account for funclet token in storeStrong transform 2018-04-20 22:11:03 +00:00
PartiallyInlineLibCalls
PGOProfile [ICP] Do not attempt type matching for variable length arguments. 2018-04-25 17:19:21 +00:00
PhaseOrdering [AggressiveInstCombine] convert a chain of 'or-shift' bits into masked compare 2018-05-01 21:02:09 +00:00
PlaceSafepoints
PreISelIntrinsicLowering
PruneEH
Reassociate [reassociate] Fix excessive revisits when processing long chains of reassociatable instructions. 2018-05-02 17:59:16 +00:00
Reg2Mem
RewriteStatepointsForGC
SafeStack
SampleProfile
Scalarizer
SCCP
SeparateConstOffsetFromGEP
SimpleLoopUnswitch [PM/LoopUnswitch] Fix a bug in the loop block set formation of the new 2018-04-24 10:33:08 +00:00
SimplifyCFG [RISCV] Implement isTruncateFree 2018-04-26 13:37:00 +00:00
Sink
SLPVectorizer [AMDGPU] Support horizontal vectorization. 2018-05-01 21:41:12 +00:00
SpeculateAroundPHIs
SpeculativeExecution
SROA
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols
StructurizeCFG StructurizeCFG: Test for branch divergence correctly 2018-04-04 10:58:15 +00:00
SyntheticCountsPropagation
TailCallElim
ThinLTOBitcodeWriter Fix build failures for r330387 on buildbots that don't build the X86 target 2018-04-20 02:26:12 +00:00
Util
WholeProgramDevirt Runtime flag to control branch funnel threshold 2018-04-06 21:32:36 +00:00