https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112021-10-26T04:13:35ZRuby Issue Tracking SystemRuby master - Bug #18269: trace_opt_not and trace_opt_regexpmatch2 insns are indistinguishablehttps://bugs.ruby-lang.org/issues/18269?journal_id=943182021-10-26T04:13:35Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/94318/diff?detail_id=61056">diff</a>)</li></ul> Ruby master - Bug #18269: trace_opt_not and trace_opt_regexpmatch2 insns are indistinguishablehttps://bugs.ruby-lang.org/issues/18269?journal_id=943302021-10-26T17:01:12Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul></ul><p>I guess one option would be to have each of the optimized trace instructions use code specific to each instruction, so that the compiler would never merge the instructions. <a class="user active user-mention" href="https://bugs.ruby-lang.org/users/10073">@k0kubun (Takashi Kokubun)</a>, do you think that would make sense? I'm not sure what code should be used in that case, though.</p> Ruby master - Bug #18269: trace_opt_not and trace_opt_regexpmatch2 insns are indistinguishablehttps://bugs.ruby-lang.org/issues/18269?journal_id=943312021-10-26T18:01:42Zk0kubun (Takashi Kokubun)takashikkbn@gmail.com
<ul></ul><p>No matter how we implement it (making each instruction unique, telling the compiler to not perform de-duplication if possible, etc.), one direction would be to make every address of trace instructions unique like you suggested. I would need to investigate some compiler macro or trick to force duplicate the same code for different insns since I don't have immediate knowledge to make that happen in GCC.</p>
<p>Another direction could be to have an st (or just an array with the size of insns) for each iseq and optionally insert mapping from such insn index to the original insn to it and use it for the reverse translation.</p>
<p>The trade-off here is that the former approach is more memory-efficient and the latter approach is platform-independent and potentially faster since it would continue to maintain a nice code locality.</p> Ruby master - Bug #18269: trace_opt_not and trace_opt_regexpmatch2 insns are indistinguishablehttps://bugs.ruby-lang.org/issues/18269?journal_id=946252021-11-12T07:44:01Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul></ul><p>FYI: I stopped the false-positive warning by explicitly excluding opt_regexpmatch2 from the check.<br>
<a class="changeset" title="test/ruby/test_jit.rb: suppress a false-positive warning It reports "opt_regexpmatch2 insn is no..." href="https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/61938e2db59a032a46fc3de2ebead2e5e9d630a9">61938e2db59a032a46fc3de2ebead2e5e9d630a9</a></p> Ruby master - Bug #18269: trace_opt_not and trace_opt_regexpmatch2 insns are indistinguishablehttps://bugs.ruby-lang.org/issues/18269?journal_id=1043542023-08-25T17:19:15Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>