1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
llvm-mirror/test/Transforms
Jeroen Dobbelaere 13605b24cd Support intrinsic overloading on unnamed types
This patch adds support for intrinsic overloading on unnamed types.

This fixes PR38117 and PR48340 and will also be needed for the Full Restrict Patches (D68484).

The main problem is that the intrinsic overloading name mangling is using 's_s' for unnamed types.
This can result in identical intrinsic mangled names for different function prototypes.

This patch changes this by adding a '.XXXXX' to the intrinsic mangled name when at least one of the types is based on an unnamed type, ensuring that we get a unique name.

Implementation details:
- The mapping is created on demand and kept in Module.
- It also checks for existing clashes and recycles potentially existing prototypes and declarations.
- Because of extra data in Module, Intrinsic::getName needs an extra Module* argument and, for speed, an optional FunctionType* argument.
- I still kept the original two-argument 'Intrinsic::getName' around which keeps the original behavior (providing the base name).
-- Main reason is that I did not want to change the LLVMIntrinsicGetName version, as I don't know how acceptable such a change is
-- The current situation already has a limitation. So that should not get worse with this patch.
- Intrinsic::getDeclaration and the verifier are now using the new version.

Other notes:
- As far as I see, this should not suffer from stability issues. The count is only added for prototypes depending on at least one anonymous struct
- The initial count starts from 0 for each intrinsic mangled name.
- In case of name clashes, existing prototypes are remembered and reused when that makes sense.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D91250
2021-03-19 14:34:25 +01:00
..
ADCE [DCE] Don't remove non-willreturn calls 2021-02-19 12:35:40 +01:00
AddDiscriminators
AggressiveInstCombine [AggressiveInstCombine] Generalize foldGuardedRotateToFunnelShift to generic funnel shifts (REAPPLIED) 2020-12-21 15:22:27 +00:00
AlignmentFromAssumptions
ArgumentPromotion [ArgPromotion] Copy additional metadata for loads. 2021-03-14 21:28:14 +00:00
AtomicExpand AMDGPU: Add support for amdgpu-unsafe-fp-atomics attribute 2021-02-04 08:09:34 -05:00
Attributor [Attributor] Derive willreturn based on mustprogress 2021-03-11 23:31:44 -06:00
BDCE [DCE] Don't remove non-willreturn calls 2021-02-19 12:35:40 +01:00
BlockExtractor
BranchFolding
CalledValuePropagation
CallSiteSplitting [SimplifyCFG] Teach simplifyUnreachable() to preserve DomTree 2020-12-18 00:37:22 +03:00
CanonicalizeAliases
CanonicalizeFreezeInLoops
CodeExtractor [HotColdSplit] Reflect full cost of parameters in split penalty 2020-12-18 17:06:17 -08:00
CodeGenPrepare [test] Fix new CodeGenPrepare test for non-X86 systems 2021-03-05 11:48:38 +01:00
ConstantHoisting [ConstantHoisting] Fix bug where constant materialization could insert into EH pad 2021-02-01 11:23:56 -08:00
ConstantMerge
ConstraintElimination [ConstraintElimination] Use unsigned > 0 instead of != 0. 2021-02-22 17:54:36 +00:00
Coroutines [coro async] Transfer the original function's attributes to the clone 2021-03-09 17:01:41 -08:00
CorrelatedValuePropagation [CVP] Remove -cvp-dont-add-nowrap-flags option 2021-03-07 18:19:31 +01:00
CrossDSOCFI
DCE [Tests] Add willreturn to libcalls in some tests 2021-01-22 21:47:35 +01:00
DeadArgElim [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
DeadStoreElimination [DSE] Extending isOverwrite to support offsetted fully overlapping stores 2021-03-10 21:09:33 +01:00
DivRemPairs
EarlyCSE [gvn] CSE gc.relocates based on meaning, not spelling (try 2) 2021-03-16 10:59:31 -07:00
EliminateAvailableExternally
EntryExitInstrumenter
ExpandMemCmp
FixIrreducible
Float2Int
ForcedFunctionAttrs
FunctionAttrs [FuncAttrs] Add tests for willreturn callsite inference. 2021-02-18 11:41:42 +00:00
FunctionImport
GCOVProfiling Encode alignment attribute for atomicrmw 2021-02-11 15:17:37 -05:00
GlobalDCE [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
GlobalMerge
GlobalOpt Fix for Bug 48055. 2020-12-04 11:05:01 -08:00
GlobalSplit
GuardWidening
GVN Revert "[ConstantFold] Handle vectors in ConstantFoldLoadThroughBitcast()" 2021-03-16 14:36:21 -07:00
GVNHoist [ValueTracking] Don't assume readonly function will return 2021-01-24 10:40:21 +01:00
GVNSink [AssumptionCache] Do not track llvm.assume calls (PR49043) 2021-02-06 12:18:30 -06:00
HardwareLoops [ARM] Improve WLS lowering 2021-03-11 17:56:19 +00:00
HelloNew
HotColdSplit [HotColdSplit] Reflect full cost of parameters in split penalty 2020-12-18 17:06:17 -08:00
IndirectBrExpand
IndVarSimplify [Test] Precommit one more test 2021-03-19 14:26:03 +07:00
InferAddressSpaces [NewPM] Port infer-address-spaces 2020-12-28 19:58:12 -08:00
InferFunctionAttrs [BuildLibCalls] Add noundef to allocator fns' size 2021-02-23 13:58:03 +09:00
Inline [AMDGPU] Fix -amdgpu-inline-arg-alloca-cost 2021-03-12 10:19:50 -08:00
InstCombine [InstCombine] Add unit test with @llvm.annotation. 2021-03-19 08:49:40 +01:00
InstMerge
InstNamer
InstSimplify [InstSimplify] Restrict a GEP transform to avoid provenance changes 2021-03-16 18:53:05 +02:00
InterleavedAccess [CodeGen] Update transformations to use poison for shufflevector/insertelem's initial vector elem 2021-01-10 18:03:51 +09:00
Internalize
IRCE [NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions 2021-03-06 21:52:46 +03:00
IROutliner [IROutliner] Adapting to hoisted bitcasts in CodeExtractor 2021-01-13 11:10:37 -06:00
JumpThreading [BasicAA] Drop dependency on Loop Info. PR43276 2021-03-17 11:43:44 +07:00
LCSSA [DebugInfo] Avoid re-ordering assignments in LCSSA 2020-12-17 16:17:32 +00:00
LICM [LICM] Fix a crash when sinking instructions w/token operands 2021-03-17 11:18:46 -07:00
LoadStoreVectorizer Precommit transform tests that have poison as insertelement's placeholder 2020-12-24 11:46:17 +09:00
LoopDataPrefetch
LoopDeletion [LoopDeletion] Handle inner loops w/untaken backedges 2021-01-22 16:31:29 -08:00
LoopDistribute [LoopDistribute] Add tests with uncomputable BTCs. 2021-01-01 13:57:03 +00:00
LoopFlatten [test] Fix widen-iv.ll under NPM 2020-12-07 19:34:31 -08:00
LoopFusion [test] Fix LoopFusion tests under NewPM 2020-12-07 17:37:42 -08:00
LoopIdiom [Tests] Added test for memcpy loop idiom recognization 2021-01-13 14:55:46 +01:00
LoopInstSimplify
LoopInterchange Revert "[LoopInterchange] Replace tightly-nesting-ness check with the one from LoopNest" 2021-03-11 01:24:43 +08:00
LoopLoadElim [IndVars] Provide eliminateIVComparison with context 2021-03-19 12:28:22 +07:00
LoopPredication [NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions 2021-03-06 21:52:46 +03:00
LoopReroll
LoopRotate [LoopRotate] Use llvm.experimental.noalias.scope.decl for duplicating noalias metadata as needed 2021-01-24 13:53:13 +01:00
LoopSimplify Precommit tests that have poison as shufflevector's placeholder 2020-12-29 17:09:31 +09:00
LoopSimplifyCFG
LoopStrengthReduce Reland [SCEV] Improve modelling for (null) pointer constants 2021-03-13 16:05:34 +03:00
LoopTransformWarning
LoopUnroll [NFC][LoopUnroll] Add -unroll-runtime-other-exit-predictable=false in 2021-03-07 23:51:09 +00:00
LoopUnrollAndJam LoopUnrollAndJam] Only allow loops with single exit(ing) blocks 2021-02-05 16:10:53 +00:00
LoopUnswitch [LoopUnswitch] Add shortcut if unswitched path is a no-op. 2021-02-01 09:03:30 +00:00
LoopVectorize Support intrinsic overloading on unnamed types 2021-03-19 14:34:25 +01:00
LoopVersioning Revert "[BasicAA] Handle two unknown sizes for GEPs" 2020-12-18 17:59:12 +00:00
LoopVersioningLICM [NewPM][opt] Run the "default" AA pipeline by default 2021-01-21 21:08:54 -08:00
LowerAtomic
LowerConstantIntrinsics
LowerExpectIntrinsic
LowerGuardIntrinsic
LowerInvoke
LowerMatrixIntrinsics Reland "[Libcalls, Attrs] Annotate libcalls with noundef" 2021-02-20 06:18:48 +01:00
LowerSwitch
LowerTypeTests [LTT] Don't attempt to lower type tests used only by assumes 2021-02-06 09:02:10 -08:00
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg
MemCpyOpt [MemCpyOpt] Handle read from lifetime.start with offset 2021-03-13 20:38:09 +01:00
MergeFunc
MergeICmps [MergeICmps] Fix missing split. 2020-12-01 16:50:55 +01:00
MetaRenamer
NameAnonGlobals
NaryReassociate Revert "[NARY-REASSOCIATE] Support reassociation of min/max" 2021-02-26 19:47:54 +07:00
NewGVN [Local] Treat calls that may not return as being alive. 2021-01-23 16:05:14 +00:00
ObjCARC [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
OpenMP [OpenMP] Restore backwards compatibility for libomptarget 2021-03-11 09:52:11 -05:00
PartialInlining
PartiallyInlineLibCalls
PGOProfile [IndirectCallPromotion] Recommit "Don't strip ".__uniq." suffix when it strips 2021-03-12 13:48:14 -08:00
PhaseOrdering Fix ppc build bot after 239a6181 2021-03-08 10:00:56 -08:00
PlaceSafepoints
PreISelIntrinsicLowering
PruneEH [FuncAttrs] Infer noreturn 2021-01-05 13:25:42 -08:00
Reassociate Revert "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands" 2021-03-11 14:48:01 +00:00
Reg2Mem
RewriteStatepointsForGC [rs4gc] don't force a conflict for a canonical broadcast 2021-03-16 12:59:06 -07:00
SafeStack
SampleProfile [SampleFDO] Don't mix up the existing indirect call value profile with the new 2021-03-18 09:54:34 -07:00
ScalarizeMaskedMemIntrin Expand masked mem intrinsics correctly wrt big-endian 2021-02-11 08:59:52 +00:00
Scalarizer [Scalarizer] Use poison as insertelement's placeholder 2021-01-04 00:35:28 +09:00
SCCP [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
SeparateConstOffsetFromGEP
SimpleLoopUnswitch [LoopUnswitch] unswitch if cond is in select form of and/or as well 2021-03-08 01:19:43 +09:00
SimplifyCFG [SimplifyCFG] add tests for branch cond merging with prof metadata; NFC 2021-03-18 15:39:50 -04:00
Sink
SLPVectorizer [SLP]Fix crash on extending scheduling region. 2021-03-18 06:11:08 -07:00
SpeculateAroundPHIs
SpeculativeExecution Precommit tests that have poison as shufflevector's placeholder 2020-12-29 17:09:31 +09:00
SROA [SROA] Regenerate test checks (NFC) 2021-03-13 22:00:00 +01:00
StraightLineStrengthReduce
StripDeadPrototypes
StripSymbols
StructurizeCFG [test] Pin backedge-id-bug-xfail.ll to legacy PM 2021-01-04 13:09:42 -08:00
SyntheticCountsPropagation
TailCallElim [ObjC][ARC] Use operand bundle 'clang.arc.attachedcall' instead of 2021-03-04 11:22:30 -08:00
ThinLTOBitcodeWriter Transforms: Clone distinct nodes in metadata mapper unless RF_ReuseAndMutateDistinctMDs 2021-02-24 12:57:52 -08:00
TypePromotion/ARM
UnifyFunctionExitNodes
UnifyLoopExits
Util Support !heapallocsite attachments in StripDebugInfo(). 2021-03-16 10:05:13 -07:00
VectorCombine Revert "[ConstantFold] Fold more operations to poison" 2021-02-04 00:24:02 +09:00
WholeProgramDevirt [ThinLTO] Add Visibility bits to GlobalValueSummary::GVFlags 2021-01-27 10:43:51 -08:00