2 * Copyright 2016 Bas Nieuwenhuizen
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
15 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
16 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
17 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18 * USE OR OTHER DEALINGS IN THE SOFTWARE.
20 * The above copyright notice and this permission notice (including the
21 * next paragraph) shall be included in all copies or substantial portions
25 #ifndef AC_LLVM_BUILD_H
26 #define AC_LLVM_BUILD_H
29 #include <llvm-c/Core.h>
30 #include "compiler/nir/nir.h"
31 #include "amd_family.h"
38 AC_ADDR_SPACE_FLAT
= 0, /* Slower than global. */
39 AC_ADDR_SPACE_GLOBAL
= 1,
40 AC_ADDR_SPACE_GDS
= 2,
41 AC_ADDR_SPACE_LDS
= 3,
42 AC_ADDR_SPACE_CONST
= 4, /* Global allowing SMEM. */
43 AC_ADDR_SPACE_CONST_32BIT
= 6, /* same as CONST, but the pointer type has 32 bits */
46 #define AC_WAIT_LGKM (1 << 0) /* LDS, GDS, constant, message */
47 #define AC_WAIT_VLOAD (1 << 1) /* VMEM load/sample instructions */
48 #define AC_WAIT_VSTORE (1 << 2) /* VMEM store instructions */
52 struct ac_llvm_context
{
53 LLVMContextRef context
;
55 LLVMBuilderRef builder
;
93 struct ac_llvm_flow
*flow
;
95 unsigned flow_depth_max
;
97 unsigned range_md_kind
;
98 unsigned invariant_load_md_kind
;
99 unsigned uniform_md_kind
;
100 unsigned fpmath_md_kind
;
101 LLVMValueRef fpmath_md_2p5_ulp
;
102 LLVMValueRef empty_md
;
104 enum chip_class chip_class
;
105 enum radeon_family family
;
111 ac_llvm_context_init(struct ac_llvm_context
*ctx
,
112 enum chip_class chip_class
, enum radeon_family family
);
115 ac_llvm_context_dispose(struct ac_llvm_context
*ctx
);
118 ac_get_llvm_num_components(LLVMValueRef value
);
121 ac_get_elem_bits(struct ac_llvm_context
*ctx
, LLVMTypeRef type
);
124 ac_llvm_extract_elem(struct ac_llvm_context
*ac
,
128 unsigned ac_get_type_size(LLVMTypeRef type
);
130 LLVMTypeRef
ac_to_integer_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
131 LLVMValueRef
ac_to_integer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
132 LLVMValueRef
ac_to_integer_or_pointer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
133 LLVMTypeRef
ac_to_float_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
134 LLVMValueRef
ac_to_float(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
137 ac_build_intrinsic(struct ac_llvm_context
*ctx
, const char *name
,
138 LLVMTypeRef return_type
, LLVMValueRef
*params
,
139 unsigned param_count
, unsigned attrib_mask
);
141 void ac_build_type_name_for_intr(LLVMTypeRef type
, char *buf
, unsigned bufsize
);
144 ac_build_phi(struct ac_llvm_context
*ctx
, LLVMTypeRef type
,
145 unsigned count_incoming
, LLVMValueRef
*values
,
146 LLVMBasicBlockRef
*blocks
);
148 void ac_build_s_barrier(struct ac_llvm_context
*ctx
);
149 void ac_build_optimization_barrier(struct ac_llvm_context
*ctx
,
150 LLVMValueRef
*pvgpr
);
152 LLVMValueRef
ac_build_shader_clock(struct ac_llvm_context
*ctx
);
154 LLVMValueRef
ac_build_ballot(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
155 LLVMValueRef
ac_get_i1_sgpr_mask(struct ac_llvm_context
*ctx
,
158 LLVMValueRef
ac_build_vote_all(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
160 LLVMValueRef
ac_build_vote_any(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
162 LLVMValueRef
ac_build_vote_eq(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
165 ac_build_varying_gather_values(struct ac_llvm_context
*ctx
, LLVMValueRef
*values
,
166 unsigned value_count
, unsigned component
);
169 ac_build_gather_values_extended(struct ac_llvm_context
*ctx
,
170 LLVMValueRef
*values
,
171 unsigned value_count
,
172 unsigned value_stride
,
176 ac_build_gather_values(struct ac_llvm_context
*ctx
,
177 LLVMValueRef
*values
,
178 unsigned value_count
);
179 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
181 unsigned num_channels
);
182 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
185 ac_build_fdiv(struct ac_llvm_context
*ctx
,
189 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
191 LLVMValueRef multiplier
,
192 LLVMValueRef pre_shift
,
193 LLVMValueRef post_shift
,
194 LLVMValueRef increment
);
195 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
197 LLVMValueRef multiplier
,
198 LLVMValueRef pre_shift
,
199 LLVMValueRef post_shift
,
200 LLVMValueRef increment
);
201 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
203 LLVMValueRef multiplier
,
204 LLVMValueRef post_shift
);
207 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
208 bool is_deriv
, bool is_array
, bool is_lod
,
209 LLVMValueRef
*coords_arg
,
210 LLVMValueRef
*derivs_arg
);
214 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
215 LLVMValueRef llvm_chan
,
216 LLVMValueRef attr_number
,
222 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
223 LLVMValueRef llvm_chan
,
224 LLVMValueRef attr_number
,
230 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
231 LLVMValueRef parameter
,
232 LLVMValueRef llvm_chan
,
233 LLVMValueRef attr_number
,
234 LLVMValueRef params
);
237 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
238 LLVMValueRef base_ptr
,
242 ac_build_gep0(struct ac_llvm_context
*ctx
,
243 LLVMValueRef base_ptr
,
245 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
249 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
250 LLVMValueRef base_ptr
, LLVMValueRef index
,
253 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
255 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
256 LLVMValueRef base_ptr
, LLVMValueRef index
);
257 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
258 LLVMValueRef base_ptr
, LLVMValueRef index
);
259 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
260 LLVMValueRef base_ptr
, LLVMValueRef index
);
263 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
266 unsigned num_channels
,
267 LLVMValueRef voffset
,
268 LLVMValueRef soffset
,
269 unsigned inst_offset
,
270 unsigned cache_policy
,
271 bool swizzle_enable_hint
);
274 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
278 LLVMValueRef voffset
,
279 unsigned num_channels
,
280 unsigned cache_policy
);
283 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
287 LLVMValueRef voffset
,
288 LLVMValueRef soffset
,
289 unsigned inst_offset
,
290 unsigned cache_policy
,
294 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
297 LLVMValueRef voffset
,
298 unsigned num_channels
,
299 unsigned cache_policy
,
302 /* load_format that handles the stride & element count better if idxen is
303 * disabled by LLVM. */
304 LLVMValueRef
ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context
*ctx
,
307 LLVMValueRef voffset
,
308 unsigned num_channels
,
309 unsigned cache_policy
,
313 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
315 LLVMValueRef voffset
,
316 LLVMValueRef soffset
,
317 LLVMValueRef immoffset
,
318 unsigned cache_policy
);
321 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
323 LLVMValueRef voffset
,
324 LLVMValueRef soffset
,
325 LLVMValueRef immoffset
,
326 unsigned cache_policy
);
329 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
332 LLVMValueRef voffset
,
333 LLVMValueRef soffset
,
334 LLVMValueRef immoffset
,
335 unsigned num_channels
,
338 unsigned cache_policy
,
342 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
344 LLVMValueRef voffset
,
345 LLVMValueRef soffset
,
346 LLVMValueRef immoffset
,
347 unsigned num_channels
,
350 unsigned cache_policy
,
353 /* For ac_build_fetch_format.
355 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
358 AC_FETCH_FORMAT_FLOAT
= 0,
359 AC_FETCH_FORMAT_FIXED
,
360 AC_FETCH_FORMAT_UNORM
,
361 AC_FETCH_FORMAT_SNORM
,
362 AC_FETCH_FORMAT_USCALED
,
363 AC_FETCH_FORMAT_SSCALED
,
364 AC_FETCH_FORMAT_UINT
,
365 AC_FETCH_FORMAT_SINT
,
369 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
371 unsigned num_channels
,
377 LLVMValueRef voffset
,
378 LLVMValueRef soffset
,
379 unsigned cache_policy
,
383 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
386 LLVMValueRef voffset
,
387 LLVMValueRef soffset
,
388 unsigned cache_policy
);
391 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
394 LLVMValueRef voffset
,
395 LLVMValueRef soffset
,
396 unsigned cache_policy
);
399 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
403 LLVMValueRef voffset
,
404 LLVMValueRef soffset
,
405 LLVMValueRef immoffset
,
406 unsigned num_channels
,
409 unsigned cache_policy
);
412 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
415 LLVMValueRef voffset
,
416 LLVMValueRef soffset
,
417 LLVMValueRef immoffset
,
418 unsigned num_channels
,
421 unsigned cache_policy
);
424 ac_get_thread_id(struct ac_llvm_context
*ctx
);
426 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
427 #define AC_TID_MASK_TOP 0xfffffffd
428 #define AC_TID_MASK_LEFT 0xfffffffe
431 ac_build_ddxy(struct ac_llvm_context
*ctx
,
436 #define AC_SENDMSG_GS 2
437 #define AC_SENDMSG_GS_DONE 3
438 #define AC_SENDMSG_GS_ALLOC_REQ 9
440 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
441 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
442 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
443 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
445 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
447 LLVMValueRef wave_id
);
449 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
451 LLVMTypeRef dst_type
);
453 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
455 LLVMTypeRef dst_type
);
456 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
458 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
460 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
462 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
464 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
465 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
466 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
468 struct ac_export_args
{
471 unsigned enabled_channels
;
477 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
479 void ac_build_export_null(struct ac_llvm_context
*ctx
);
481 enum ac_image_opcode
{
489 ac_image_get_resinfo
,
491 ac_image_atomic_cmpswap
,
511 ac_image_cube
, // includes cube arrays
515 ac_image_2darraymsaa
,
518 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
519 enum ac_image_cache_policy
{
520 ac_glc
= 1 << 0, /* per-CU cache control */
521 ac_slc
= 1 << 1, /* global L2 cache control */
522 ac_dlc
= 1 << 2, /* per-shader-array cache control */
525 struct ac_image_args
{
526 enum ac_image_opcode opcode
: 4;
527 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
528 enum ac_image_dim dim
: 3;
530 unsigned cache_policy
: 3;
533 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
535 LLVMValueRef resource
;
536 LLVMValueRef sampler
;
537 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
540 LLVMValueRef compare
;
541 LLVMValueRef derivs
[6];
542 LLVMValueRef coords
[4];
543 LLVMValueRef lod
; // also used by ac_image_get_resinfo
546 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
547 struct ac_image_args
*a
);
548 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
549 LLVMValueRef args
[2]);
550 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
551 LLVMValueRef args
[2]);
552 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
553 LLVMValueRef args
[2]);
554 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
555 LLVMValueRef args
[2], unsigned bits
, bool hi
);
556 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
557 LLVMValueRef args
[2], unsigned bits
, bool hi
);
558 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
559 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
560 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
561 LLVMValueRef offset
, LLVMValueRef width
,
563 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
564 LLVMValueRef s1
, LLVMValueRef s2
);
565 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
566 LLVMValueRef s1
, LLVMValueRef s2
);
568 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned wait_flags
);
570 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
573 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
574 LLVMValueRef src1
, LLVMValueRef src2
,
577 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
580 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
583 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
585 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
588 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
589 LLVMValueRef main_fn
,
590 uint8_t *vs_output_param_offset
,
591 uint32_t num_outputs
,
592 uint8_t *num_param_exports
);
593 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
595 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
596 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
597 LLVMValueRef dw_addr
);
598 void ac_lds_store(struct ac_llvm_context
*ctx
,
599 LLVMValueRef dw_addr
, LLVMValueRef value
);
601 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
602 LLVMTypeRef dst_type
,
605 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
606 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
608 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
609 void ac_build_break(struct ac_llvm_context
*ctx
);
610 void ac_build_continue(struct ac_llvm_context
*ctx
);
611 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
612 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
613 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
614 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
615 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
617 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
620 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
622 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
625 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
628 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
631 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
632 unsigned rshift
, unsigned bitwidth
);
634 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
635 LLVMValueRef
*addr
, bool is_array_tex
);
638 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
641 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
644 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
647 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
650 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
653 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
656 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
659 * Common arguments for a scan/reduce operation that accumulates per-wave
660 * values across an entire workgroup, while respecting the order of waves.
664 bool enable_exclusive
;
665 bool enable_inclusive
;
667 LLVMValueRef src
; /* clobbered! */
668 LLVMValueRef result_reduce
;
669 LLVMValueRef result_exclusive
;
670 LLVMValueRef result_inclusive
;
672 LLVMValueRef waveidx
;
673 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
675 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
676 LLVMValueRef scratch
;
681 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
683 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
685 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
688 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
690 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
692 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
695 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
696 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
699 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
702 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
706 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
710 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
713 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
715 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
716 LLVMValueRef
*args
, unsigned num_args
);
718 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
719 LLVMValueRef ptr
, LLVMValueRef val
,
720 const char *sync_scope
);
722 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
723 LLVMValueRef cmp
, LLVMValueRef val
,
724 const char *sync_scope
);