# LLVM upstream dropped scalar TBAA tags support

**URL:** <https://discourse.julialang.org/t/llvm-upstream-dropped-scalar-tbaa-tags-support/503>\
**Category:** Internals & Design\
**Created:** [November 22, 2016, 6:59pm UTC](https://discourse.julialang.org/t/llvm-upstream-dropped-scalar-tbaa-tags-support/503 "2016-11-22T18:59:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seokj567](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/seokj567/32/228_2.png) [@seokj567](https://discourse.julialang.org/u/seokj567)\
**Post date:** [November 22, 2016, 6:59pm UTC](https://discourse.julialang.org/t/llvm-upstream-dropped-scalar-tbaa-tags-support/503/1 "2016-11-22T18:59:10Z")

</div>

Hi.

I’ve been experimenting with Julia by linking it against LLVM upstream’s new (4.0) libraries and experiencing several problems in build stage.

Compiling initial julia executable was possible by small patch : changing header file of jitlayers.cpp (llvm/Bitcode/ReaderWriter.h) to llvm/Bitcode/BitcodeReader.h, llvm/Bitcode/BitcodeWriter.h

But when Julia tries to build sysimg, it fails with segmentation fault while compiling precompile.jl.

After linking Julia against Debug build of llvm, I found out assertion of method getMostGenericTBAA was failing because LLVM no longer supports scalar TBAA tags.  
[https://github.com/llvm-mirror/llvm/commit/b73e1558ac8255d5df48d6d200ac6a5a20c968fd](https://github.com/llvm-mirror/llvm/commit/b73e1558ac8255d5df48d6d200ac6a5a20c968fd)

So apparently I’ll have to upgrade (TBAA)metadata node that Julia feeds to llvm by llvm::UpgradeTBAANode method to make llvm happy but as I don’t fully understand code generation stage of Julia I thought it would be really helpful if somebody could help me out.

Will upgrading tbaa nodes (tbaa\_gcframe, tbaa\_stack, etc) inside codegen.cpp’s init\_julia\_llvm\_meta be enough?

Thanks for your time in advance.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [November 22, 2016, 7:05pm UTC](https://discourse.julialang.org/t/llvm-upstream-dropped-scalar-tbaa-tags-support/503/2 "2016-11-22T19:05:30Z")

</div>

Fixed by [Fix compilation on LLVM 4.0 by yuyichao · Pull Request #19380 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/19380)

---

<div class="post-metadata">

**Author:** ![seokj567](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/seokj567/32/228_2.png) [@seokj567](https://discourse.julialang.org/u/seokj567)\
**Post date:** [November 22, 2016, 7:39pm UTC](https://discourse.julialang.org/t/llvm-upstream-dropped-scalar-tbaa-tags-support/503/3 "2016-11-22T19:39:46Z")

</div>

@yuyichao Thanks! Build passed on my OS X machine.

On the patch though, UpgradeTBAANode inside init\_julia\_llvm\_meta also seems to work in my local machine. Can you test it too?

Or maybe we should continue our conversation on GitHub.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [November 22, 2016, 7:49pm UTC](https://discourse.julialang.org/t/llvm-upstream-dropped-scalar-tbaa-tags-support/503/4 "2016-11-22T19:49:04Z")

</div>

> [@seokj567](#):
>
> On the patch though, UpgradeTBAANode inside init\_julia\_llvm\_meta also seems to work in my local machine. Can you test it too?

I don’t see why that’s better than creating the right metadata directly and AFAICT the messier part is that the parent node is not the same as the one attached to the instruction. At least that’s how clang does it and there’s currently no documentation on this.
