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

Fix codegen test on debug version #46065

Merged
merged 2 commits into from
Jul 18, 2022
Merged

Conversation

inkydragon
Copy link
Member

@inkydragon inkydragon commented Jul 16, 2022

xref: #46064

  • Fix the name of the libjulia-codegen library in the debug version
  • skip some llvm codegen test

reproduction steps

make -j `nproc`  debug
make -C test/  compiler/codegen debug

get_llvm test

using InteractiveUtils
using Test

const opt_level = Base.JLOptions().opt_level

# `_dump_function` might be more efficient but it doesn't really matter here...
get_llvm(@nospecialize(f), @nospecialize(t), raw=true, dump_module=false, optimize=true) =
    sprint(code_llvm, f, t, raw, dump_module, optimize)

get_llvm(identity, Tuple{String}) |> print
if opt_level > 0
    # Make sure getptls call is removed at IR level with optimization on
    @test !occursin(" call ", get_llvm(identity, Tuple{String}))
end

In the debug version, the @test fails because the output of llvm contains the string "call".
For now I'm just skipping them in the debug version. Maybe there is a better solution.

julia> get_llvm(identity, Tuple{String}) |> print
;  @ operators.jl:513 within `identity`
; Function Attrs: sspstrong
define nonnull {} addrspace(10)* @julia_identity_55({} addrspace(10)* noundef nonnull %0) #0 !dbg !5 {
top:
;  @ operators.jl within `identity`
  call void @llvm.dbg.value(metadata {} addrspace(10)* null, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
  call void @llvm.dbg.value(metadata {} addrspace(10)* %0, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
;  @ operators.jl:513 within `identity`
  ret {} addrspace(10)* %0, !dbg !19
}

@inkydragon inkydragon added test This change adds or pertains to unit tests compiler:codegen Generation of LLVM IR and native code labels Jul 16, 2022
@JeffBezanson JeffBezanson merged commit 82c3a6f into JuliaLang:master Jul 18, 2022
@inkydragon inkydragon deleted the dbg-test branch July 19, 2022 05:21
ffucci pushed a commit to ffucci/julia that referenced this pull request Aug 11, 2022
* test: fix codegen debug lib name

* test: skip some codegen tests in debug version
pcjentsch pushed a commit to pcjentsch/julia that referenced this pull request Aug 18, 2022
* test: fix codegen debug lib name

* test: skip some codegen tests in debug version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants