Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8325478

Restructure the macro expansion compiler phase to not include macro elimination

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 23
    • hotspot

      The expand_macro_nodes function [1] currently calls eliminate_macro_nodes [2] and also eliminates Opaque and LoopLimit nodes [3] before actually expanding macros. This is unintuitive and we should move the macro elimination code elsewhere.

      In combination with the above change, we should also create a separate compiler phase PHASE_AFTER_MACRO_ELIMINATION. There is already a phase PHASE_ITER_GVN_AFTER_ELIMINATION for running macro elimination in another context prior to macro expansion [4]. We should perhaps also remove this phase in favor of the new PHASE_AFTER_MACRO_ELIMINATION.

      Similarly to JDK-8317349, we could also add a StressMacroElimination option.

      [1] https://github.com/openjdk/jdk/blob/917838e0a564b1f2cbfb6cc214ccbfd1a237019f/src/hotspot/share/opto/macro.cpp#L2432-L2635
      [2] https://github.com/openjdk/jdk/blob/917838e0a564b1f2cbfb6cc214ccbfd1a237019f/src/hotspot/share/opto/macro.cpp#L2437
      [3] https://github.com/openjdk/jdk/blob/917838e0a564b1f2cbfb6cc214ccbfd1a237019f/src/hotspot/share/opto/macro.cpp#L2442-L2521
      [4] https://github.com/openjdk/jdk/blob/917838e0a564b1f2cbfb6cc214ccbfd1a237019f/src/hotspot/share/opto/compile.cpp#L2358

            snatarajan Saranya Natarajan
            dlunden Daniel Lunden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: