llvm-project/llvm/lib/Transforms/Utils
Zequan Wu cb22ab7403 Add nomerge function attribute to supress tail merge optimization in simplifyCFG
We want to add a way to avoid merging identical calls so as to keep the
separate debug-information for those calls. There is also an asan
usecase where having this attribute would be beneficial to avoid
alternative work-arounds.

Here is the link to the feature request:
https://bugs.llvm.org/show_bug.cgi?id=42783.

`nomerge` is different from `noline`. `noinline` prevents function from
inlining at callsites, but `nomerge` prevents multiple identical calls
from being merged into one.

This patch adds `nomerge` to disable the optimization in IR level. A
followup patch will be needed to let backend understands `nomerge` and
avoid tail merge at backend.

Reviewed By: asbirlea, rnk

Differential Revision: https://reviews.llvm.org/D78659
2020-05-12 16:49:20 -07:00
..
AMDGPUEmitPrintf.cpp Fix unused variable warning. NFCI. 2020-01-16 13:02:40 +00:00
ASanStackFrameLayout.cpp
AddDiscriminators.cpp [NFC] Fix trivial typos in comments 2020-01-06 10:50:26 +00:00
AssumeBundleBuilder.cpp [AssumeBundles] fix crashes 2020-05-11 11:52:21 +02:00
BasicBlockUtils.cpp Introduce fix-irreducible pass 2020-04-15 15:05:51 +05:30
BreakCriticalEdges.cpp SplitIndirectBrCriticalEdges: Fix Branch Probability update 2020-05-07 15:31:44 +07:00
BuildLibCalls.cpp Introduce support for lib function aligned_alloc in TLI / memory builtins 2020-03-29 23:36:24 +05:30
BypassSlowDivision.cpp
CMakeLists.txt New pass to make internal linkage symbol names unique. 2020-04-20 15:05:22 -07:00
CallGraphUpdater.cpp [CallGraphUpdater] Removed references to calles when deleting function 2020-05-04 18:59:47 -07:00
CallPromotionUtils.cpp [ICP] Handling must tail calls in indirect call promotion 2020-05-03 10:42:22 -07:00
CanonicalizeAliases.cpp
CloneFunction.cpp [CallSite removal][CloneFunction] Use CallSite instead of CallBase. NFC 2020-04-15 15:38:02 -07:00
CloneModule.cpp
CodeExtractor.cpp Add nomerge function attribute to supress tail merge optimization in simplifyCFG 2020-05-12 16:49:20 -07:00
CodeMoverUtils.cpp Fix MSVC lamdba default capture mode warning. NFCI. 2020-01-29 15:47:04 +00:00
CtorUtils.cpp
Debugify.cpp [Debugify] Do not require named metadata to be present when stripping 2020-04-22 17:03:39 -07:00
DemoteRegToStack.cpp
EntryExitInstrumenter.cpp
EscapeEnumerator.cpp [CallSite removal] Remove unneeded includes of CallSite.h. NFC 2020-04-22 00:07:13 -07:00
Evaluator.cpp [IR] Replace all uses of CallBase::getCalledValue() with getCalledOperand(). 2020-04-27 22:17:03 -07:00
FixIrreducible.cpp Give helpers internal linkage. NFC. 2020-04-25 11:50:52 +02:00
FlattenCFG.cpp
FunctionComparator.cpp [MergeFuncs] Don't merge shufflevectors with different masks 2020-05-02 10:21:14 +02:00
FunctionImportUtils.cpp [ThinLTO] Drop dso_local if a GlobalVariable satisfies isDeclarationForLinker() 2020-04-07 15:46:01 -07:00
GlobalStatus.cpp [CallSite removal][Transform] Replace CallSite with CallBase in Utils. NFC 2020-04-23 20:49:33 -07:00
GuardUtils.cpp Further cleanup manipulation of widenable branches [NFC] 2019-11-21 15:07:30 -08:00
ImportedFunctionsInliningStatistics.cpp
InjectTLIMappings.cpp [VectorUtils] Move ToVectorTy to VectorUtils.h (NFC). 2020-02-21 17:31:24 +00:00
InlineFunction.cpp [InlineFunction] Disable emission of alignment assumptions by default 2020-04-30 23:12:54 +02:00
InstructionNamer.cpp
IntegerDivision.cpp
LCSSA.cpp [NFC] Add missing 'const' notion to LCSSA-related functions 2020-04-17 17:49:34 +07:00
LLVMBuild.txt
LibCallsShrinkWrap.cpp
Local.cpp Re-commit: Mark values as trivially dead when their only use is a start or end lifetime intrinsic. 2020-05-08 12:24:10 -07:00
LoopRotationUtils.cpp [NFC] LoopRotate: do issue debug message when not rotating due to instr count 2020-03-17 09:26:09 +03:00
LoopSimplify.cpp
LoopUnroll.cpp [CallSite removal][Transform] Replace CallSite with CallBase in Utils. NFC 2020-04-23 20:49:33 -07:00
LoopUnrollAndJam.cpp [LoopUnrollAndJam] Changed safety checks to consider more than 2-levels 2020-05-06 21:47:44 +00:00
LoopUnrollPeel.cpp [LoopPeel] Turn incorrect assert into a check 2020-03-12 17:23:07 +07:00
LoopUnrollRuntime.cpp [NFC][SCEV] Piping to pass new SCEVCheapExpansionBudget option into SCEVExpander::isHighCostExpansionHelper() 2020-02-25 23:05:57 +03:00
LoopUtils.cpp [LAA] Move runtime-check generation to Transforms/Utils/loopUtils (NFC) 2020-05-10 17:39:26 +01:00
LoopVersioning.cpp [LAA] Move runtime-check generation to Transforms/Utils/loopUtils (NFC) 2020-05-10 17:39:26 +01:00
LowerInvoke.cpp [IR] Replace all uses of CallBase::getCalledValue() with getCalledOperand(). 2020-04-27 22:17:03 -07:00
LowerMemIntrinsics.cpp Utils: Mostly convert memcpy expansion to use Align 2020-03-22 11:21:44 -04:00
LowerSwitch.cpp
Mem2Reg.cpp
MetaRenamer.cpp
MisExpect.cpp
ModuleUtils.cpp [llvm][VectorUtils] Tweak VFShape for scalable vector functions. 2020-01-30 05:53:56 +00:00
NameAnonGlobals.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
PredicateInfo.cpp [PredicateInfo] Use new Instruction::comesBefore instead of OI (NFC). 2020-04-20 09:22:21 +01:00
PromoteMemoryToRegister.cpp
SSAUpdater.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
SSAUpdaterBulk.cpp
SanitizerStats.cpp
SimplifyCFG.cpp Add nomerge function attribute to supress tail merge optimization in simplifyCFG 2020-05-12 16:49:20 -07:00
SimplifyIndVar.cpp [NFC][SCEV] Piping to pass new SCEVCheapExpansionBudget option into SCEVExpander::isHighCostExpansionHelper() 2020-02-25 23:05:57 +03:00
SimplifyLibCalls.cpp [InstCombine] Allow denormal C in pow(C,y) -> exp2(log2(C)*y) 2020-05-05 16:25:48 +01:00
SizeOpts.cpp [PGO][PGSO] Prep for enabling non-cold code size opts under non-partial-profile sample PGO. 2020-04-29 08:57:47 -07:00
SplitModule.cpp
StripGCRelocates.cpp
StripNonLineTableDebugInfo.cpp
SymbolRewriter.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
UnifyFunctionExitNodes.cpp
UnifyLoopExits.cpp [NFC] UnifyLoopExits: correctly skip expensive checks 2020-04-27 15:10:35 +05:30
UniqueInternalLinkageNames.cpp New pass to make internal linkage symbol names unique. 2020-04-20 15:05:22 -07:00
Utils.cpp [NFC][DwarfDebug] Add test for variables with a single location which 2020-05-11 11:49:11 +02:00
VNCoercion.cpp [SVE] Remove calls to isScalable from Transforms 2020-04-23 13:50:07 -07:00
ValueMapper.cpp [llvm][NFC][CallSite] Removed CallSite from some implementation details. 2020-04-15 22:27:05 -07:00