gallivm: remove workaround for reversing optimization pass order.
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_struct.h
index f8b6dab4bfb22a68d1e02d2dd3bc1ab37010a51b..6b7b4f2a6bf7d6949b0f001da9412fec27025ed0 100644 (file)
@@ -38,7 +38,7 @@
 
 
 #include "gallivm/lp_bld.h"
-#include <llvm-c/Target.h>
+#include "gallivm/lp_bld_init.h"
 
 #include "util/u_debug.h"
 #include "util/u_memory.h"
@@ -57,7 +57,7 @@
  * Get value pointer to a structure member.
  */
 LLVMValueRef
-lp_build_struct_get_ptr(LLVMBuilderRef builder,
+lp_build_struct_get_ptr(struct gallivm_state *gallivm,
                         LLVMValueRef ptr,
                         unsigned member,
                         const char *name);
@@ -66,7 +66,7 @@ lp_build_struct_get_ptr(LLVMBuilderRef builder,
  * Get the value of a structure member.
  */
 LLVMValueRef
-lp_build_struct_get(LLVMBuilderRef builder,
+lp_build_struct_get(struct gallivm_state *gallivm,
                     LLVMValueRef ptr,
                     unsigned member,
                     const char *name);
@@ -75,7 +75,7 @@ lp_build_struct_get(LLVMBuilderRef builder,
  * Get value pointer to an array element.
  */
 LLVMValueRef
-lp_build_array_get_ptr(LLVMBuilderRef builder,
+lp_build_array_get_ptr(struct gallivm_state *gallivm,
                        LLVMValueRef ptr,
                        LLVMValueRef index);
 
@@ -83,7 +83,7 @@ lp_build_array_get_ptr(LLVMBuilderRef builder,
  * Get the value of an array element.
  */
 LLVMValueRef
-lp_build_array_get(LLVMBuilderRef builder,
+lp_build_array_get(struct gallivm_state *gallivm,
                    LLVMValueRef ptr,
                    LLVMValueRef index);
 
@@ -91,9 +91,51 @@ lp_build_array_get(LLVMBuilderRef builder,
  * Set the value of an array element.
  */
 void
-lp_build_array_set(LLVMBuilderRef builder,
+lp_build_array_set(struct gallivm_state *gallivm,
                    LLVMValueRef ptr,
                    LLVMValueRef index,
                    LLVMValueRef value);
 
+/**
+ * Get the value of an array element.
+ */
+LLVMValueRef
+lp_build_pointer_get(LLVMBuilderRef builder,
+                   LLVMValueRef ptr,
+                   LLVMValueRef index);
+
+/**
+ * Get the value of an array element, with explicit alignment.
+ *
+ * If the element size is different from the alignment this will
+ * cause llvm to emit an unaligned load
+ */
+LLVMValueRef
+lp_build_pointer_get_unaligned(LLVMBuilderRef builder,
+                               LLVMValueRef ptr,
+                               LLVMValueRef index,
+                               unsigned alignment);
+
+/**
+ * Set the value of an array element.
+ */
+void
+lp_build_pointer_set(LLVMBuilderRef builder,
+                     LLVMValueRef ptr,
+                     LLVMValueRef index,
+                     LLVMValueRef value);
+
+/**
+ * Set the value of an array element, with explicit alignment.
+ *
+ * If the element size is different from the alignment this will
+ * cause llvm to emit an unaligned store
+ */
+void
+lp_build_pointer_set_unaligned(LLVMBuilderRef builder,
+                               LLVMValueRef ptr,
+                               LLVMValueRef index,
+                               LLVMValueRef value,
+                               unsigned alignment);
+
 #endif /* !LP_BLD_STRUCT_H */