File tree Expand file tree Collapse file tree 4 files changed +9
-20
lines changed Expand file tree Collapse file tree 4 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -539,13 +539,15 @@ static void printDifferentiableAttrArguments(
539
539
ArrayRef<Requirement> derivativeRequirements;
540
540
if (auto derivativeGenSig = attr->getDerivativeGenericSignature ())
541
541
derivativeRequirements = derivativeGenSig->getRequirements ();
542
- auto requirementsToPrint =
543
- makeFilterRange (derivativeRequirements, [&](Requirement req) {
544
- if (auto originalGenSig = original->getGenericSignature ())
545
- if (originalGenSig->isRequirementSatisfied (req))
546
- return false ;
547
- return true ;
548
- });
542
+ llvm::SmallVector<Requirement, 8 > requirementsToPrint;
543
+ std::copy_if (derivativeRequirements.begin (), derivativeRequirements.end (),
544
+ std::back_inserter (requirementsToPrint),
545
+ [&](Requirement req) {
546
+ if (auto originalGenSig = original->getGenericSignature ())
547
+ if (originalGenSig->isRequirementSatisfied (req))
548
+ return false ;
549
+ return true ;
550
+ });
549
551
if (!requirementsToPrint.empty ()) {
550
552
if (!isLeadingClause)
551
553
stream << ' ' ;
Original file line number Diff line number Diff line change 45
45
#include " swift/SILOptimizer/Analysis/LoopAnalysis.h"
46
46
#include " swift/SILOptimizer/PassManager/Passes.h"
47
47
#include " swift/SILOptimizer/PassManager/Transforms.h"
48
- #include " swift/SILOptimizer/Utils/Local.h"
49
48
#include " swift/SILOptimizer/Utils/LoopUtils.h"
50
49
#include " swift/SILOptimizer/Utils/SILOptFunctionBuilder.h"
51
50
#include " llvm/ADT/APSInt.h"
Original file line number Diff line number Diff line change 26
26
27
27
#include " swift/SIL/TypeSubstCloner.h"
28
28
#include " swift/SILOptimizer/Analysis/DominanceAnalysis.h"
29
- #include " swift/SILOptimizer/Utils/Local.h"
30
29
31
30
namespace swift {
32
31
Original file line number Diff line number Diff line change @@ -973,17 +973,6 @@ void MemoryToRegisters::promoteAllocs(ArrayRef<AllocStackInst*> allocs) {
973
973
}
974
974
}
975
975
976
- // / Attempt to promote the specified array of stack allocations to SSA
977
- // / registers. Promotion can fail if the allocation escapes.
978
- void swift::promoteAllocsToSSA (ArrayRef<AllocStackInst*> allocs,
979
- DominanceInfo *domInfo) {
980
- if (allocs.empty ()) return ;
981
-
982
- auto *fn = allocs.front ()->getFunction ();
983
- assert (fn && " Shouldn't have alloc stacks in global var initializers" );
984
- MemoryToRegisters (*fn, domInfo).promoteAllocs (allocs);
985
- }
986
-
987
976
988
977
namespace {
989
978
class SILMem2Reg : public SILFunctionTransform {
You can’t perform that action at this time.
0 commit comments