llvm-project/llvm/lib/Transforms/IPO
Quentin Colombet 9766fed9c1 [DeadArgElim] Re-apply: Set unused arguments for internal functions
The re-apply includes fixes to clang tests that were missed in
the original commit.

Original message:
Prior to this patch we would only set to undef the unused arguments of the
external functions. The rationale was that unused arguments of internal
functions wouldn't need to be turned into undef arguments because they
should have been simply eliminated by the time we reach that code.

This is actually not true because there are plenty of cases where we can't
remove unused arguments. For instance, if the internal function is used in
an indirect call, it may not be possible to change the function signature.
Yet, for statically known call-sites we would still like to mark the unused
arguments as undef.

This patch enables the "set undef arguments" optimization on internal
functions when we encounter cases where internal functions cannot be
optimized. I.e., whenever an internal function is marked "live".

Differential Revision: https://reviews.llvm.org/D124699
2022-05-12 08:46:16 -07:00
..
AlwaysInliner.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
Annotation2Metadata.cpp
ArgumentPromotion.cpp [ArgPromotion] Make a non-byval promotion attempt first 2022-05-12 16:44:52 +02:00
Attributor.cpp [ArgPromotion][Attributor] Update min-legal-vector-width when do promotion 2022-05-02 14:13:05 +08:00
AttributorAttributes.cpp Silence a "not all control paths return a value" warning; NFC 2022-04-18 08:54:08 -04:00
BarrierNoopPass.cpp
BlockExtractor.cpp
CMakeLists.txt [llvm][Inline] Add a module level inliner 2021-11-09 11:03:29 +08:00
CalledValuePropagation.cpp [NFC] Remove unnecessary "#include"s from header files 2022-02-23 01:20:48 -08:00
ConstantMerge.cpp [IPO] Use make_early_inc_range (NFC) 2021-09-14 08:59:36 -07:00
CrossDSOCFI.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
DeadArgumentElimination.cpp [DeadArgElim] Re-apply: Set unused arguments for internal functions 2022-05-12 08:46:16 -07:00
ElimAvailExtern.cpp
ExtractGV.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
ForceFunctionAttrs.cpp Cleanup includes: final pass 2022-03-29 09:00:21 +02:00
FunctionAttrs.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
FunctionImport.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
FunctionSpecialization.cpp [FuncSpec][NFC] Cache code metrics for analyzed functions. 2022-04-01 10:58:26 +01:00
GlobalDCE.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
GlobalOpt.cpp [GlobalOpt] Iterate over replaced values deterministically to constprop 2022-05-02 09:43:20 -07:00
GlobalSplit.cpp [Transforms] Use make_early_inc_range (NFC) 2021-11-02 18:13:23 -07:00
HotColdSplitting.cpp Cleanup includes: final pass 2022-03-29 09:00:21 +02:00
IPO.cpp Function Specialization Pass 2021-06-11 09:11:29 +01:00
IROutliner.cpp [IROutliner] Accomodate blocks containing PHINodes with one entry outside the region and others inside the region. 2022-05-07 17:11:21 -05:00
InferFunctionAttrs.cpp Reapply "[BuildLibCalls] Introduce getOrInsertLibFunc() for use when building 2022-05-02 19:37:00 +02:00
InlineSimple.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
Inliner.cpp [llvm][Inline] Remove PriorityInlineOrder in SCC inliner 2022-04-26 20:20:10 +08:00
Internalize.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
LoopExtractor.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
LowerTypeTests.cpp Cleanup header dependencies in LLVMCore 2022-02-02 06:54:20 +01:00
MergeFunctions.cpp [llvm][IPO] Inclusive language: Rename mergefunc-sanity to mergefunc-verify and remove other instances of sanity in MergeFunctions.cpp 2022-04-18 11:50:08 -04:00
ModuleInliner.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
OpenMPOpt.cpp [OpenMPIRBuilder] Remove ContinuationBB argument from Body callback. 2022-04-26 16:35:01 -05:00
PartialInlining.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
PassManagerBuilder.cpp [iwyu] Handle regressions in libLLVM header include 2022-05-04 08:32:38 +02:00
PruneEH.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
SCCP.cpp Cleanup includes: Transform/Scalar 2022-03-03 07:56:34 +01:00
SampleContextTracker.cpp Cleanup includes: final pass 2022-03-29 09:00:21 +02:00
SampleProfile.cpp [iwyu] Handle regressions in libLLVM header include 2022-05-04 08:32:38 +02:00
SampleProfileProbe.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
StripDeadPrototypes.cpp [IPO] Use make_early_inc_range (NFC) 2021-09-14 08:59:36 -07:00
StripSymbols.cpp [Transforms] Use {DenseSet,SetVector,SmallPtrSet}::contains (NFC) 2021-10-31 07:57:32 -07:00
SyntheticCountsPropagation.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
ThinLTOBitcodeWriter.cpp Cleanup includes: Transforms/IPO 2022-03-22 10:06:28 +01:00
WholeProgramDevirt.cpp [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01:00