RVM

Problems with OSR guarded inlining of invokeinterface

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.0.1
  • Component/s: Compiler: Optimizing
  • Labels:
    None
  • Number of attachments :
    1

Description

Failure occured on ppc64-linux SPECjbb2005 (http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc64/4574/prototype-opt/default/SPECjbb2005/SPECjbb2005/default/Output.txt).

There are a couple interesting things happening in this IR dump:
(1) OSR yieldpoint insertion for invokeinterface seems to be slightly broken. It's injecting a use with no def.
(2) The inlining decisions in and around this point seem a little suspect. We've decided to inline a piece of the LinearScan register allocator into SPECjbb2005 due to context-insensitive profile information about Comparable.compareTo.

We should: (a) fix the direct cause of this bug and (b) consider re-implementing the context-sensitive dynamic callgraph from Hazelwood & Grove CGO'03. With the improved inliner we added in 2005, it seems likely that the benefits are going to be higher than Kim and I found with the old inliner in our 2003 paper.

Issue Links

Activity

Hide
David Grove added a comment -

IR dump (it was truncated in the sanity report).

Show
David Grove added a comment - IR dump (it was truncated in the sanity report).
Hide
David Grove added a comment -

r14913 cleaned up the CFG construction in Inliner when the failedblock contains an OSR_YIELDPOINT. If my theory that the bad move instruction was introduced by BC2IR rectifying it's state at the downstream merge from the OSR_YIELDPOINT, then this should fix the bad IR. It also had the side benefit of speeding up antlr and bloat by 5%

Leaving open to monitor for a week to see if jbb2005 failure recurs after the fix.

Will open a new feature for the longer term item of re-implementing context-sensitive call graph profiling.

Show
David Grove added a comment - r14913 cleaned up the CFG construction in Inliner when the failedblock contains an OSR_YIELDPOINT. If my theory that the bad move instruction was introduced by BC2IR rectifying it's state at the downstream merge from the OSR_YIELDPOINT, then this should fix the bad IR. It also had the side benefit of speeding up antlr and bloat by 5% Leaving open to monitor for a week to see if jbb2005 failure recurs after the fix. Will open a new feature for the longer term item of re-implementing context-sensitive call graph profiling.
Hide
David Grove added a comment -

It's likely that r14923 improved the quality of the inlining decisions being made....but we still should think about context-sensitive profiling.

Show
David Grove added a comment - It's likely that r14923 improved the quality of the inlining decisions being made....but we still should think about context-sensitive profiling.
Hide
David Grove added a comment -

r14923 made the IR significantly simpler by avoiding bogus inlining, but we're still getting the bad IR failure. For example, see:

http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc32/5005/prototype-opt/default/SPECjbb2005/SPECjbb2005/default/Output.txt

Show
David Grove added a comment - r14923 made the IR significantly simpler by avoiding bogus inlining, but we're still getting the bad IR failure. For example, see: http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc32/5005/prototype-opt/default/SPECjbb2005/SPECjbb2005/default/Output.txt
Hide
David Grove added a comment -

The thing that seems to be triggering the bug is that we do a guarded inline where the method body ends in an unconditional NPE because it is downstream of a statically failed checkcast. We're supposed to detect this and not link the (unreachable) epilogue block of the inlined method into the CFG, but that doesn't seem to be quite working.

Continuing to investigate...

Show
David Grove added a comment - The thing that seems to be triggering the bug is that we do a guarded inline where the method body ends in an unconditional NPE because it is downstream of a statically failed checkcast. We're supposed to detect this and not link the (unreachable) epilogue block of the inlined method into the CFG, but that doesn't seem to be quite working. Continuing to investigate...
Hide
David Grove added a comment -

r14946 fixed a problem in how we were meeting together the results of multiple inlined targets. It's possible that this bug was then causing BC2IR to inject the unreachable block to rectify it's state downstream of the inlined code. Will monitor to see if failure continues to happen.

