• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JuliaLang / julia / #37747
77%

Build:
DEFAULT BRANCH: master
Ran 13 Apr 2024 11:21AM UTC
Jobs 1
Files 359
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Apr 2024 03:16AM UTC coverage: 86.185% (-1.1%) from 87.255%
#37747

push

local

web-flow
ir: Set refined when narrowing PhiNode in IncrementalCompact (#54061)

This is a bit of a tricky one. What happens here is that
IncrementalCompact finds that one branch of an if/else is dead, so one
of the incoming values of the PhiNode goes away. This may have the
effect of narrowing the type of the PhiNode (if the branches have
different types). In the latest iteration of our compiler, such
situations need to be annotated with IR_FLAG_REFINED or `Refined()`,
otherwise irinterp will skip them on revisit.

In theory, the fix is quite simple: Check whether the type is being
refined and if so, set the flag. However, this code sits inside
IncrementalCompcat, which currently neither performs lattice operations
nor sets any Refined flags by itself. The three possible options here
are:

1. Thread lattice through IncrementalCompact.
2. Use an egal check inside IncrementalCompact rather than the proper
lattice query. This is legal, but may overapproximate the need for
`Refined`, thus causing unnecessary work later.
3. Move the phi node narrowing outside of IncrementalCompact.

This PR takes a hybrid approach of 2 and 3. Approach 1 is undesirable,
because we do not want to recompile all of IncrementalCompact for every
lattice, just for this one query. I almost took approach 2, but it is
unsatisfying, because of the imprecision, which could cuase a lot of
extra work in pathological cases.

The primary downside of approach 3 is that now every pass that performs
IncrementalCompact with CFG manipulation enabled will need to call the
`reprocess_phi_node!` helper. We have two of these in base (adce_pass!
and `compact!(..., true)` although only the former as access to a
lattice.

The compromise I came up with here is to do the egality check, except
leaving the PhiNode in place when it fails rather than setting `Refined`
internally. I think this is ok. There's a bit of an issue with duplicate
work, because the first thing that the la... (continued)

21 of 21 new or added lines in 2 files covered. (100.0%)

1019 existing lines in 43 files now uncovered.

74293 of 86202 relevant lines covered (86.18%)

14549645.91 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
91.04
-0.2% base/io.jl
1
95.86
-0.14% base/sort.jl
1
95.65
-0.87% base/version.jl
1
72.97
-2.7% base/gcutils.jl
1
95.9
-0.19% stdlib/LinearAlgebra/src/generic.jl
1
86.21
-0.27% base/boot.jl
2
79.71
-0.41% stdlib/FileWatching/src/FileWatching.jl
2
79.93
-0.74% base/docs/Docs.jl
2
80.86
-0.43% base/float.jl
2
76.15
-0.61% base/client.jl
2
72.9
-2.33% base/c.jl
2
84.25
-0.17% stdlib/LinearAlgebra/src/matmul.jl
2
91.18
-0.91% base/logging.jl
3
93.92
-2.05% base/combinatorics.jl
3
78.26
-13.04% base/locks-mt.jl
3
91.34
-0.17% stdlib/LinearAlgebra/src/triangular.jl
3
86.67
-1.43% base/iostream.jl
4
97.1
-1.66% stdlib/LinearAlgebra/src/special.jl
5
86.71
-0.9% base/gmp.jl
8
88.41
-4.55% base/floatfuncs.jl
8
62.89
-5.03% base/libc.jl
8
59.26
-29.63% base/ryu/Ryu.jl
10
75.17
-6.71% base/ryu/fixed.jl
11
92.06
-5.82% base/ryu/exp.jl
11
66.67
-31.11% base/some.jl
12
91.12
-0.42% stdlib/LinearAlgebra/src/lapack.jl
14
87.92
-0.72% base/show.jl
14
93.94
-2.18% stdlib/LinearAlgebra/src/diagonal.jl
15
68.94
-9.58% base/sysinfo.jl
16
84.76
-2.47% base/mpfr.jl
16
49.41
-18.82% base/rounding.jl
17
36.72
-13.67% base/env.jl
18
76.64
-13.06% base/stacktraces.jl
19
61.76
-18.63% base/pcre.jl
23
85.54
-6.93% base/expr.jl
23
70.41
-23.47% stdlib/Logging/src/ConsoleLogger.jl
29
73.59
-8.61% base/ryu/shortest.jl
39
45.81
-25.89% base/meta.jl
74
70.59
-22.93% base/regex.jl
93
0.0
-86.36% stdlib/Mmap/src/Mmap.jl
104
76.77
0.01% base/loading.jl
174
1.08
-93.46% stdlib/Profile/src/Allocs.jl
222
62.5
-34.26% stdlib/LinearAlgebra/src/bidiag.jl
Jobs
ID Job ID Ran Files Coverage
1 #37747.1 13 Apr 2024 11:21AM UTC 359
86.18
Source Files on build #37747
  • Tree
  • List 359
  • Changed 274
  • Source Changed 0
  • Coverage Changed 49
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 396abe4f on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc