File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,8 @@ class Projection {
255
255
unsigned getIndex () const {
256
256
return Value.getIndex ();
257
257
}
258
+
259
+ unsigned getHash () const { return (unsigned )Value.getStorage (); }
258
260
259
261
// / Determine if I is a value projection instruction whose corresponding
260
262
// / projection equals this projection.
@@ -689,7 +691,7 @@ static inline llvm::hash_code hash_value(const ProjectionPath &P) {
689
691
690
692
// / Returns the hashcode for the projection path.
691
693
static inline llvm::hash_code hash_value (const Projection &P) {
692
- return llvm::hash_combine (static_cast < unsigned >(P. getKind () ));
694
+ return llvm::hash_combine (P. getHash ( ));
693
695
}
694
696
695
697
class ProjectionTree ;
Original file line number Diff line number Diff line change @@ -915,7 +915,9 @@ bool SILPerformanceInliner::inlineCallsIntoFunction(SILFunction *Caller) {
915
915
return false ;
916
916
917
917
// Second step: do the actual inlining.
918
- for (auto AI : AppliesToInline) {
918
+ // We inline in reverse order, because for very large blocks with many applies
919
+ // to inline, splitting the block at every apply would be quadratic.
920
+ for (auto AI : llvm::reverse (AppliesToInline)) {
919
921
SILFunction *Callee = AI.getReferencedFunctionOrNull ();
920
922
assert (Callee && " apply_inst does not have a direct callee anymore" );
921
923
You can’t perform that action at this time.
0 commit comments