code: private static CompilerPass createPeepholeOptimizationsPass(
        AbstractCompiler compiler, String passName) {
      final boolean late = false;
      final boolean useTypesForOptimization = compiler.getOptions().useTypesForLocalOptimization;
      List<AbstractPeepholeOptimization> optimizations = new ArrayList<>();
      optimizations.add(new MinimizeExitPoints());
      optimizations.add(new PeepholeMinimizeConditions(late));
      optimizations.add(new PeepholeSubstituteAlternateSyntax(late));
      optimizations.add(new PeepholeReplaceKnownMethods(late, useTypesForOptimization));
      optimizations.add(new PeepholeRemoveDeadCode());
      if (compiler.getOptions().j2clPassMode.shouldAddJ2clPasses()) {
        optimizations.add(new J2clEqualitySameRewriterPass(useTypesForOptimization));
        optimizations.add(new J2clStringValueOfRewriterPass());
      }
      optimizations.add(new PeepholeFoldConstants(late, useTypesForOptimization));
      optimizations.add(new PeepholeCollectPropertyAssignments());
      return new PeepholeOptimizationsPass(compiler, passName, optimizations);
    }
docs: Various peephole optimizations.