Patch to fix building the linux-llvm target of gallium3d.
There are essentially two groups of fixes here: one is fixing the
includes to match a recent header reorganization, and the other is
making it build against trunk LLVM, where a change to function
attributes happened recently.
Considering that it appears to have been broken for a while, is this
target not under active development? Is the person/people working on
it busy with other things? Or is the most recent version just not
uploaded to current git?
The reason I was looking at this is that I was kind of curious to see
what sort of code LLVM was generating, and whether there were any
interesting optimizations that LLVM was missing. I haven't looked at
it very closely yet, though.
-Eli
diff --git a/src/mesa/pipe/draw/draw_vertex_shader_llvm.c
b/src/mesa/pipe/draw/draw_vertex_shader_llvm.c
index 53a1776..ab175a6 100644
--- a/src/mesa/pipe/draw/draw_vertex_shader_llvm.c
+++ b/src/mesa/pipe/draw/draw_vertex_shader_llvm.c
@@ -38,7 +38,6 @@
#ifdef MESA_LLVM
#include "pipe/llvm/gallivm.h"
-#include "pipe/tgsi/exec/tgsi_core.h"
#define DBG 0
diff --git a/src/mesa/pipe/llvm/gallivm.cpp b/src/mesa/pipe/llvm/gallivm.cpp
index bd8bfac..e99e7c8 100644
--- a/src/mesa/pipe/llvm/gallivm.cpp
+++ b/src/mesa/pipe/llvm/gallivm.cpp
@@ -36,13 +36,12 @@
#include "instructions.h"
#include "storage.h"
-#include "pipe/p_context.h"
+#include "pipe/p_shader_tokens.h"
+#include "pipe/tgsi/util/tgsi_parse.h"
#include "pipe/tgsi/exec/tgsi_exec.h"
-#include "pipe/tgsi/exec/tgsi_token.h"
-#include "pipe/tgsi/exec/tgsi_build.h"
-#include "pipe/tgsi/exec/tgsi_util.h"
-#include "pipe/tgsi/exec/tgsi_parse.h"
-#include "pipe/tgsi/exec/tgsi_dump.h"
+#include "pipe/tgsi/util/tgsi_dump.h"
+#include "pipe/tgsi/util/tgsi_build.h"
+#include "pipe/tgsi/util/tgsi_util.h"
#include <llvm/Module.h>
#include <llvm/CallingConv.h>
@@ -466,8 +465,6 @@ translate_instruction(llvm::Module *module,
break;
case TGSI_OPCODE_TXD:
break;
- case TGSI_OPCODE_TXP:
- break;
case TGSI_OPCODE_UP2H:
break;
case TGSI_OPCODE_UP2US:
diff --git a/src/mesa/pipe/llvm/gallivm_builtins.cpp
b/src/mesa/pipe/llvm/gallivm_builtins.cpp
index da1e6ae..d0c69d5 100644
--- a/src/mesa/pipe/llvm/gallivm_builtins.cpp
+++ b/src/mesa/pipe/llvm/gallivm_builtins.cpp
@@ -13,12 +13,10 @@ PointerType* PointerTy_1 = PointerType::get(ArrayTy_0);
std::vector<const Type*>FuncTy_2_args;
FuncTy_2_args.push_back(Type::FloatTy);
FuncTy_2_args.push_back(Type::FloatTy);
-ParamAttrsList *FuncTy_2_PAL = 0;
FunctionType* FuncTy_2 = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/FuncTy_2_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_2_PAL);
+ /*isVarArg=*/false);
PointerType* PointerTy_3 = PointerType::get(FuncTy_2);
@@ -26,33 +24,27 @@ VectorType* VectorTy_4 = VectorType::get(Type::FloatTy, 4);
std::vector<const Type*>FuncTy_5_args;
FuncTy_5_args.push_back(VectorTy_4);
-ParamAttrsList *FuncTy_5_PAL = 0;
FunctionType* FuncTy_5 = FunctionType::get(
/*Result=*/VectorTy_4,
/*Params=*/FuncTy_5_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_5_PAL);
+ /*isVarArg=*/false);
std::vector<const Type*>FuncTy_6_args;
FuncTy_6_args.push_back(VectorTy_4);
FuncTy_6_args.push_back(VectorTy_4);
FuncTy_6_args.push_back(VectorTy_4);
-ParamAttrsList *FuncTy_6_PAL = 0;
FunctionType* FuncTy_6 = FunctionType::get(
/*Result=*/VectorTy_4,
/*Params=*/FuncTy_6_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_6_PAL);
+ /*isVarArg=*/false);
VectorType* VectorTy_7 = VectorType::get(IntegerType::get(32), 4);
std::vector<const Type*>FuncTy_9_args;
-ParamAttrsList *FuncTy_9_PAL = 0;
FunctionType* FuncTy_9 = FunctionType::get(
/*Result=*/IntegerType::get(32),
/*Params=*/FuncTy_9_args,
- /*isVarArg=*/true,
- /*ParamAttrs=*/FuncTy_9_PAL);
+ /*isVarArg=*/true);
PointerType* PointerTy_8 = PointerType::get(FuncTy_9);
@@ -60,12 +52,10 @@ PointerType* PointerTy_10 =
PointerType::get(IntegerType::get(8));
std::vector<const Type*>FuncTy_12_args;
FuncTy_12_args.push_back(Type::FloatTy);
-ParamAttrsList *FuncTy_12_PAL = 0;
FunctionType* FuncTy_12 = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/FuncTy_12_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_12_PAL);
+ /*isVarArg=*/false);
PointerType* PointerTy_11 = PointerType::get(FuncTy_12);
diff --git a/src/mesa/pipe/llvm/instructions.cpp
b/src/mesa/pipe/llvm/instructions.cpp
index 232dd9c..c9ff761 100644
--- a/src/mesa/pipe/llvm/instructions.cpp
+++ b/src/mesa/pipe/llvm/instructions.cpp
@@ -123,12 +123,10 @@ llvm::Value *Instructions::callFSqrt(llvm::Value *val)
// predeclare the intrinsic
std::vector<const Type*> fsqrtArgs;
fsqrtArgs.push_back(Type::FloatTy);
- ParamAttrsList *fsqrtPal = 0;
FunctionType* fsqrtType = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/fsqrtArgs,
- /*isVarArg=*/false,
- /*ParamAttrs=*/fsqrtPal);
+ /*isVarArg=*/false);
m_llvmFSqrt = new Function(
/*Type=*/fsqrtType,
/*Linkage=*/GlobalValue::ExternalLinkage,
@@ -180,12 +178,10 @@ llvm::Value *Instructions::callFAbs(llvm::Value *val)
// predeclare the intrinsic
std::vector<const Type*> fabsArgs;
fabsArgs.push_back(Type::FloatTy);
- ParamAttrsList *fabsPal = 0;
FunctionType* fabsType = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/fabsArgs,
- /*isVarArg=*/false,
- /*ParamAttrs=*/fabsPal);
+ /*isVarArg=*/false);
m_llvmFAbs = new Function(
/*Type=*/fabsType,
/*Linkage=*/GlobalValue::ExternalLinkage,
@@ -223,12 +219,10 @@ llvm::Value * Instructions::callPow(llvm::Value *val1,
llvm::Value *val2)
std::vector<const Type*> powArgs;
powArgs.push_back(Type::FloatTy);
powArgs.push_back(Type::FloatTy);
- ParamAttrsList *powPal = 0;
FunctionType* powType = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/powArgs,
- /*isVarArg=*/false,
- /*ParamAttrs=*/powPal);
+ /*isVarArg=*/false);
m_llvmPow = new Function(
/*Type=*/powType,
/*Linkage=*/GlobalValue::ExternalLinkage,
@@ -322,12 +316,10 @@ llvm::Value * Instructions::callFloor(llvm::Value *val)
// predeclare the intrinsic
std::vector<const Type*> floorArgs;
floorArgs.push_back(Type::FloatTy);
- ParamAttrsList *floorPal = 0;
FunctionType* floorType = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/floorArgs,
- /*isVarArg=*/false,
- /*ParamAttrs=*/floorPal);
+ /*isVarArg=*/false);
m_llvmFloor = new Function(
/*Type=*/floorType,
/*Linkage=*/GlobalValue::ExternalLinkage,
@@ -365,12 +357,10 @@ llvm::Value * Instructions::callFLog(llvm::Value *val)
// predeclare the intrinsic
std::vector<const Type*> flogArgs;
flogArgs.push_back(Type::FloatTy);
- ParamAttrsList *flogPal = 0;
FunctionType* flogType = FunctionType::get(
/*Result=*/Type::FloatTy,
/*Params=*/flogArgs,
- /*isVarArg=*/false,
- /*ParamAttrs=*/flogPal);
+ /*isVarArg=*/false);
m_llvmFlog = new Function(
/*Type=*/flogType,
/*Linkage=*/GlobalValue::ExternalLinkage,
@@ -493,12 +483,10 @@ void Instructions::printVector(llvm::Value *val)
llvm::Function * Instructions::declarePrintf()
{
std::vector<const Type*> args;
- ParamAttrsList *params = 0;
FunctionType* funcTy = FunctionType::get(
/*Result=*/IntegerType::get(32),
/*Params=*/args,
- /*isVarArg=*/true,
- /*ParamAttrs=*/params);
+ /*isVarArg=*/true);
Function* func_printf = new Function(
/*Type=*/funcTy,
/*Linkage=*/GlobalValue::ExternalLinkage,
@@ -753,12 +741,10 @@ llvm::Function * Instructions::declareFunc(int label)
args.push_back(vecPtr);
args.push_back(vecPtr);
args.push_back(vecPtr);
- ParamAttrsList *params = 0;
FunctionType *funcType = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/params);
+ /*isVarArg=*/false);
std::string name = createFuncName(label);
Function *func = new Function(
/*Type=*/funcType,
diff --git a/src/mesa/pipe/llvm/llvm_base_shader.cpp
b/src/mesa/pipe/llvm/llvm_base_shader.cpp
index f141ea2..f686bf2 100644
--- a/src/mesa/pipe/llvm/llvm_base_shader.cpp
+++ b/src/mesa/pipe/llvm/llvm_base_shader.cpp
@@ -38,12 +38,10 @@ Module* createBaseShader() {
PointerType* PointerTy_6 = PointerType::get(ArrayTy_7);
FuncTy_3_args.push_back(PointerTy_6);
- ParamAttrsList *FuncTy_3_PAL = 0;
FunctionType* FuncTy_3 = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/FuncTy_3_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_3_PAL);
+ /*isVarArg=*/false);
PointerType* PointerTy_2 = PointerType::get(FuncTy_3);
@@ -75,12 +73,10 @@ Module* createBaseShader() {
FuncTy_10_args.push_back(PointerTy_14);
FuncTy_10_args.push_back(IntegerType::get(32));
FuncTy_10_args.push_back(IntegerType::get(32));
- ParamAttrsList *FuncTy_10_PAL = 0;
FunctionType* FuncTy_10 = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/FuncTy_10_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_10_PAL);
+ /*isVarArg=*/false);
PointerType* PointerTy_16 = PointerType::get(VectorTy_13);
@@ -88,23 +84,19 @@ Module* createBaseShader() {
FuncTy_17_args.push_back(PointerTy_16);
FuncTy_17_args.push_back(PointerTy_6);
FuncTy_17_args.push_back(IntegerType::get(32));
- ParamAttrsList *FuncTy_17_PAL = 0;
FunctionType* FuncTy_17 = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/FuncTy_17_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_17_PAL);
+ /*isVarArg=*/false);
std::vector<const Type*>FuncTy_18_args;
FuncTy_18_args.push_back(PointerTy_6);
FuncTy_18_args.push_back(PointerTy_16);
FuncTy_18_args.push_back(IntegerType::get(32));
- ParamAttrsList *FuncTy_18_PAL = 0;
FunctionType* FuncTy_18 = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/FuncTy_18_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_18_PAL);
+ /*isVarArg=*/false);
std::vector<const Type*>FuncTy_19_args;
FuncTy_19_args.push_back(PointerTy_14);
@@ -114,12 +106,10 @@ Module* createBaseShader() {
FuncTy_19_args.push_back(IntegerType::get(32));
FuncTy_19_args.push_back(IntegerType::get(32));
FuncTy_19_args.push_back(IntegerType::get(32));
- ParamAttrsList *FuncTy_19_PAL = 0;
FunctionType* FuncTy_19 = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/FuncTy_19_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_19_PAL);
+ /*isVarArg=*/false);
ArrayType* ArrayTy_21 = ArrayType::get(ArrayTy_12, 2048);
@@ -138,12 +128,11 @@ Module* createBaseShader() {
FuncTy_27_args.push_back(PointerTy_16);
FuncTy_27_args.push_back(PointerTy_16);
FuncTy_27_args.push_back(PointerTy_16);
- ParamAttrsList *FuncTy_27_PAL = 0;
FunctionType* FuncTy_27 = FunctionType::get(
/*Result=*/Type::VoidTy,
/*Params=*/FuncTy_27_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_27_PAL);
+ /*isVarArg=*/false);
+
PointerType* PointerTy_26 = PointerType::get(FuncTy_27);
@@ -159,12 +148,10 @@ Module* createBaseShader() {
PointerType* PointerTy_29 = PointerType::get(IntegerType::get(32));
FuncTy_28_args.push_back(PointerTy_29);
- ParamAttrsList *FuncTy_28_PAL = 0;
FunctionType* FuncTy_28 = FunctionType::get(
/*Result=*/IntegerType::get(32),
/*Params=*/FuncTy_28_args,
- /*isVarArg=*/false,
- /*ParamAttrs=*/FuncTy_28_PAL);
+ /*isVarArg=*/false);
ArrayType* ArrayTy_31 = ArrayType::get(ArrayTy_12, 4);
diff --git a/src/mesa/pipe/llvm/storage.cpp b/src/mesa/pipe/llvm/storage.cpp
index 1715bd4..016e2a9 100644
--- a/src/mesa/pipe/llvm/storage.cpp
+++ b/src/mesa/pipe/llvm/storage.cpp
@@ -33,7 +33,7 @@
#include "storage.h"
-#include "pipe/tgsi/exec/tgsi_token.h"
+#include "pipe/p_shader_tokens.h"
#include <llvm/BasicBlock.h>
#include <llvm/Module.h>
#include <llvm/Value.h>
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev