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

Instruction does not dominate all uses!, getelementptr inbounds when testing DimensionalData #48917

Closed
KristofferC opened this issue Mar 6, 2023 · 10 comments · Fixed by #48939
Labels
bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code regression Regression in behavior compared to a previous version

Comments

@KristofferC
Copy link
Member

KristofferC commented Mar 6, 2023

Happens on master and backports-release-1.9.

pkg> add DimensionalData; test DimensionalData
...
Instruction does not dominate all uses!
  %47 = getelementptr inbounds [1 x { [2 x double], [2 x [1 x i64]] }], [1 x { [2 x double], [2 x [1 x i64]] }]* %2, i32 0, i32 0, !dbg !135
  %44 = getelementptr inbounds { [2 x double], [2 x [1 x i64]] }, { [2 x double], [2 x [1 x i64]] }* %47, i32 0, i32 1, !dbg !122
Assertion failed: (!verifyModule(M, &errs())), function operator(), file jitlayers.cpp, line 1155.

[33812] signal (6): Abort trap: 6
in expression starting at /Users/kristoffercarlsson/.julia/packages/DimensionalData/1wSpb/test/selector.jl:1126
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 57098308 (Pool: 57051008; Big: 47300); GC: 76
ERROR: Package DimensionalData errored during testing (received signal: 6)

Needs asserts builds.

@KristofferC KristofferC added this to the 1.9 milestone Mar 6, 2023
@KristofferC KristofferC changed the title Instruction does not dominate all uses! when testing DimensionalData Instruction does not dominate all uses!, getelementptr inbounds when testing DimensionalData Mar 6, 2023
@gbaraldi
Copy link
Member

gbaraldi commented Mar 6, 2023

Reduced to

using DimensionalData, Unitful, Extents
using DimensionalData.LookupArrays


a = [1 2  3  4
     5 6  7  8
     9 10 11 12]

da = DimArray(a,(Y(1:3),Ti(Sampled((1:4)u"s"; sampling=Intervals()))))
Extents.extent(da)

@gbaraldi
Copy link
Member

gbaraldi commented Mar 6, 2023

5378a31 bad, release-1.8 good

Bad here isn't the first bad commit, just a range.

@gbaraldi
Copy link
Member

gbaraldi commented Mar 7, 2023

fe72f81 Is the first bad commit.

@KristofferC
Copy link
Member Author

I guess that's just the place where we actually started verifying this. :/

@gbaraldi
Copy link
Member

gbaraldi commented Mar 7, 2023

Yeah.

@KristofferC KristofferC removed this from the 1.9 milestone Mar 7, 2023
@gbaraldi
Copy link
Member

gbaraldi commented Mar 7, 2023

I'm pretty sure it's #45153 :)

@vtjnash
Copy link
Member

vtjnash commented Mar 7, 2023

Looks probably true, since here is the IR for it, which fails with

Instruction does not dominate all uses!
  %33 = getelementptr inbounds [1 x { [2 x i64], [2 x [1 x i64]] }], [1 x { [2 x i64], [2 x [1 x i64]] }]* %2, i32 0, i32 0, !dbg !102
  %30 = getelementptr inbounds { [2 x i64], [2 x [1 x i64]] }, { [2 x i64], [2 x [1 x i64]] }* %33, i32 0, i32 1, !dbg !89

@code_llvm optimize=false dump_module=true raw=true Extents.extent(da)

48917julia.txt
48917llvm.txt

@gbaraldi
Copy link
Member

gbaraldi commented Mar 7, 2023

I'm running creduce on it, because the types are a bit massive on that example so it's a bit harder to see where we go wrong.

@vtjnash
Copy link
Member

vtjnash commented Mar 7, 2023

manually "creduce" yielded:

julia> f(x, w) = (y = (a=1, b=x); z = (; a=(a=(1, w), b=(3, y))))

make a struct early, then do a lot of indexing of wrappers that includes it

@gbaraldi
Copy link
Member

gbaraldi commented Mar 7, 2023

Jameson reduce is a lot faster than creduce 😆 . Thanks!

@vtjnash vtjnash added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version compiler:codegen Generation of LLVM IR and native code and removed bisect wanted labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants