Commit 687f79d
Fix typed-pointer compat and test failures for kernarg rewrite
On LLVM 16 (Julia ≤1.11) with typed pointers, add_kernarg_address_spaces!
was creating opaque `ptr addrspace(4)` via `LLVM.PointerType(4)`, which
introduced opaque pointers into a typed-pointer module. When
InferAddressSpaces then propagated these through memcpy intrinsics
(which use typed `i8 addrspace(N)*`), LLVM's verifier rejected the
type mismatch.
Fix by following Metal's pattern: use `LLVM.PointerType(eltype, 4)`
on typed-pointer contexts and the original param type as the
addrspacecast target.
Also fix tests: Ptr{Float64} is lowered to i64 on Julia ≤1.11 and
ptr on 1.12+, so use {{(i64|ptr)}} in filecheck and check for
non-byref params instead of non-AS4 pointer params.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7c72b3d commit 687f79d
2 files changed
Lines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
144 | | - | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | | - | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| |||
0 commit comments