aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_llvm_build.h
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-03-07 10:53:34 +1100
committerTimothy Arceri <[email protected]>2018-03-08 10:12:34 +1100
commit42627dabb4db3011825a022325be7ae9b51103d6 (patch)
tree6979a6bb5e08e581d9ca58b67d81a93fa319a9e7 /src/amd/common/ac_llvm_build.h
parentffbf75cde4c5875a6581c997ed5fd57ae8059c9c (diff)
ac: add if/loop build helpers
These have been ported over from radeonsi. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_build.h')
-rw-r--r--src/amd/common/ac_llvm_build.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h
index 4eee9b32e9a..c080381d21c 100644
--- a/src/amd/common/ac_llvm_build.h
+++ b/src/amd/common/ac_llvm_build.h
@@ -43,6 +43,8 @@ enum {
AC_CONST_32BIT_ADDR_SPACE = 6, /* same as CONST, but the pointer type has 32 bits */
};
+struct ac_llvm_flow;
+
struct ac_llvm_context {
LLVMContextRef context;
LLVMModuleRef module;
@@ -77,6 +79,10 @@ struct ac_llvm_context {
LLVMValueRef i1true;
LLVMValueRef i1false;
+ struct ac_llvm_flow *flow;
+ unsigned flow_depth;
+ unsigned flow_depth_max;
+
unsigned range_md_kind;
unsigned invariant_load_md_kind;
unsigned uniform_md_kind;
@@ -94,6 +100,9 @@ void
ac_llvm_context_init(struct ac_llvm_context *ctx, LLVMContextRef context,
enum chip_class chip_class, enum radeon_family family);
+void
+ac_llvm_context_dispose(struct ac_llvm_context *ctx);
+
int
ac_get_llvm_num_components(LLVMValueRef value);
@@ -370,6 +379,17 @@ LLVMValueRef ac_find_lsb(struct ac_llvm_context *ctx,
LLVMTypeRef ac_array_in_const_addr_space(LLVMTypeRef elem_type);
LLVMTypeRef ac_array_in_const32_addr_space(LLVMTypeRef elem_type);
+void ac_build_bgnloop(struct ac_llvm_context *ctx, int lable_id);
+void ac_build_break(struct ac_llvm_context *ctx);
+void ac_build_continue(struct ac_llvm_context *ctx);
+void ac_build_else(struct ac_llvm_context *ctx, int lable_id);
+void ac_build_endif(struct ac_llvm_context *ctx, int lable_id);
+void ac_build_endloop(struct ac_llvm_context *ctx, int lable_id);
+void ac_build_if(struct ac_llvm_context *ctx, LLVMValueRef value,
+ int lable_id);
+void ac_build_uif(struct ac_llvm_context *ctx, LLVMValueRef value,
+ int lable_id);
+
#ifdef __cplusplus
}
#endif