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.prefetch fails code generation on Linux. #1155

Closed
Kelimion opened this issue Sep 11, 2021 · 1 comment
Closed

llvm.prefetch fails code generation on Linux. #1155

Kelimion opened this issue Sep 11, 2021 · 1 comment
Labels

Comments

@Kelimion
Copy link
Member

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System: Ubuntu 20.04
  • Please paste odin version output: odin version dev-2021-09:5f920414

Expected Behavior

Example prints "Foozle prefetched."

Current Behavior

Code generation error on Linux. Example works on Windows.

LLVM CODE GEN FAILED FOR PROCEDURE: test.prefetch_address
; Function Attrs: alwaysinline
define internal void @test.prefetch_address(i8* %0, i8* noalias nocapture nonnull %__.context_ptr) #0 {
decls:
  %1 = alloca i8*, align 8
  br label %entry

entry:                                            ; preds = %decls
  store i8* %0, i8** %1, align 8
  %2 = bitcast i8* %__.context_ptr to %runtime.Context*
  %3 = load i8*, i8** %1, align 8
  call void @llvm.prefetch(i8* %3, i32 0, i32 3, i32 1) #0
  ret void
}

Intrinsic name not mangled correctly for type arguments! Should be: llvm.prefetch.p0i8
void (i8*, i32, i32, i32)* @llvm.prefetch

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

odin run .

package test

import "core:sys/llvm"
import "core:fmt"

prefetch_address :: #force_inline proc(address: rawptr) {
    llvm.prefetch(address, .Read, .High, .Data)
}
prefetch_offset  :: #force_inline proc(address: rawptr, auto_cast offset: uintptr) {
    ptr := rawptr(uintptr(address) + offset)
    prefetch_address(ptr)
}

prefetch :: proc { prefetch_address, prefetch_offset, }

main :: proc() {
    foozle: u64
    prefetch(&foozle)
    fmt.println("Foozle prefetched.")
}
@github-actions
Copy link

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

@github-actions github-actions bot added stale and removed stale labels Jul 24, 2022
@github-actions github-actions bot added the stale label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant