Commit 83c7dd3
committed
Accept test result for improved GVN
This occurs as a direct consequence of the CFG migration.
IR::EvalInstruction now deliberately creates a value-producing
instruction for a NotExpr (or LogicalBinaryExpr) from its after-node,
but only when the expression is not in a boolean conditional contex. !d
here sits in a const initializer, not an if/for/switch condition, so
isInBooleanCondContext is false and the after-node becomes an
EvalInstruction — surfacing as the After !... data-flow node. That node
reports getBoolValue() = true and isPlatformIndependentConstant(), so
GVN can match it to the true literal.
On main, a NotExpr in this position produced no such value node (the old
hand-written CFG split the ! evaluation across branch outcomes rather
than exposing a single combined value node), so there was no
DataFlow::Node for !d to be numbered, and hence no row. The new design
intentionally re-introduces a single combined value node in
non-conditional contexts, which is exactly what makes this (correct) GVN
equivalence visible.
So: the line is right, and it's expected fallout from the migration's
handling of !/&&/|| value nodes.1 parent 8c149c1 commit 83c7dd3
1 file changed
Lines changed: 1 addition & 0 deletions
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
0 commit comments