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

IR framework fails to detect allocation

    XMLWordPrintable

Details

    Description

      Attach TestAllocations.java fails with:

      Failed IR Rules (1) of Methods (1)
      ----------------------------------
      1) Method "static java.lang.Object compiler.c2.irTests.TestAllocation.test1(java.lang.Object)" - [Failed IR rules: 1]:
         * @IR rule 1: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeatureOr={}, applyIfCPUFeature={}, counts={"_#ALLOC#_", "4"}, failOn={}, applyIfAnd={}, applyIfOr={}, applyIfNot={})"
           > Phase "PrintOptoAssembly":
             - counts: Graph contains wrong number of nodes:
               * Constraint 1: "(.*precise .*\R((.*(?i:mov|mv|xorl|nop|spill).*|\s*)\R)*.*(?i:call,static).*wrapper for: _new_instance_Java)"
                 - Failed comparison: [found] 3 = 4 [given]
                   - Matched nodes (3):
                     * 449 movq RSI, precise compiler/c2/irTests/TestAllocation$MyClass: 0x00007f400c13c9d0:Constant:exact * # ptr
                       453 xorl RDX, RDX # int
                       455 movq RBP, [rsp + #0] # spill
                               nop # 2 bytes pad for loops and calls
                       45b call,static wrapper for: _new_instance_Java
                     * 470 movq RSI, precise java/lang/Object: 0x00007f40080039c8:Constant:exact * # ptr
                       47a xorl RDX, RDX # int
                       47c movq RBP, [rsp + #0] # spill
                               nop # 3 bytes pad for loops and calls
                       483 call,static wrapper for: _new_instance_Java
                     * 4c5 movq RSI, precise java/util/HashMap: 0x00007f400c13f208 (java/lang/Cloneable,java/io/Serializable,java/util/Map):Constant:exact * # ptr
                       4cf xorl RDX, RDX # int
                               nop # 2 bytes pad for loops and calls
                       4d3 call,static wrapper for: _new_instance_Java

      The problem is that the following allocation is not detected by IRNode.ALLOC due to the pushq/popq spills:

      495 B36: # out( B42 B37 ) <- in( B7 ) Freq: 0.000100017
      495 movq RSI, precise java/util/HashSet: 0x00007f400c13d928 (java/lang/Cloneable,java/io/Serializable,java/lang/Iterable,java/util/Collection,java/util/Set):Constant:exact * # ptr
      49f xorl RDX, RDX # int
      4a1 movq RBP, [rsp + #0] # spill
      4a5 pushq [rsp + #16] # 64-bit mem-mem spill
      popq [rsp + #8]
      4af call,static wrapper for: _new_instance_Java

      Attachments

        Issue Links

          Activity

            People

              tholenstein Tobias Holenstein
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: