mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Add a new attribute, 'noduplicate'. If a function contains a noduplicate call, the call cannot be duplicated - Jump threading, loop unrolling, loop unswitching, and loop rotation are inhibited if they would duplicate the call.
Similarly inlining of the function is inhibited, if that would duplicate the call (in particular inlining is still allowed when there is only one callsite and the function has internal linkage). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170704 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -248,6 +248,13 @@ bool LUAnalysisCache::countLoop(const Loop* L) {
|
||||
Props.SizeEstimation = std::min(Metrics.NumInsts, Metrics.NumBlocks * 5);
|
||||
Props.CanBeUnswitchedCount = MaxSize / (Props.SizeEstimation);
|
||||
MaxSize -= Props.SizeEstimation * Props.CanBeUnswitchedCount;
|
||||
|
||||
if (Metrics.notDuplicatable) {
|
||||
DEBUG(dbgs() << "NOT unswitching loop %"
|
||||
<< L->getHeader()->getName() << ", contents cannot be "
|
||||
<< "duplicated!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Props.CanBeUnswitchedCount) {
|
||||
|
||||
Reference in New Issue
Block a user