Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 1.11.1 adding conditional jumps #56326

Closed
PallHaraldsson opened this issue Oct 25, 2024 · 4 comments
Closed

Regression in 1.11.1 adding conditional jumps #56326

PallHaraldsson opened this issue Oct 25, 2024 · 4 comments
Labels
needs more info Clarification or a reproducible example is required

Comments

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented Oct 25, 2024

See @code_native println() [EDIT: What I meant to write instead of here originally "See @code_lowered println()"]

It's not hugely worrying (there), but I'm thinking if it might be a more wide-spread problem. This is with and without my latest merged PR for print[ln].

It's not a problem in 1.11-beta1 but is in 1.11.0-beta2 and later (in anyone wants to bisect). And -O3 does not help. #53750 is the claimed cause i.e. since beta1 #54112, see comment and closing below).

See:

julia> @code_lowered println()
CodeInfo(
1 ─ %1 = Base.println
│   %2 = Base.stdout
│   %3 = Core.tuple(%2)
│   %4 = Core._apply_iterate(Base.iterate, %1, %3, xs)
└──      return %4
)

might it relate to (slightly different, equivalent?!):

julia> @code_lowered println()
CodeInfo(
1 ─ %1 = Base.println
│   %2 = Core.tuple(Base.stdout)
│   %3 = Core._apply_iterate(Base.iterate, %1, %2, xs)
└──      return %3

How would I figure out the cause (other than bisecting (not-to speed on that)?

My guess is a check for null pointers (at least for Strings, but they should never be NULL, while other pointers could be). Could it relate to new Memory type, and then all Vector[-like] and arrays?

@KristofferC
Copy link
Member

What's the regression exactly? This is lowered code as well so this has nothing to do with optimization etc.

@KristofferC KristofferC added the needs more info Clarification or a reproducible example is required label Oct 25, 2024
@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Oct 25, 2024

julia> @code_llvm optimize=true println()
..
 %stdout.checked = load atomic ptr, ptr @"*Main.Base.stdout#3696.jit" unordered, align 16
  %.not = icmp eq ptr %stdout.checked, null
  br i1 %.not, label %err, label %ok

err:                                              ; preds = %top
  call void @ijl_undefined_var_error(ptr nonnull @"jl_sym#stdout#3697.jit", ptr nonnull @"jl_global#3698.jit")
  unreachable

That part is absent on older versions. @code_llvm optimize=false println() is slightly shorter, still same regarding this problem.

Could this be about (recently upgraded) LLVM only? I think not. Or can it be only related to stdout?

@vtjnash
Copy link
Member

vtjnash commented Oct 25, 2024

Looks like originally a bug (#53750) that was fixed before rc4 via backport #53790

@vtjnash vtjnash closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
@PallHaraldsson
Copy link
Contributor Author

Looks like originally a bug (#53750)

Are you sure? It's too large a PR for me to review/understand. It least print/ln worked before, with this supposed bug in, now with tiny bit of regression. Did you bisect to this? I was answering just about you commenting and closing, so might have missed out on "stdout.checked" part and my edit at the top.

Any idea about how to recover old tighter assembly for print/ln?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Clarification or a reproducible example is required
Projects
None yet
Development

No branches or pull requests

3 participants