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

JuliaLang / julia / #37264
77%

Build:
DEFAULT BRANCH: master
Ran 15 Sep 2022 12:09PM UTC
Jobs 1
Files 383
Run time 17s
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

pending completion
#37264

push

local

web-flow
inference: fixes and improvements for backedge computation (#46741)

This commit consists of the following changes:

* inference: setup separate functions for each backedge kind

  Also changes the argument list so that they are ordered as
  `(caller, [backedge information])`.

* inference: fix backedge computation for const-prop'ed callsite

  With this commit `abstract_call_method_with_const_args` doesn't add
  backedge but rather returns the backedge to the caller, letting the
  callers like `abstract_call_gf_by_type` and `abstract_invoke` take the
  responsibility to add backedge to current context appropriately.
  
  As a result, this fixes the backedge calculation for const-prop'ed
  `invoke` callsite.
  
  For example, for the following call graph,
  ```julia
  foo(a::Int) = a > 0 ? :int : println(a)
  foo(a::Integer) = a > 0 ? "integer" : println(a)
  
  bar(a::Int) = @invoke foo(a::Integer)
  ```
  
  Previously we added the wrong backedge `nothing, bar(Int64) from bar(Int64)`:
  ```julia
  julia> last(only(code_typed(()->bar(42))))
  String
  
  julia> let m = only(methods(foo, (UInt,)))
  @eval Core.Compiler for (sig, caller) in BackedgeIterator($m.specializations[1].backedges)
  println(sig, ", ", caller)
  end
  end
  Tuple{typeof(Main.foo), Integer}, bar(Int64) from bar(Int64)
  nothing, bar(Int64) from bar(Int64)
  ```
  but now we only add `invoke`-backedge:
  ```julia
  julia> last(only(code_typed(()->bar(42))))
  String
  
  julia> let m = only(methods(foo, (UInt,)))
  @eval Core.Compiler for (sig, caller) in BackedgeIterator($m.specializations[1].backedges)
  println(sig, ", ", caller)
  end
  end
  Tuple{typeof(Main.foo), Integer}, bar(Int64) from bar(Int64)
  ```

* inference: make `BackedgePair` struct

* add invalidation test for `invoke` call

* optimizer: fixup inlining backedge calculation

  Should fix the following backedge calculation:
  ```julia
  julia> m = which... (continued)

79351 of 84951 relevant lines covered (93.41%)

29131594.96 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #37264.1 15 Sep 2022 12:09PM UTC 0
93.41
Source Files on build #37264
Detailed source file information is not available for this build.
  • Back to Repo
  • 997e3369 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

© 2026 Coveralls, Inc