Shopify / seafoam

A tool for working with compiler graphs dumped by the GraalVM compiler
MIT License
126 stars 22 forks source link

"Guard not" is always shown, even if the guard is not negated #6

Closed eregon closed 4 years ago

eregon commented 4 years ago

For instance on this picture it should be Guard, else TranferToInterpreter, I verified with props that it's "negated": false,: Screenshot from 2020-07-23 11-04-24

chrisseaton commented 4 years ago

We can see the problem in fib-ruby.bgv:

% bundle exec bin/seafoam examples/fib-ruby.bgv:9:1248 props | grep negated
  "negated": true,
    "name_template": "FixedGuard(!={p#negated}) {p#reason/s}",
% bundle exec bin/seafoam examples/fib-ruby.bgv:9:2621 props | grep negated
  "negated": false,
    "name_template": "FixedGuard(!={p#negated}) {p#reason/s}",
Screenshot 2020-07-27 at 14 01 04

It looks like we're confusing a symbol and string property. The idea of using both was that we could use strings for properties that appear actually in the original graph, and symbols for synthetic properties we use to annotate the graph, but maybe that's confusing.

But to fix - we need to look for the string not the symbol, and we can use this graph as a test.

chrisseaton commented 4 years ago

Fixed by #7.