1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-21 18:22:53 +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
BDCE.cpp
CallSiteSplitting.cpp
CMakeLists.txt Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
ConstantHoisting.cpp
ConstraintElimination.cpp
CorrelatedValuePropagation.cpp
DCE.cpp
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
FlattenCFGPass.cpp
Float2Int.cpp
GuardWidening.cpp
GVN.cpp
GVNHoist.cpp
GVNSink.cpp
InductiveRangeCheckElimination.cpp
IndVarSimplify.cpp
InferAddressSpaces.cpp [infer-address-spaces] Handle complex non-pointer constexpr arguments. 2021-07-19 12:15:52 -07:00
InstSimplifyPass.cpp
IVUsersPrinter.cpp
JumpThreading.cpp
LICM.cpp Strip undef implying attributes when moving calls 2021-07-27 10:57:05 -04:00
LoopAccessAnalysisPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopBoundSplit.cpp
LoopDataPrefetch.cpp
LoopDeletion.cpp
LoopDistribute.cpp
LoopFlatten.cpp [LoopFlatten] Use SCEV and Loop APIs to identify increment and trip count 2021-07-27 08:42:59 +01:00
LoopFuse.cpp
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
LoopLoadElimination.cpp
LoopPassManager.cpp
LoopPredication.cpp
LoopRerollPass.cpp
LoopRotation.cpp
LoopSimplifyCFG.cpp
LoopSink.cpp
LoopStrengthReduce.cpp [DebugInfo][LSR] Avoid crashes on large integer inputs 2021-08-05 10:38:19 +01:00
LoopUnrollAndJamPass.cpp
LoopUnrollPass.cpp
LoopUnswitch.cpp
LoopVersioningLICM.cpp
LowerAtomic.cpp
LowerConstantIntrinsics.cpp
LowerExpectIntrinsic.cpp
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
MergeICmps.cpp [MergeICmps] Collect block instructions once (NFC) 2021-07-26 18:07:20 +02:00
NaryReassociate.cpp
NewGVN.cpp
PartiallyInlineLibCalls.cpp
PlaceSafepoints.cpp
Reassociate.cpp
Reg2Mem.cpp
RewriteStatepointsForGC.cpp
Scalar.cpp Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
ScalarizeMaskedMemIntrin.cpp
Scalarizer.cpp
SCCP.cpp [Local] Do not introduce a new llvm.trap before unreachable 2021-07-26 23:33:36 -05:00
SeparateConstOffsetFromGEP.cpp
SimpleLoopUnswitch.cpp Inform pass manager when child loops are deleted 2021-09-09 09:04:59 -07:00
SimplifyCFGPass.cpp
Sink.cpp
SpeculativeExecution.cpp
SROA.cpp [SROA] prevent crash on large memset length (PR50910) 2021-08-04 16:51:23 -07:00
StraightLineStrengthReduce.cpp
StructurizeCFG.cpp
TailRecursionElimination.cpp
WarnMissedTransforms.cpp