code: private List<PassFactory> getMainOptimizationLoop() {
      List<PassFactory> passes = new ArrayList<>();
      if (options.inlineGetters) {
        passes.add(inlineSimpleMethods);
      }
  
      passes.addAll(getCodeRemovingPasses());
  
      if (options.getInlineFunctionsLevel() != Reach.NONE) {
        passes.add(inlineFunctions);
      }
  
      if (options.shouldInlineProperties() && options.isTypecheckingEnabled()) {
        passes.add(inlineProperties);
      }
  
      if (options.removeUnusedVars || options.removeUnusedLocalVars) {
        if (options.deadAssignmentElimination) {
          passes.add(deadAssignmentsElimination);
  
          // The Polymer source is usually not included in the compilation, but it creates
          // getters/setters for many properties in compiled code. Dead property assignment
          // elimination is only safe when it knows about getters/setters. Therefore, we skip
          // it if the polymer pass is enabled.
          if (options.polymerVersion == null) {
            passes.add(deadPropertyAssignmentElimination);
          }
        }
      }
  
      if (options.optimizeCalls) {
        passes.add(optimizeCalls);
      }
  
      if (options.j2clPassMode.shouldAddJ2clPasses()) {
        passes.add(j2clConstantHoisterPass);
        passes.add(j2clClinitPass);
      }
  
      assertAllLoopablePasses(passes);
      return passes;
    }
docs: Creates the passes for the main optimization loop.