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

jl_special_vector_alignment: Remove work-around for old LLVM versions #34490

Merged
merged 1 commit into from
Jan 24, 2020

Conversation

eschnett
Copy link
Contributor

LLVM <= 3.8 segfaults when LLVM SIMD vectors are not powers of 2 (or a sum
of 2 different powers of 2). This LLVM bug was corrected in 2017 (see
https://bugs.llvm.org/show_bug.cgi?id=27708). This change removes this
work-around, finally allowing arbitrary SIMD vector lengths in Julia.

This changes Julia's ABI for SIMD types. All SIMD types are now represented
as SIMD vectors in LLVM. The work-around represented some SIMD types as
LLVM arrays instead to avoid the LLVM segfault. I don't think that SIMD
vector lengths that are not a power of 2 were in widespread use, if at all.

@eschnett
Copy link
Contributor Author

See eschnett/SIMD.jl#61

@KristofferC KristofferC added the needs tests Unit tests are required for this change label Jan 23, 2020
@StefanKarpinski
Copy link
Member

StefanKarpinski commented Jan 23, 2020

Who would be good to review? @Keno, @vtjnash, @vchuravy?

@vchuravy
Copy link
Member

vchuravy commented Jan 23, 2020

Would be good to have tests for this. They should probably be both end to end tests in llvmpasses, but also correctness tests so that we can trust in LLVM producing semantically correct code.

@eschnett
Copy link
Contributor Author

Reviewers could be participants of eschnett/SIMD.jl#1 or eschnett/SIMD.jl#61 .

I tested with

using SIMD
[1.0 * Vec(ntuple(i->1.0, n)) for n in 1:100]

which depends on SIMD.jl. I can convert that into a test.

Would you prefer a weak test (without arithmetic), or a strong test that uses llvmcall?

@vtjnash
Copy link
Member

vtjnash commented Jan 23, 2020

Or just remove the code that excluded these sizes from the existing tests (last for loop at the bottom of the vecelements test file)

@eschnett
Copy link
Contributor Author

D'oh. Will do that.

…(<=3.8)

LLVM <= 3.8 segfaults when LLVM SIMD vectors are not powers of 2 (or a sum
of 2 different powers of 2). This LLVM bug was corrected in 2017 (see
<https://bugs.llvm.org/show_bug.cgi?id=27708>). This change removes this
work-around, finally allowing arbitrary SIMD vector lengths in Julia.

This changes Julia's ABI for SIMD types. All SIMD types are now represented
as SIMD vectors in LLVM. The work-around represented some SIMD types as
LLVM arrays instead to avoid the LLVM segfault. I don't think that SIMD
vector lengths that are not a power of 2 were in widespread use, if at all.
@KristofferC KristofferC merged commit e0740fe into JuliaLang:master Jan 24, 2020
@KristofferC KristofferC removed the needs tests Unit tests are required for this change label Jan 26, 2020
@perrutquist
Copy link
Contributor

The documentation at https://github.com/JuliaLang/julia/blob/master/doc/src/base/simd-types.md should be updated to remove the part about the set {2-6,8-10,16}, right?

@eschnett
Copy link
Contributor Author

Correct. I opened a pull request. (Via the web interface, let's see whether that work.)

vtjnash pushed a commit that referenced this pull request Feb 4, 2020
…(<=3.8) (#34490)

LLVM <= 3.8 segfaults when LLVM SIMD vectors are not powers of 2 (or a sum
of 2 different powers of 2). This LLVM bug was corrected in 2017 (see
<https://bugs.llvm.org/show_bug.cgi?id=27708>). This change removes this
work-around, finally allowing arbitrary SIMD vector lengths in Julia.

This changes Julia's ABI for SIMD types. All SIMD types are now represented
as SIMD vectors in LLVM. The work-around represented some SIMD types as
LLVM arrays instead to avoid the LLVM segfault. I don't think that SIMD
vector lengths that are not a power of 2 were in widespread use, if at all.
KristofferC pushed a commit that referenced this pull request Feb 5, 2020
…(<=3.8) (#34490)

LLVM <= 3.8 segfaults when LLVM SIMD vectors are not powers of 2 (or a sum
of 2 different powers of 2). This LLVM bug was corrected in 2017 (see
<https://bugs.llvm.org/show_bug.cgi?id=27708>). This change removes this
work-around, finally allowing arbitrary SIMD vector lengths in Julia.

This changes Julia's ABI for SIMD types. All SIMD types are now represented
as SIMD vectors in LLVM. The work-around represented some SIMD types as
LLVM arrays instead to avoid the LLVM segfault. I don't think that SIMD
vector lengths that are not a power of 2 were in widespread use, if at all.

(cherry picked from commit e0740fe)
@KristofferC KristofferC mentioned this pull request Feb 5, 2020
26 tasks
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
…(<=3.8) (#34490)

LLVM <= 3.8 segfaults when LLVM SIMD vectors are not powers of 2 (or a sum
of 2 different powers of 2). This LLVM bug was corrected in 2017 (see
<https://bugs.llvm.org/show_bug.cgi?id=27708>). This change removes this
work-around, finally allowing arbitrary SIMD vector lengths in Julia.

This changes Julia's ABI for SIMD types. All SIMD types are now represented
as SIMD vectors in LLVM. The work-around represented some SIMD types as
LLVM arrays instead to avoid the LLVM segfault. I don't think that SIMD
vector lengths that are not a power of 2 were in widespread use, if at all.
BioTurboNick pushed a commit to BioTurboNick/julia that referenced this pull request Apr 13, 2020
…(<=3.8) (JuliaLang#34490)

LLVM <= 3.8 segfaults when LLVM SIMD vectors are not powers of 2 (or a sum
of 2 different powers of 2). This LLVM bug was corrected in 2017 (see
<https://bugs.llvm.org/show_bug.cgi?id=27708>). This change removes this
work-around, finally allowing arbitrary SIMD vector lengths in Julia.

This changes Julia's ABI for SIMD types. All SIMD types are now represented
as SIMD vectors in LLVM. The work-around represented some SIMD types as
LLVM arrays instead to avoid the LLVM segfault. I don't think that SIMD
vector lengths that are not a power of 2 were in widespread use, if at all.

(cherry picked from commit e0740fe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants