1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib/Transforms/Scalar
Fraser Cormack 5e5115bbd0 [MemCpyOpt] Fix a variety of scalable-type crashes
This patch fixes a variety of crashes resulting from the `MemCpyOptPass`
casting `TypeSize` to a constant integer, whether implicitly or
explicitly.

Since the `MemsetRanges` requires a constant size to work, all but one
of the fixes in this patch simply involve skipping the various
optimizations for scalable types as cleanly as possible.

The optimization of `byval` parameters, however, has been updated to
work on scalable types in theory. In practice, this optimization is only
valid when the length of the `memcpy` is known to be larger than the
scalable type size, which is currently never the case. This could
perhaps be done in the future using the `vscale_range` attribute.

Some implicit casts have been left as they were, under the knowledge
they are only called on aggregate types. These should never be
scalably-sized.

Reviewed By: nikic, tra

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

(cherry-picked from commit 7fb66d4)
2021-09-09 16:21:27 -07:00
..
ADCE.cpp [IR] Consider non-willreturn as side effect (PR50511) 2021-07-26 16:35:14 +02:00
AlignmentFromAssumptions.cpp [AlignFromAssume] Bailout w/non-constant alignments (pr51680) 2021-09-01 17:36:37 -07:00
AnnotationRemarks.cpp [Remarks] Add analysis remarks for memset/memcpy/memmove lengths 2021-05-24 10:10:44 -07:00
BDCE.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
CallSiteSplitting.cpp [Support] Introduce a new InstructionCost class 2020-12-11 08:12:54 +00:00
CMakeLists.txt Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
ConstantHoisting.cpp [TTI] NFC: Change getIntImmCost[Inst|Intrin] to return InstructionCost 2021-04-23 16:06:36 +01:00
ConstraintElimination.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
CorrelatedValuePropagation.cpp [CVP] Guard against poison in common phi value transform (PR50399) 2021-05-25 20:47:17 +02:00
DCE.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
DeadStoreElimination.cpp Revert "[DSE] Transform memset + malloc --> calloc (PR25892)" 2021-07-23 11:51:59 +02:00
DFAJumpThreading.cpp Remove unused include that's also a layering violation. NFC. 2021-07-27 21:21:55 +02:00
DivRemPairs.cpp [DivRemPairs] make sure we have a valid CFG for hoisting division 2021-08-02 13:52:37 -07:00
EarlyCSE.cpp [FPEnv] EarlyCSE support for constrained intrinsics, default FP environment edition 2021-05-20 14:40:51 -04:00
FlattenCFGPass.cpp [NFC] Reduce include files dependency and AA header cleanup (part 2). 2020-12-17 14:04:48 +03:00
Float2Int.cpp [NFCI] Move DEBUG_TYPE definition below #includes 2021-05-30 17:31:01 +08:00
GuardWidening.cpp [llvm] Use llvm::all_of (NFC) 2021-01-19 20:19:17 -08:00
GVN.cpp GVN.cpp - remove unused <vector> include. NFCI. 2021-06-13 14:06:32 +01:00
GVNHoist.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
GVNSink.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
InductiveRangeCheckElimination.cpp [NFC][NewPM] Remove some AnalysisManager invalidate methods 2021-04-15 16:51:26 -07:00
IndVarSimplify.cpp [IndVarSimplify][NFC] Removed mayThrow from if-condition in predicateLoopExits of IndVarSimplify 2021-05-03 18:25:07 -07:00
InferAddressSpaces.cpp [infer-address-spaces] Handle complex non-pointer constexpr arguments. 2021-07-19 12:15:52 -07:00
InstSimplifyPass.cpp [Bindings] Move LLVMAddInstructionSimplifyPass to Scalar.cpp 2020-09-02 10:35:39 -07:00
IVUsersPrinter.cpp
JumpThreading.cpp [CSSPGO] Undoing the concept of dangling pseudo probe 2021-06-18 15:14:11 -07:00
LICM.cpp Strip undef implying attributes when moving calls 2021-07-27 10:57:05 -04:00
LoopAccessAnalysisPrinter.cpp
LoopBoundSplit.cpp [LoopBoundSplit] Ignore phi node which is not scevable 2021-06-09 09:44:36 +01:00
LoopDataPrefetch.cpp [NFCI] Move DEBUG_TYPE definition below #includes 2021-05-30 17:31:01 +08:00
LoopDeletion.cpp [LoopDeletion] Handle switch in proving that loop exits on first iteration 2021-07-09 18:03:34 +07:00
LoopDistribute.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
LoopFlatten.cpp [LoopFlatten] Use SCEV and Loop APIs to identify increment and trip count 2021-07-27 08:42:59 +01:00
LoopFuse.cpp [ADT] Remove StatisticBase and make NoopStatistic empty 2021-04-26 16:47:32 -07:00
LoopIdiomRecognize.cpp [LoopIdiom] Don't transform loop into memmove when load from body has more than one use 2021-08-25 16:19:10 +02:00
LoopInstSimplify.cpp
LoopInterchange.cpp [LoopInterchange] Check lcssa phis in the inner latch in scenarios of multi-level nested loops 2021-07-16 11:59:20 -04:00
LoopLoadElimination.cpp [NFC] Inline variable to prevent unused variable warning 2021-07-13 09:57:59 -07:00
LoopPassManager.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
LoopPredication.cpp [BPI] Improve static heuristics for "cold" paths. 2020-12-23 22:47:36 +07:00
LoopRerollPass.cpp [LoopReroll] Add an extra defensive check to avoid SCEV assertion. 2021-07-13 12:17:09 -07:00
LoopRotation.cpp [LoopRotate] Don't split loop pass manager 2021-04-08 22:05:18 +02:00
LoopSimplifyCFG.cpp [DominatorTree] Add support for mixed pre/post CFG views. 2021-01-06 14:53:09 -08:00
LoopSink.cpp [llvm] Use set_is_subset (NFC) 2021-02-28 10:59:20 -08:00
LoopStrengthReduce.cpp [DebugInfo][LSR] Avoid crashes on large integer inputs 2021-08-05 10:38:19 +01:00
LoopUnrollAndJamPass.cpp LoopUnrollAndJamPass.cpp - remove unused <vector> include. NFCI. 2021-06-13 14:06:32 +01:00
LoopUnrollPass.cpp [LoopUnroll] Don't modify TripCount/TripMultiple in computeUnrollCount() (NFCI) 2021-06-21 21:34:17 +02:00
LoopUnswitch.cpp Add a subclass of IntrinsicInst for llvm.assume [nfc] 2021-04-06 11:16:22 -07:00
LoopVersioningLICM.cpp [SCEV] Use isa<> pattern for testing for CouldNotCompute [NFC] 2020-11-24 18:47:49 -08:00
LowerAtomic.cpp [NVPTX] Enable lowering of atomics on local memory 2021-04-26 20:12:12 -04:00
LowerConstantIntrinsics.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
LowerExpectIntrinsic.cpp [TargetTransformInfo] move branch probability query from TargetLoweringInfo 2021-03-22 15:55:34 -04:00
LowerGuardIntrinsic.cpp
LowerMatrixIntrinsics.cpp [Matrix] Fix shape for factored transpose 2021-07-27 11:36:13 -07:00
LowerWidenableCondition.cpp
MakeGuardsExplicit.cpp
MemCpyOptimizer.cpp [MemCpyOpt] Fix a variety of scalable-type crashes 2021-09-09 16:21:27 -07:00
MergedLoadStoreMotion.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
MergeICmps.cpp [MergeICmps] Collect block instructions once (NFC) 2021-07-26 18:07:20 +02:00
NaryReassociate.cpp [NARY] Don't optimize min/max if there are side uses (part2) 2021-04-30 19:02:02 +07:00
NewGVN.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
PartiallyInlineLibCalls.cpp [PartiallyInlineLibCalls] Disable sqrt expansion for strictfp. 2021-06-17 14:15:12 -07:00
PlaceSafepoints.cpp [Transforms] Use llvm::append_range (NFC) 2020-12-27 09:57:29 -08:00
Reassociate.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
Reg2Mem.cpp [Reg2Mem] add support for the new pass manager 2020-11-08 11:14:05 +00:00
RewriteStatepointsForGC.cpp [RS4GC] Use one DVCache for both inlineGetBaseAndOffset() and insertParsePoints() 2021-07-12 18:13:00 +07:00
Scalar.cpp Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
ScalarizeMaskedMemIntrin.cpp [ScalarizeMaskedMemIntrin][SelectionDAGBuilder] Use the element type to calculate alignment for gather/scatter when alignment operand is 0. 2021-07-01 19:08:47 -07:00
Scalarizer.cpp Update @llvm.powi to handle different int sizes for the exponent 2021-06-17 09:38:28 +02:00
SCCP.cpp [Local] Do not introduce a new llvm.trap before unreachable 2021-07-26 23:33:36 -05:00
SeparateConstOffsetFromGEP.cpp SeparateConstOffsetFromGEP::lowerToSingleIndexGEPs - don't use dyn_cast_or_null. NFCI. 2020-12-15 17:27:25 +00:00
SimpleLoopUnswitch.cpp Inform pass manager when child loops are deleted 2021-09-09 09:04:59 -07:00
SimplifyCFGPass.cpp [SimplifyCFG] Tail-merging all blocks with resume terminator 2021-06-24 21:25:06 +03:00
Sink.cpp [CSSPGO] Unblock optimizations with pseudo probe instrumentation part 2. 2021-04-26 16:52:33 -07:00
SpeculativeExecution.cpp [NewPM] Don't mark AA analyses as preserved 2021-05-18 13:49:03 -07:00
SROA.cpp [SROA] prevent crash on large memset length (PR50910) 2021-08-04 16:51:23 -07:00
StraightLineStrengthReduce.cpp [Transforms/Scalar] Use range-based for loops (NFC) 2021-02-04 21:18:05 -08:00
StructurizeCFG.cpp [Scalar] Use range-based for loops (NFC) 2021-02-25 19:54:38 -08:00
TailRecursionElimination.cpp [TRE] Reland: allow TRE for non-capturing calls. 2021-05-25 11:35:48 +03:00
WarnMissedTransforms.cpp [SVE] Add support for scalable vectors with vectorize.scalable.enable loop attribute 2020-12-02 13:23:43 +00:00