Show
David Grove added a comment - r14946 fixed a problem in how we were meeting together the results of multiple inlined targets. It's possible that this bug was then causing BC2IR to inject the unreachable block to rectify it's state downstream of the inlined code. Will monitor to see if failure continues to happen.
Hide
David Grove added a comment -

r14946 appeared to have changed this into a slightly different assertion failure in bc2ir.

See: http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc64/5102/prototype-opt/default/SPECjbb2005/SPECjbb2005

vm internal error at:

– Stack –
at Lorg/jikesrvm/VM; sysFail(Ljava/lang/String;)V at line 2125
at Lorg/jikesrvm/VM; _assertionFailure(Ljava/lang/String;Ljava/lang/String;)V at line 629
at Lorg/jikesrvm/VM; _assert(ZLjava/lang/String;Ljava/lang/String;)V at line 612
at Lorg/jikesrvm/VM; _assert(Z)V at line 590
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; push(Lorg/jikesrvm/compilers/opt/ir/operand/Operand;Lorg/jikesrvm/classloader/TypeReference;)V at line 3246
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4707
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 2110
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 379
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177
at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 451
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 1881
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 379
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177
at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 451
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 1881
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 364
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177
at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 167
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 2110
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 364
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177
at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 167
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 2110
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 379
at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177
at Lorg/jikesrvm/compilers/opt/bc2ir/ConvertBCtoHIR; perform(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 36
at Lorg/jikesrvm/compilers/opt/driver/CompilerPhase; performPhase(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 205
at Lorg/jikesrvm/compilers/opt/driver/OptimizationPlanAtomicElement; perform(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 89
at Lorg/jikesrvm/compilers/opt/driver/OptimizationPlanCompositeElement; perform(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 143
at Lorg/jikesrvm/compilers/opt/driver/CompilationPlan; execute()Lorg/jikesrvm/compilers/opt/ir/IR; at line 131
at Lorg/jikesrvm/compilers/opt/driver/OptimizingCompiler; compile(Lorg/jikesrvm/compilers/opt/driver/CompilationPlan;)Lorg/jikesrvm/compilers/common/CompiledMethod; at line 224
at Lorg/jikesrvm/compilers/common/RuntimeCompiler; optCompile(Lorg/jikesrvm/classloader/NormalMethod;Lorg/jikesrvm/compilers/opt/driver/CompilationPlan;)Lorg/jikesrvm/compilers/common/CompiledMethod; at line 358
at Lorg/jikesrvm/compilers/common/RuntimeCompiler; recompileWithOpt(Lorg/jikesrvm/compilers/opt/driver/CompilationPlan;)I at line 537
at Lorg/jikesrvm/adaptive/controller/ControllerPlan; doRecompile()Lorg/jikesrvm/compilers/common/CompiledMethod; at line 179
at Lorg/jikesrvm/adaptive/recompilation/CompilationThread; run()V at line 55
at Lorg/jikesrvm/scheduler/RVMThread; startoff()V at line 627

Show
David Grove added a comment - r14946 appeared to have changed this into a slightly different assertion failure in bc2ir. See: http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc64/5102/prototype-opt/default/SPECjbb2005/SPECjbb2005 vm internal error at: – Stack – at Lorg/jikesrvm/VM; sysFail(Ljava/lang/String;)V at line 2125 at Lorg/jikesrvm/VM; _assertionFailure(Ljava/lang/String;Ljava/lang/String;)V at line 629 at Lorg/jikesrvm/VM; _assert(ZLjava/lang/String;Ljava/lang/String;)V at line 612 at Lorg/jikesrvm/VM; _assert(Z)V at line 590 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; push(Lorg/jikesrvm/compilers/opt/ir/operand/Operand;Lorg/jikesrvm/classloader/TypeReference;)V at line 3246 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4707 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 2110 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 379 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177 at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 451 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 1881 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 379 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177 at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 451 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 1881 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 364 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177 at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 167 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 2110 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 364 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177 at Lorg/jikesrvm/compilers/opt/inlining/Inliner; execute(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;Lorg/jikesrvm/compilers/opt/ir/ExceptionHandlerBasicBlockBag;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext; at line 167 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; maybeInlineMethod(Lorg/jikesrvm/compilers/opt/inlining/InlineDecision;Lorg/jikesrvm/compilers/opt/ir/Instruction;)Z at line 4655 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateFrom(I)V at line 2110 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR()V at line 379 at Lorg/jikesrvm/compilers/opt/bc2ir/BC2IR; generateHIR(Lorg/jikesrvm/compilers/opt/bc2ir/GenerationContext;)V at line 177 at Lorg/jikesrvm/compilers/opt/bc2ir/ConvertBCtoHIR; perform(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 36 at Lorg/jikesrvm/compilers/opt/driver/CompilerPhase; performPhase(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 205 at Lorg/jikesrvm/compilers/opt/driver/OptimizationPlanAtomicElement; perform(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 89 at Lorg/jikesrvm/compilers/opt/driver/OptimizationPlanCompositeElement; perform(Lorg/jikesrvm/compilers/opt/ir/IR;)V at line 143 at Lorg/jikesrvm/compilers/opt/driver/CompilationPlan; execute()Lorg/jikesrvm/compilers/opt/ir/IR; at line 131 at Lorg/jikesrvm/compilers/opt/driver/OptimizingCompiler; compile(Lorg/jikesrvm/compilers/opt/driver/CompilationPlan;)Lorg/jikesrvm/compilers/common/CompiledMethod; at line 224 at Lorg/jikesrvm/compilers/common/RuntimeCompiler; optCompile(Lorg/jikesrvm/classloader/NormalMethod;Lorg/jikesrvm/compilers/opt/driver/CompilationPlan;)Lorg/jikesrvm/compilers/common/CompiledMethod; at line 358 at Lorg/jikesrvm/compilers/common/RuntimeCompiler; recompileWithOpt(Lorg/jikesrvm/compilers/opt/driver/CompilationPlan;)I at line 537 at Lorg/jikesrvm/adaptive/controller/ControllerPlan; doRecompile()Lorg/jikesrvm/compilers/common/CompiledMethod; at line 179 at Lorg/jikesrvm/adaptive/recompilation/CompilationThread; run()V at line 55 at Lorg/jikesrvm/scheduler/RVMThread; startoff()V at line 627
Hide
David Grove added a comment -
Show
David Grove added a comment - not fixed by 14946/948. for example see: http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc64/5118/regression_report
Hide
David Grove added a comment -
Show
David Grove added a comment - See: http://jikesrvm.anu.edu.au/cattrack/results/piano.watson.ibm.com/core-ppc64/5150/prototype-opt/default/SPECjbb2005/SPECjbb2005 for the most recent failure the includes the full IR dump.
Hide
David Grove added a comment -

The code that is raising the IR verification error is actually dead. (blocks containing the bad definition are not linked in the CFG).

I'm going to look a little more to see if I can figure out why they are even being generated in the first place, but I think there's an easy workaround which is to force the running of a
branch optimization/unreachable code removal pass before we attempt to initially verify the HIR.

Show
David Grove added a comment - The code that is raising the IR verification error is actually dead. (blocks containing the bad definition are not linked in the CFG). I'm going to look a little more to see if I can figure out why they are even being generated in the first place, but I think there's an easy workaround which is to force the running of a branch optimization/unreachable code removal pass before we attempt to initially verify the HIR.
Hide
David Grove added a comment -

r14957 pushed the initial HIR verification pass slightly later in the "Convert Bytecodes to HIR" block of phases. I believe this will result in the unreachable code being removed before we attempt to verify it.

Show
David Grove added a comment - r14957 pushed the initial HIR verification pass slightly later in the "Convert Bytecodes to HIR" block of phases. I believe this will result in the unreachable code being removed before we attempt to verify it.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: