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

[LLVM] Fix generation of LLVM intrinsics #5282

Merged
merged 3 commits into from
Apr 11, 2020
Merged

[LLVM] Fix generation of LLVM intrinsics #5282

merged 3 commits into from
Apr 11, 2020

Commits on Apr 10, 2020

  1. [LLVM] Fix generation of LLVM intrinsics

    The type list in the call to llvm::Intrinsic::getDeclaration is not
    the intrinsic's signature, it's the list of overloaded types. Without
    this fix, the updated unit test would cause the following error:
    
    TVMError: LLVM module verification failed with the following errors:
    Intrinsic name not mangled correctly for type arguments! Should be:
    llvm.ctlz.i32
    i32 (i32, i1)* @llvm.ctlz.i32.i1
    
    Special handling for llvm.prefetch, sig matching for overloaded ints only
    
    The prefetch intrinsic returns void in LLVM, while it returns i32 in TVM.
    This case needs to be handled specially, because rule-based intrinsic
    translation would cause invalid LLVM type to be created.
    
    Do the signature matching only for overloaded intrinsics. It's not needed
    for non-overloaded ones, so this can save a bit of compile-time.
    Krzysztof Parzyszek committed Apr 10, 2020
    Configuration menu
    Copy the full SHA
    2211e05 View commit details
    Browse the repository at this point in the history
  2. Include intrinsic name in the error message

    Krzysztof Parzyszek committed Apr 10, 2020
    Configuration menu
    Copy the full SHA
    f249fbb View commit details
    Browse the repository at this point in the history
  3. Fix number of arguments for llvm.fmuladd and llvm.pow

    Krzysztof Parzyszek committed Apr 10, 2020
    Configuration menu
    Copy the full SHA
    f94f4a1 View commit details
    Browse the repository at this point in the history