EVALUATION
6942326 changes exposed this problem.
Ideal nodes for String intrinsics have memory alias type TypeAryPtr::CHARS. But they are not memory nodes so their memory dependance is not optimizated, step_through_mergemem() is not called. As result these nodes may have false dependance on wole memory (bottom). In the bug case after loop unroll we have integer Store followed by StrIndexOf node referencing MergeMem node which represent bottom memory:
674 StoreI === 956 758 145 675 [[ 349 146 ]] @precise klass IndexOfTest: 0x0853ae08:Constant:exact+356 *, name=pass, idx=8; Memory: @precise klass IndexOfTest: 0x0853ae08:Constant:exact+356 *, name=pass, idx=8; !orig=146,[689] !jvms: IndexOfTest::main @ bci:69
349 MergeMem === _ 1 7 1 1 1 1 1 674 [[ 141 658 ]] { - - - - - N674:precise klass IndexOfTest: 0x0853ae08:Constant:exact+356 * } Memory: @BotPTR *+bot, idx=Bot; !orig=[87] !jvms: IndexOfTest::main @ bci:62
141 StrIndexOf === 956 349 131 109 139 111 [[ 146 655 ]] !orig=[106] !jvms: IndexOfTest::runTest @ bci:2 IndexOfTest::main @ bci:66
146 StoreI === 956 674 145 141 [[ 653 960 ]] @precise klass IndexOfTest: 0x0853ae08:Constant:exact+356 *, name=pass, idx=8; Memory: @precise klass IndexOfTest: 0x0853ae08:Constant:exact+356 *, name=pass, idx=8; !orig=[689] !jvms: IndexOfTest::main @ bci:69
Superword optimization assumes that only Load nodes could reference Store nodes in such situation and we have MergeMem node in the loop. This causes the assert.
|