summaryrefslogtreecommitdiff
path: root/lib/mesa/src/amd/common/ac_llvm_helper.cpp
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-12-11 08:37:01 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-12-11 08:37:01 +0000
commite4c140c4d4d00c16d99b15ee6677cbd2e3364031 (patch)
tree96364a9f799341ef8dff3d1534f1de0eb3a559b1 /lib/mesa/src/amd/common/ac_llvm_helper.cpp
parent10010c14c68222d4056694bf3643ee969d18cd4f (diff)
Import Mesa 13.0.2
Diffstat (limited to 'lib/mesa/src/amd/common/ac_llvm_helper.cpp')
-rw-r--r--lib/mesa/src/amd/common/ac_llvm_helper.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/lib/mesa/src/amd/common/ac_llvm_helper.cpp b/lib/mesa/src/amd/common/ac_llvm_helper.cpp
index d9ea4b162..062f0aad9 100644
--- a/lib/mesa/src/amd/common/ac_llvm_helper.cpp
+++ b/lib/mesa/src/amd/common/ac_llvm_helper.cpp
@@ -26,34 +26,21 @@
/* based on Marek's patch to lp_bld_misc.cpp */
// Workaround http://llvm.org/PR23628
-#pragma push_macro("DEBUG")
-#undef DEBUG
+#if HAVE_LLVM >= 0x0307
+# pragma push_macro("DEBUG")
+# undef DEBUG
+#endif
-#include "ac_llvm_util.h"
+#include "ac_nir_to_llvm.h"
#include <llvm-c/Core.h>
#include <llvm/Target/TargetOptions.h>
#include <llvm/ExecutionEngine/ExecutionEngine.h>
-#include <llvm/IR/Attributes.h>
-
-#if HAVE_LLVM < 0x0500
-namespace llvm {
-typedef AttributeSet AttributeList;
-}
-#endif
-void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
+extern "C" void
+ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes)
{
llvm::Argument *A = llvm::unwrap<llvm::Argument>(val);
llvm::AttrBuilder B;
B.addDereferenceableAttr(bytes);
- A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1, B));
-}
-
-bool ac_is_sgpr_param(LLVMValueRef arg)
-{
- llvm::Argument *A = llvm::unwrap<llvm::Argument>(arg);
- llvm::AttributeList AS = A->getParent()->getAttributes();
- unsigned ArgNo = A->getArgNo();
- return AS.hasAttribute(ArgNo + 1, llvm::Attribute::ByVal) ||
- AS.hasAttribute(ArgNo + 1, llvm::Attribute::InReg);
+ A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1, B));
}