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

[Loopinfo] recursive conversion to metadata #31347

Merged
merged 2 commits into from
Mar 19, 2019
Merged

[Loopinfo] recursive conversion to metadata #31347

merged 2 commits into from
Mar 19, 2019

Conversation

vchuravy
Copy link
Member

Follow-up on #31095, instead of pattern-matching against a limited set of patterns allow for a full description of a metadata tree.
Run into this because LLVM required a MDNode around the MDString for llvm.loop.unroll.full. This PR allows us to write that as: Expr(:loopinfo, ("llvm.loop.unroll.full",))

Right now one can work around that particular one by using Expr(:loopinfo, ("llvm.loop.unroll.full", true)), the second element of the tuple gets ignored.
Also a good opportunity to add more tests.

I would like to eventually enable,

function f(::Val{N}) where N
    @unroll N for i in ...
        ...
     end
end

e.g. using compile-time constants (and not parse time constants) as part of the build expression, but that requires a bigger rework of the node, to allow SSAValues.

cc: @lcw

@vchuravy vchuravy added compiler:codegen Generation of LLVM IR and native code needs tests Unit tests are required for this change labels Mar 14, 2019
@vchuravy vchuravy marked this pull request as ready for review March 15, 2019 03:09
@vchuravy
Copy link
Member Author

Also addresses #31095 (comment)

@vchuravy vchuravy removed the needs tests Unit tests are required for this change label Mar 15, 2019
@vchuravy vchuravy requested review from Keno, maleadt and vtjnash March 15, 2019 03:11
@vchuravy
Copy link
Member Author

The last commit is in response to the failure on Linux:

julia --startup-file=no /home/travis/build/JuliaLang/julia/test/llvmpasses/loopinfo.jl /home/travis/build/JuliaLang/julia/test/llvmpasses/Output/loopinfo.jl.tmp | llvm-link -S /home/travis/build/JuliaLang/julia/test/llvmpasses/Output/loopinfo.jl.tmp/* | FileCheck /home/travis/build/JuliaLang/julia/test/llvmpasses/loopinfo.jl
julia --startup-file=no /home/travis/build/JuliaLang/julia/test/llvmpasses/loopinfo.jl /home/travis/build/JuliaLang/julia/test/llvmpasses/Output/loopinfo.jl.tmp | llvm-link -S /home/travis/build/JuliaLang/julia/test/llvmpasses/Output/loopinfo.jl.tmp/* | opt -load libjulia.so -LowerSIMDLoop -S - | FileCheck /home/travis/build/JuliaLang/julia/test/llvmpasses/loopinfo.jl -check-prefix=LOWER
--
Exit Code: 2
Command Output (stderr):
--
llvm-link: /home/travis/build/JuliaLang/julia/test/llvmpasses/Output/loopinfo.jl.tmp/*: error: Could not open input file: No such file or directory
llvm-link: error loading file '/home/travis/build/JuliaLang/julia/test/llvmpasses/Output/loopinfo.jl.tmp/*'
FileCheck error: '-' is empty.
FileCheck command line:  FileCheck /home/travis/build/JuliaLang/julia/test/llvmpasses/loopinfo.jl

@vchuravy vchuravy mentioned this pull request Mar 16, 2019
@vchuravy
Copy link
Member Author

@staticfloat buildbot fail on upload to AWS.

@vchuravy
Copy link
Member Author

Ok this is done from my side, the travis MacOSX error is a time-out. Absent objections I will merge this tomorrow.

@vchuravy vchuravy merged commit 58a0016 into master Mar 19, 2019
@DilumAluthge DilumAluthge deleted the vc/loopinfo2 branch January 12, 2021 21:26
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants