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 /* Combine these with & instead of |. */
47 #define NOOP_WAITCNT 0xcf7f
48 #define LGKM_CNT 0xc07f
49 #define EXP_CNT 0xcf0f
50 #define VM_CNT 0x0f70 /* On GFX9, vmcnt has 6 bits in [0:3] and [14:15] */
54 struct ac_llvm_context
{
55 LLVMContextRef context
;
57 LLVMBuilderRef builder
;
95 struct ac_llvm_flow
*flow
;
97 unsigned flow_depth_max
;
99 unsigned range_md_kind
;
100 unsigned invariant_load_md_kind
;
101 unsigned uniform_md_kind
;
102 unsigned fpmath_md_kind
;
103 LLVMValueRef fpmath_md_2p5_ulp
;
104 LLVMValueRef empty_md
;
106 enum chip_class chip_class
;
107 enum radeon_family family
;
113 ac_llvm_context_init(struct ac_llvm_context
*ctx
,
114 enum chip_class chip_class
, enum radeon_family family
);
117 ac_llvm_context_dispose(struct ac_llvm_context
*ctx
);
120 ac_get_llvm_num_components(LLVMValueRef value
);
123 ac_get_elem_bits(struct ac_llvm_context
*ctx
, LLVMTypeRef type
);
126 ac_llvm_extract_elem(struct ac_llvm_context
*ac
,
130 unsigned ac_get_type_size(LLVMTypeRef type
);
132 LLVMTypeRef
ac_to_integer_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
133 LLVMValueRef
ac_to_integer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
134 LLVMValueRef
ac_to_integer_or_pointer(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
135 LLVMTypeRef
ac_to_float_type(struct ac_llvm_context
*ctx
, LLVMTypeRef t
);
136 LLVMValueRef
ac_to_float(struct ac_llvm_context
*ctx
, LLVMValueRef v
);
139 ac_build_intrinsic(struct ac_llvm_context
*ctx
, const char *name
,
140 LLVMTypeRef return_type
, LLVMValueRef
*params
,
141 unsigned param_count
, unsigned attrib_mask
);
143 void ac_build_type_name_for_intr(LLVMTypeRef type
, char *buf
, unsigned bufsize
);
146 ac_build_phi(struct ac_llvm_context
*ctx
, LLVMTypeRef type
,
147 unsigned count_incoming
, LLVMValueRef
*values
,
148 LLVMBasicBlockRef
*blocks
);
150 void ac_build_s_barrier(struct ac_llvm_context
*ctx
);
151 void ac_build_optimization_barrier(struct ac_llvm_context
*ctx
,
152 LLVMValueRef
*pvgpr
);
154 LLVMValueRef
ac_build_shader_clock(struct ac_llvm_context
*ctx
);
156 LLVMValueRef
ac_build_ballot(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
157 LLVMValueRef
ac_get_i1_sgpr_mask(struct ac_llvm_context
*ctx
,
160 LLVMValueRef
ac_build_vote_all(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
162 LLVMValueRef
ac_build_vote_any(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
164 LLVMValueRef
ac_build_vote_eq(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
167 ac_build_varying_gather_values(struct ac_llvm_context
*ctx
, LLVMValueRef
*values
,
168 unsigned value_count
, unsigned component
);
171 ac_build_gather_values_extended(struct ac_llvm_context
*ctx
,
172 LLVMValueRef
*values
,
173 unsigned value_count
,
174 unsigned value_stride
,
178 ac_build_gather_values(struct ac_llvm_context
*ctx
,
179 LLVMValueRef
*values
,
180 unsigned value_count
);
181 LLVMValueRef
ac_build_expand_to_vec4(struct ac_llvm_context
*ctx
,
183 unsigned num_channels
);
184 LLVMValueRef
ac_build_round(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
187 ac_build_fdiv(struct ac_llvm_context
*ctx
,
191 LLVMValueRef
ac_build_fast_udiv(struct ac_llvm_context
*ctx
,
193 LLVMValueRef multiplier
,
194 LLVMValueRef pre_shift
,
195 LLVMValueRef post_shift
,
196 LLVMValueRef increment
);
197 LLVMValueRef
ac_build_fast_udiv_nuw(struct ac_llvm_context
*ctx
,
199 LLVMValueRef multiplier
,
200 LLVMValueRef pre_shift
,
201 LLVMValueRef post_shift
,
202 LLVMValueRef increment
);
203 LLVMValueRef
ac_build_fast_udiv_u31_d_not_one(struct ac_llvm_context
*ctx
,
205 LLVMValueRef multiplier
,
206 LLVMValueRef post_shift
);
209 ac_prepare_cube_coords(struct ac_llvm_context
*ctx
,
210 bool is_deriv
, bool is_array
, bool is_lod
,
211 LLVMValueRef
*coords_arg
,
212 LLVMValueRef
*derivs_arg
);
216 ac_build_fs_interp(struct ac_llvm_context
*ctx
,
217 LLVMValueRef llvm_chan
,
218 LLVMValueRef attr_number
,
224 ac_build_fs_interp_f16(struct ac_llvm_context
*ctx
,
225 LLVMValueRef llvm_chan
,
226 LLVMValueRef attr_number
,
232 ac_build_fs_interp_mov(struct ac_llvm_context
*ctx
,
233 LLVMValueRef parameter
,
234 LLVMValueRef llvm_chan
,
235 LLVMValueRef attr_number
,
236 LLVMValueRef params
);
239 ac_build_gep_ptr(struct ac_llvm_context
*ctx
,
240 LLVMValueRef base_ptr
,
244 ac_build_gep0(struct ac_llvm_context
*ctx
,
245 LLVMValueRef base_ptr
,
247 LLVMValueRef
ac_build_pointer_add(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
251 ac_build_indexed_store(struct ac_llvm_context
*ctx
,
252 LLVMValueRef base_ptr
, LLVMValueRef index
,
255 LLVMValueRef
ac_build_load(struct ac_llvm_context
*ctx
, LLVMValueRef base_ptr
,
257 LLVMValueRef
ac_build_load_invariant(struct ac_llvm_context
*ctx
,
258 LLVMValueRef base_ptr
, LLVMValueRef index
);
259 LLVMValueRef
ac_build_load_to_sgpr(struct ac_llvm_context
*ctx
,
260 LLVMValueRef base_ptr
, LLVMValueRef index
);
261 LLVMValueRef
ac_build_load_to_sgpr_uint_wraparound(struct ac_llvm_context
*ctx
,
262 LLVMValueRef base_ptr
, LLVMValueRef index
);
265 ac_build_buffer_store_dword(struct ac_llvm_context
*ctx
,
268 unsigned num_channels
,
269 LLVMValueRef voffset
,
270 LLVMValueRef soffset
,
271 unsigned inst_offset
,
274 bool swizzle_enable_hint
);
277 ac_build_buffer_store_format(struct ac_llvm_context
*ctx
,
281 LLVMValueRef voffset
,
282 unsigned num_channels
,
287 ac_build_buffer_load(struct ac_llvm_context
*ctx
,
291 LLVMValueRef voffset
,
292 LLVMValueRef soffset
,
293 unsigned inst_offset
,
299 LLVMValueRef
ac_build_buffer_load_format(struct ac_llvm_context
*ctx
,
302 LLVMValueRef voffset
,
303 unsigned num_channels
,
307 /* load_format that handles the stride & element count better if idxen is
308 * disabled by LLVM. */
309 LLVMValueRef
ac_build_buffer_load_format_gfx9_safe(struct ac_llvm_context
*ctx
,
312 LLVMValueRef voffset
,
313 unsigned num_channels
,
318 ac_build_tbuffer_load_short(struct ac_llvm_context
*ctx
,
320 LLVMValueRef voffset
,
321 LLVMValueRef soffset
,
322 LLVMValueRef immoffset
,
326 ac_build_tbuffer_load_byte(struct ac_llvm_context
*ctx
,
328 LLVMValueRef voffset
,
329 LLVMValueRef soffset
,
330 LLVMValueRef immoffset
,
334 ac_build_struct_tbuffer_load(struct ac_llvm_context
*ctx
,
337 LLVMValueRef voffset
,
338 LLVMValueRef soffset
,
339 LLVMValueRef immoffset
,
340 unsigned num_channels
,
348 ac_build_raw_tbuffer_load(struct ac_llvm_context
*ctx
,
350 LLVMValueRef voffset
,
351 LLVMValueRef soffset
,
352 LLVMValueRef immoffset
,
353 unsigned num_channels
,
360 /* For ac_build_fetch_format.
362 * Note: FLOAT must be 0 (used for convenience of encoding in radeonsi).
365 AC_FETCH_FORMAT_FLOAT
= 0,
366 AC_FETCH_FORMAT_FIXED
,
367 AC_FETCH_FORMAT_UNORM
,
368 AC_FETCH_FORMAT_SNORM
,
369 AC_FETCH_FORMAT_USCALED
,
370 AC_FETCH_FORMAT_SSCALED
,
371 AC_FETCH_FORMAT_UINT
,
372 AC_FETCH_FORMAT_SINT
,
376 ac_build_opencoded_load_format(struct ac_llvm_context
*ctx
,
378 unsigned num_channels
,
384 LLVMValueRef voffset
,
385 LLVMValueRef soffset
,
391 ac_build_tbuffer_store_short(struct ac_llvm_context
*ctx
,
394 LLVMValueRef voffset
,
395 LLVMValueRef soffset
,
399 ac_build_tbuffer_store_byte(struct ac_llvm_context
*ctx
,
402 LLVMValueRef voffset
,
403 LLVMValueRef soffset
,
407 ac_build_struct_tbuffer_store(struct ac_llvm_context
*ctx
,
411 LLVMValueRef voffset
,
412 LLVMValueRef soffset
,
413 LLVMValueRef immoffset
,
414 unsigned num_channels
,
421 ac_build_raw_tbuffer_store(struct ac_llvm_context
*ctx
,
424 LLVMValueRef voffset
,
425 LLVMValueRef soffset
,
426 LLVMValueRef immoffset
,
427 unsigned num_channels
,
434 ac_get_thread_id(struct ac_llvm_context
*ctx
);
436 #define AC_TID_MASK_TOP_LEFT 0xfffffffc
437 #define AC_TID_MASK_TOP 0xfffffffd
438 #define AC_TID_MASK_LEFT 0xfffffffe
441 ac_build_ddxy(struct ac_llvm_context
*ctx
,
446 #define AC_SENDMSG_GS 2
447 #define AC_SENDMSG_GS_DONE 3
448 #define AC_SENDMSG_GS_ALLOC_REQ 9
450 #define AC_SENDMSG_GS_OP_NOP (0 << 4)
451 #define AC_SENDMSG_GS_OP_CUT (1 << 4)
452 #define AC_SENDMSG_GS_OP_EMIT (2 << 4)
453 #define AC_SENDMSG_GS_OP_EMIT_CUT (3 << 4)
455 void ac_build_sendmsg(struct ac_llvm_context
*ctx
,
457 LLVMValueRef wave_id
);
459 LLVMValueRef
ac_build_imsb(struct ac_llvm_context
*ctx
,
461 LLVMTypeRef dst_type
);
463 LLVMValueRef
ac_build_umsb(struct ac_llvm_context
*ctx
,
465 LLVMTypeRef dst_type
);
466 LLVMValueRef
ac_build_fmin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
468 LLVMValueRef
ac_build_fmax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
470 LLVMValueRef
ac_build_imin(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
472 LLVMValueRef
ac_build_imax(struct ac_llvm_context
*ctx
, LLVMValueRef a
,
474 LLVMValueRef
ac_build_umin(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
475 LLVMValueRef
ac_build_umax(struct ac_llvm_context
*ctx
, LLVMValueRef a
, LLVMValueRef b
);
476 LLVMValueRef
ac_build_clamp(struct ac_llvm_context
*ctx
, LLVMValueRef value
);
478 struct ac_export_args
{
481 unsigned enabled_channels
;
487 void ac_build_export(struct ac_llvm_context
*ctx
, struct ac_export_args
*a
);
489 void ac_build_export_null(struct ac_llvm_context
*ctx
);
491 enum ac_image_opcode
{
499 ac_image_get_resinfo
,
501 ac_image_atomic_cmpswap
,
521 ac_image_cube
, // includes cube arrays
525 ac_image_2darraymsaa
,
528 /* These cache policy bits match the definitions used by the LLVM intrinsics. */
529 enum ac_image_cache_policy
{
534 struct ac_image_args
{
535 enum ac_image_opcode opcode
: 4;
536 enum ac_atomic_op atomic
: 4; /* for the ac_image_atomic opcode */
537 enum ac_image_dim dim
: 3;
539 unsigned cache_policy
: 2;
542 unsigned attributes
; /* additional call-site specific AC_FUNC_ATTRs */
544 LLVMValueRef resource
;
545 LLVMValueRef sampler
;
546 LLVMValueRef data
[2]; /* data[0] is source data (vector); data[1] is cmp for cmpswap */
549 LLVMValueRef compare
;
550 LLVMValueRef derivs
[6];
551 LLVMValueRef coords
[4];
552 LLVMValueRef lod
; // also used by ac_image_get_resinfo
555 LLVMValueRef
ac_build_image_opcode(struct ac_llvm_context
*ctx
,
556 struct ac_image_args
*a
);
557 LLVMValueRef
ac_build_cvt_pkrtz_f16(struct ac_llvm_context
*ctx
,
558 LLVMValueRef args
[2]);
559 LLVMValueRef
ac_build_cvt_pknorm_i16(struct ac_llvm_context
*ctx
,
560 LLVMValueRef args
[2]);
561 LLVMValueRef
ac_build_cvt_pknorm_u16(struct ac_llvm_context
*ctx
,
562 LLVMValueRef args
[2]);
563 LLVMValueRef
ac_build_cvt_pk_i16(struct ac_llvm_context
*ctx
,
564 LLVMValueRef args
[2], unsigned bits
, bool hi
);
565 LLVMValueRef
ac_build_cvt_pk_u16(struct ac_llvm_context
*ctx
,
566 LLVMValueRef args
[2], unsigned bits
, bool hi
);
567 LLVMValueRef
ac_build_wqm_vote(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
568 void ac_build_kill_if_false(struct ac_llvm_context
*ctx
, LLVMValueRef i1
);
569 LLVMValueRef
ac_build_bfe(struct ac_llvm_context
*ctx
, LLVMValueRef input
,
570 LLVMValueRef offset
, LLVMValueRef width
,
572 LLVMValueRef
ac_build_imad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
573 LLVMValueRef s1
, LLVMValueRef s2
);
574 LLVMValueRef
ac_build_fmad(struct ac_llvm_context
*ctx
, LLVMValueRef s0
,
575 LLVMValueRef s1
, LLVMValueRef s2
);
577 void ac_build_waitcnt(struct ac_llvm_context
*ctx
, unsigned simm16
);
579 LLVMValueRef
ac_build_fract(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
582 LLVMValueRef
ac_build_fmed3(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
583 LLVMValueRef src1
, LLVMValueRef src2
,
586 LLVMValueRef
ac_build_isign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
589 LLVMValueRef
ac_build_fsign(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
592 LLVMValueRef
ac_build_bit_count(struct ac_llvm_context
*ctx
, LLVMValueRef src0
);
594 LLVMValueRef
ac_build_bitfield_reverse(struct ac_llvm_context
*ctx
,
597 void ac_optimize_vs_outputs(struct ac_llvm_context
*ac
,
598 LLVMValueRef main_fn
,
599 uint8_t *vs_output_param_offset
,
600 uint32_t num_outputs
,
601 uint8_t *num_param_exports
);
602 void ac_init_exec_full_mask(struct ac_llvm_context
*ctx
);
604 void ac_declare_lds_as_pointer(struct ac_llvm_context
*ac
);
605 LLVMValueRef
ac_lds_load(struct ac_llvm_context
*ctx
,
606 LLVMValueRef dw_addr
);
607 void ac_lds_store(struct ac_llvm_context
*ctx
,
608 LLVMValueRef dw_addr
, LLVMValueRef value
);
610 LLVMValueRef
ac_find_lsb(struct ac_llvm_context
*ctx
,
611 LLVMTypeRef dst_type
,
614 LLVMTypeRef
ac_array_in_const_addr_space(LLVMTypeRef elem_type
);
615 LLVMTypeRef
ac_array_in_const32_addr_space(LLVMTypeRef elem_type
);
617 void ac_build_bgnloop(struct ac_llvm_context
*ctx
, int lable_id
);
618 void ac_build_break(struct ac_llvm_context
*ctx
);
619 void ac_build_continue(struct ac_llvm_context
*ctx
);
620 void ac_build_else(struct ac_llvm_context
*ctx
, int lable_id
);
621 void ac_build_endif(struct ac_llvm_context
*ctx
, int lable_id
);
622 void ac_build_endloop(struct ac_llvm_context
*ctx
, int lable_id
);
623 void ac_build_ifcc(struct ac_llvm_context
*ctx
, LLVMValueRef cond
, int label_id
);
624 void ac_build_if(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
626 void ac_build_uif(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
629 LLVMValueRef
ac_build_alloca(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
631 LLVMValueRef
ac_build_alloca_undef(struct ac_llvm_context
*ac
, LLVMTypeRef type
,
634 LLVMValueRef
ac_cast_ptr(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
637 LLVMValueRef
ac_trim_vector(struct ac_llvm_context
*ctx
, LLVMValueRef value
,
640 LLVMValueRef
ac_unpack_param(struct ac_llvm_context
*ctx
, LLVMValueRef param
,
641 unsigned rshift
, unsigned bitwidth
);
643 void ac_apply_fmask_to_sample(struct ac_llvm_context
*ac
, LLVMValueRef fmask
,
644 LLVMValueRef
*addr
, bool is_array_tex
);
647 ac_build_ds_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, unsigned mask
);
650 ac_build_readlane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef lane
);
653 ac_build_writelane(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef value
, LLVMValueRef lane
);
656 ac_build_mbcnt(struct ac_llvm_context
*ctx
, LLVMValueRef mask
);
659 ac_build_inclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
662 ac_build_exclusive_scan(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
);
665 ac_build_reduce(struct ac_llvm_context
*ctx
, LLVMValueRef src
, nir_op op
, unsigned cluster_size
);
668 * Common arguments for a scan/reduce operation that accumulates per-wave
669 * values across an entire workgroup, while respecting the order of waves.
673 bool enable_exclusive
;
674 bool enable_inclusive
;
676 LLVMValueRef src
; /* clobbered! */
677 LLVMValueRef result_reduce
;
678 LLVMValueRef result_exclusive
;
679 LLVMValueRef result_inclusive
;
681 LLVMValueRef waveidx
;
682 LLVMValueRef numwaves
; /* only needed for "reduce" operations */
684 /* T addrspace(LDS) pointer to the same type as value, at least maxwaves entries */
685 LLVMValueRef scratch
;
690 ac_build_wg_wavescan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
692 ac_build_wg_wavescan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
694 ac_build_wg_wavescan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
697 ac_build_wg_scan_top(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
699 ac_build_wg_scan_bottom(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
701 ac_build_wg_scan(struct ac_llvm_context
*ctx
, struct ac_wg_scan
*ws
);
704 ac_build_quad_swizzle(struct ac_llvm_context
*ctx
, LLVMValueRef src
,
705 unsigned lane0
, unsigned lane1
, unsigned lane2
, unsigned lane3
);
708 ac_build_shuffle(struct ac_llvm_context
*ctx
, LLVMValueRef src
, LLVMValueRef index
);
711 ac_build_frexp_exp(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
715 ac_build_frexp_mant(struct ac_llvm_context
*ctx
, LLVMValueRef src0
,
719 ac_build_ddxy_interp(struct ac_llvm_context
*ctx
, LLVMValueRef interp_ij
);
722 ac_build_load_helper_invocation(struct ac_llvm_context
*ctx
);
724 LLVMValueRef
ac_build_call(struct ac_llvm_context
*ctx
, LLVMValueRef func
,
725 LLVMValueRef
*args
, unsigned num_args
);
727 LLVMValueRef
ac_build_atomic_rmw(struct ac_llvm_context
*ctx
, LLVMAtomicRMWBinOp op
,
728 LLVMValueRef ptr
, LLVMValueRef val
,
729 const char *sync_scope
);
731 LLVMValueRef
ac_build_atomic_cmp_xchg(struct ac_llvm_context
*ctx
, LLVMValueRef ptr
,
732 LLVMValueRef cmp
, LLVMValueRef val
,
733 const char *sync_scope
);