-
Notifications
You must be signed in to change notification settings - Fork 42
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
Debug Travis macOS #108
Debug Travis macOS #108
Conversation
The failing test: @testset "loops" begin
program = """
def fib(x) {
var a = 1, b = 1
for i = 3, i < x, 1.0 {
var c = a + b
a = b
b = c
}
b
}
def entry() {
fib(10)
}
"""
LLVM.Context() do ctx
m = Kaleidoscope.generate_IR(program, ctx)
Kaleidoscope.optimize!(m)
mktemp() do path, io
Kaleidoscope.write_objectfile(m, path)
end
println(m)
v = Kaleidoscope.run(m, "entry")
@test v == 55.0
end
end Generated module looks sane: ; ModuleID = 'KaleidoscopeModule'
source_filename = "KaleidoscopeModule"
target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
define double @fib(double %x) {
entry:
br label %loop
loop: ; preds = %loop, %entry
%i6 = phi double [ %nextvar, %loop ], [ 3.000000e+00, %entry ]
%b3 = phi double [ %addtmp, %loop ], [ 1.000000e+00, %entry ]
%a2 = phi double [ %b3, %loop ], [ 1.000000e+00, %entry ]
%addtmp = fadd double %a2, %b3
%cmptmp = fcmp olt double %i6, %x
%nextvar = fadd double %i6, 1.000000e+00
br i1 %cmptmp, label %loop, label %afterloop
afterloop: ; preds = %loop
ret double %addtmp
}
define double @entry() {
entry:
%calltmp = call double @fib(double 1.000000e+01)
ret double %calltmp
}
; Function Attrs: nounwind
declare void @llvm.stackprotector(i8*, i8**) #0
attributes #0 = { nounwind } |
Huh, can reproduce with binary releases of Julia. |
So the difference between a locally-built Julia/LLVM and the binary one is the datalayout...
Not sure how that differs between different LLVM builds. |
According to https://github.com/ghc/ghc/blob/master/llvm-targets these are respectively the 32 and 64 bit macOS target...
|
Triple is wrong. Binary:
Built:
Well, it's not wrong. So we can't rely on the default triple being well suited for the local host. |
On the other hand: https://llvm.org/docs/tutorial/LangImpl08.html
It's set by CMake ( |
No description provided.