RFR: 8255670: Improve C2's detection of modified nodes [v3]

Emanuel Peter epeter at openjdk.org
Wed Sep 21 07:19:52 UTC 2022


> Added `record_modified_node` to:
> 
> Node::clone
> Node::add_req
> Node::add_req_batch
> Node::ins_req
> Node::add_prec
> Node::rm_prec
> Node::set_prec
> 
> 
> Added `igvn->_worklist.push(node)` in various places that modified a `node` but did not add it to the igvn worklist.
> 
> 7 times I had to push `Root`, 5 of these it was because of the creation of a `HaltNode`, which means we have a `root->add_req(halt)`. 
> 
> In one case we have a MergeMemStream node, which gets two MergeMem nodes as input, and streams over them.
> Unfortunately, it modifies one of the two, which then can trigger our assertion code. I now push this node to the igvn worklist, but a better fix would be to make MergeMemStream leave the MergeMem nodes unmodified. I think that should be possible, filed an RFE [JDK-8293358](https://bugs.openjdk.org/browse/JDK-8293358)
> 
> Other small refactorings (review suggestions):
> - Refactored a few cases of `igvn.worklist.push` and `set_req` with `set_req_X`.
> - Removed unecessary `igvn.worklist.push` before `replace_input_of`.
> - Refactored some code with `delete_precedence_of`, `add_input_to` and `replace_input_of`.
> 
> FYI:
> What I am NOT doing here, and leave to a future RFE/independent change: investigate / implement these assertions for late/incremental inlining [JDK-8293362](https://bugs.openjdk.org/browse/JDK-8293362).
> 
> Ran larger regression tests, and 7-9h of fuzzing on 3 platforms.

Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:

  remove 2 newlines, trivial

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/9439/files
  - new: https://git.openjdk.org/jdk/pull/9439/files/84091bd8..e2ea0716

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9439&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9439&range=01-02

  Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/9439.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9439/head:pull/9439

PR: https://git.openjdk.org/jdk/pull/9439


More information about the hotspot-compiler-dev mailing list