Skip to content

Conversation

@vchuravy
Copy link
Member

.travis.yml Outdated
brew install -v --only-dependencies --HEAD julia;
brew install -v staticfloat/juliadeps/libgfortran;
BUILDOPTS="-j3 USECLANG=1 USECCACHE=1 BINARYBUILDER_TRIPLET=x86_64-apple-darwin14";
BUILDOPTS="-j3 USECLANG=1 USECCACHE=1 BINARYBUILDER_TRIPLET=x86_64-apple-darwin14 BINARYBUILDER_LLVM_DEBUG=1";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this use a full Debug build of LLVM, or just enable assertions? Debug builds would probably be too slow for CI.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses a RelWithDebInfo build + Assertions, my intention was to make assertions give us a bit more useful information, but you are right it might be to slow for CI.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok. I don't think I've ever used a RelWithDebInfo build. I would guess it's probably much faster than a full Debug build though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I use that as my daily driver and it allows me to have reasonable speeds while being able to debug LLVM code. You can set LLVM_DEBUG=Release in your Make.user to get that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call it BINARYBUILDER_LLVM_RELWITHDEBINFO=1 then; so that we're not mixing metaphors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm that is a lot to write..., a full debug build is not really useful in any case.

@vchuravy
Copy link
Member Author

@iblis17 Looks like FreeBSD doesn't clean properly and as such is sticky to patches? The current recommendation is to use ccache and git clean -fdx to make sure that each build is from scratch (and reasonably fast)

@iblislin
Copy link
Member

I'm going to try ccache locally at first. Will gmake CC='ccache clang' work? (IIRC, our Make.inc will override CC)

@iblislin
Copy link
Member

Oh, I got it. There is an option USECCACHE.

@iblislin
Copy link
Member

@vchuravy But in case of this CI build (https://freebsdci.julialang.org/#/builders/1/builds/9574),
I can reproduce the same error at local box from a clean clone.
I think it's not cache issue.

--------------------------
|Index: llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp
|===================================================================
|--- a/lib/Target/X86/X86DomainReassignment.cpp
|+++ b/lib/Target/X86/X86DomainReassignment.cpp
--------------------------
Patching file lib/Target/X86/X86DomainReassignment.cpp using Plan A...
Hunk #1 succeeded at 26.
Hunk #2 succeeded at 311 (offset 19 lines).
patch: **** malformed patch at line 38: @@ -339,7 +365,7 @@
gmake[1]: *** [/usr/home/julia/julia-fbsd-buildbot/worker/11rel-amd64/build/deps/llvm.mk:492: /usr/home/julia/julia-fbsd-buildbot/worker/11rel-amd64/build/deps/srccache/llvm-6.0.0/llvm-rL332682.patch-applied] Error 2
gmake[1]: *** Waiting for unfinished jobs....

ccache is an attractive suggestion. I will add it later.

@iblislin
Copy link
Member

I manually tuned the patch llvm-rL332682.patch

diff --git a/deps/patches/llvm-rL332682.patch b/deps/patches/llvm-rL332682.patch
index b6a15c29b0..7bfe1e420f 100644
--- a/deps/patches/llvm-rL332682.patch
+++ b/deps/patches/llvm-rL332682.patch
@@ -24,7 +24,7 @@ Index: llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp
      for (RegDomain D : LegalDstDomainList)
        LegalDstDomains.set(D);
    }
-@@ -328,6 +333,27 @@
+@@ -328,6 +333,10 @@
      return Instrs;
    }

@@ -69,7 +69,7 @@ Index: llvm/trunk/lib/Target/X86/X86DomainReassignment.cpp
    for (unsigned Idx = 0; Idx < MRI->getNumVirtRegs(); ++Idx) {
      unsigned Reg = TargetRegisterInfo::index2VirtReg(Idx);

-@@ -717,20 +744,22 @@
+@@ -717,20 +744,21 @@
        continue;

      // Calculate closure starting with Reg.

Then, the error message changed. It's from llvm-rL332302.patch now. Any idea?

Hmm...  Looks like a unified diff to me...                                                                                                         
The text leading up to this was:                                                                                                                   
--------------------------                                                                                                                         
|Index: llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp                                                                             
|===================================================================                                                                               
|--- a/lib/Transforms/InstCombine/InstructionCombining.cpp      (revision 332301)                                                                  
|+++ b/lib/Transforms/InstCombine/InstructionCombining.cpp      (revision 332302)                                                                  
--------------------------                                                                                                                         
Patching file lib/Transforms/InstCombine/InstructionCombining.cpp using Plan A...                                                                  
Hunk #1 failed at 1.
1 out of 1 hunks failed--saving rejects to lib/Transforms/InstCombine/InstructionCombining.cpp.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: llvm/trunk/test/Transforms/InstCombine/gep-addrspace.ll
|===================================================================
|--- a/test/Transforms/InstCombine/gep-addrspace.ll     (revision 332301)
|+++ b/test/Transforms/InstCombine/gep-addrspace.ll     (revision 332302)
--------------------------
Patching file test/Transforms/InstCombine/gep-addrspace.ll using Plan A...
Hunk #1 succeeded at 1.
done
gmake[1]: *** [/data/iblis/git/julia/deps/llvm.mk:493: /data/iblis/git/julia/deps/srccache/llvm-6.0.0/llvm-rL332302.patch-applied] Error 1
gmake: *** [Makefile:60: julia-deps] Error 2

@vchuravy
Copy link
Member Author

vchuravy commented May 21, 2018 via email

iblislin added a commit to iblislin/julia that referenced this pull request May 21, 2018
@vchuravy
Copy link
Member Author

Ok let's try this again, I had to rewrite your patch @JeffBezanson and I created a new LLVMBuilder release.
I am a bit bewildered to why I was under the impression that the patches applied and worked.
LLVMBuilder is now a bit more robust against failure and I chalk that up to a stale cache or something...

@vchuravy vchuravy requested a review from Keno May 22, 2018 18:23
Copy link
Member

@Keno Keno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I do agree that we should change the flag name, since LLVM_DEBUG=1 is the debug build. If you want to shorted it, I think BB_LLVM_REL_DBG=1 would be fine.

@vchuravy
Copy link
Member Author

vchuravy commented May 22, 2018 via email

@Keno
Copy link
Member

Keno commented May 23, 2018

Seems to be missing AppVeyor CI?

@vchuravy vchuravy closed this May 23, 2018
@vchuravy vchuravy reopened this May 23, 2018
@vchuravy
Copy link
Member Author

Appveyor seems to have timed out after 2h, what is our normal time on AV?

@vchuravy
Copy link
Member Author

Timed out again after 2h I hope that #27222, helps otherwise I will try and use the non-debug build on AV.

@vchuravy
Copy link
Member Author

@Keno What should the output be for:

llc -mcpu=skylake-avx512 -mtriple=x86_64-unknown-linux-gnu %s -o - | llvm-mc

in the domain-reassignment test?

        .text
        .file   "domain-reassignment-test.ll"
        .globl  japi1_foo2_34617
        .p2align        4, 0x90
        .type   japi1_foo2_34617,@function
japi1_foo2_34617:
        .cfi_startproc
        vpxor   %xmm0, %xmm0, %xmm0
<stdin>:10:2: error: instruction requires: AVX-512 ISA AVX-512 VL ISA
        vpcmpgtq        %xmm0, %xmm0, %k0
        ^
<stdin>:11:2: error: instruction requires: AVX-512 ISA
        kshiftrw        $1, %k0, %k1
        ^
<stdin>:12:2: error: instruction requires: AVX-512 BW ISA
        kmovd   %k0, %eax
        ^
        testq   %rax, %rax
        setg    %cl
<stdin>:15:2: error: instruction requires: AVX-512 BW ISA
        kmovd   %k1, %edx
        ^
        andl    %eax, %edx
        testb   %dl, %cl
        je      .LBB0_1
        retq
.LBB0_1:
.Lfunc_end0:
        .size   japi1_foo2_34617, .Lfunc_end0-japi1_foo2_34617
        .cfi_endproc


        .section        ".note.GNU-stack","",@progbits

@Keno
Copy link
Member

Keno commented May 23, 2018

You may be missing llvm-mirror/llvm@f5e705e? llvm-mc should not error

@vchuravy
Copy link
Member Author

No I have that one, but I need to pass -mcpu=skylake-avx512 aswell.

@vchuravy vchuravy force-pushed the vc/bbpatch branch 2 times, most recently from 2c78a29 to 5be5329 Compare May 24, 2018 18:33
@kshyatt kshyatt added the ci Continuous integration label May 27, 2018
@Keno
Copy link
Member

Keno commented May 31, 2018

Bump! There've been two issues filed in the last 24 hours for issues fixed by this PR.

@Keno Keno added this to the 0.7 milestone Jun 1, 2018
@vchuravy
Copy link
Member Author

vchuravy commented Jun 1, 2018 via email

@vchuravy
Copy link
Member Author

vchuravy commented Jun 3, 2018

It turns out that in the original trial I didn't set a flag correctly and didn't actually build a RelWithDebInfo build. Those are about 2GB and I think therefore unfeasable for CI.
I am switching things over to only Asserts now.

@vchuravy
Copy link
Member Author

vchuravy commented Jun 7, 2018

@Keno genuine assertion error on Windows:

Allocations: 5256 (Pool: 5256; Big: 0); GC: 0
Assertion failed!
Program: C:\projects\julia\usr\bin\julia-debug.exe
File: /workspace/srcdir/llvm-6.0.0.src/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp, Line 2551
Expression: InChain.getValueType() == MVT::Other && "Not a chain"
*** This error is usually fixed by running `make clean`. If the error persists, try `make cleanall`. ***
make[1]: *** [Makefile:203: /cygdrive/c/projects/julia/usr/lib/julia/sys-debug-o.a] Error 

JeffBezanson and others added 2 commits June 19, 2018 10:21
Adds patches for:
- #27055
- #27080
- #27032

furthermore this adds the ability to use assertion builds on CI.
Which is used on OSX and Windows.
@vchuravy
Copy link
Member Author

First a straight flush and then a spurious merge conflict on a file that this PR doesn't touch...
This is ready to get merged once CI passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants