Skip to content

Conversation

@bmanga
Copy link
Contributor

@bmanga bmanga commented May 14, 2024

Closes #1350

Copy link
Collaborator

@rjodinchr rjodinchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered moving ReplaceLLVMIntrinsicsPass earlier in the flow (before first LowerAddrSpaceCastPass) to get rid of those memcpy?
It might not be possible if memcpy gets generated by other passes (instcombine?).

; RUN: clspv-opt %s -o %t.ll --passes=lower-addrspacecast
; RUN: FileCheck %s < %t.ll

; CHECK: declare void @_Z21llvm.memcpy.p0.p4.i32PPU3AS1memcpy.p0.p4.i32(ptr noalias nocapture writeonly, ptr addrspace(1) noalias nocapture readonly, i32, i1) #0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is clspv really able to deal with such a function to emit anything valid?
Maybe because it contains llvm.memcpy it works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the replace intrinsics pass seems prepared for this, as it looks at the function name containing "llvm.memcpy".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addrspace cast lowering pass creates invalid IR for intrinsic calls

3 participants