Issue Details (XML | Word | Printable)

Key: RVM-606
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: David Grove
Reporter: David Grove
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RVM

Problems with OSR guarded inlining of invokeinterface

Created: 30/Jul/08 07:33 AM   Updated: 08/Sep/08 10:32 AM
Component/s: Compiler: Optimizing
Affects Version/s: None
Fix Version/s: 3.0.1

Time Tracking:
Not Specified

File Attachments: 1. File SPECjbb2005.default.txt.bz2 (32 kB)

Issue Links:
Related
 


 Description  « Hide
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.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
David Grove added a comment - 30/Jul/08 07:35 AM
IR dump (it was truncated in the sanity report).

David Grove added a comment - 21/Aug/08 10:03 AM
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.



David Grove added a comment - 25/Aug/08 09:35 PM
It's likely that r14923 improved the quality of the inlining decisions being made....but we still should think about context-sensitive profiling.

David Grove added a comment - 27/Aug/08 07:44 AM
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


David Grove added a comment - 28/Aug/08 01:20 PM
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...


David Grove added a comment - 02/Sep/08 02:37 PM
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.

David Grove added a comment - 03/Sep/08 09:07 AM
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


David Grove added a comment - 05/Sep/08 03:17 PM

David Grove added a comment - 06/Sep/08 07:53 PM

David Grove added a comment - 06/Sep/08 07:58 PM
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.


David Grove added a comment - 08/Sep/08 10:32 AM
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.