On 19 May 2017 at 13:11, Chuck Atkins <chuck.atk...@kitware.com> wrote: > Would it be feasible for packaging purposes to generate multiple headers, > i.e. gen_builder._llvm38.hpp, gen_builder_llvm39.hpp, > gen_builder_llvm40.hpp, etc. and then have gen_builder.hpp be a stub that > just has something like: > > #include <llvm.h> > #if llvm_version >= 4.0 > #include "gen_builder_llvm40.hpp" > #elif llvm_version >= 3.9 > #include "gen_builder_llvm39.hpp" > #elif llvm_version >= 3.8 > #include "gen_builder_llvm38.hpp" > #else > #error llvm version >= 3.8 is required > #elif > Idea sounds ok, but has a few drawbacks: - creating all the files at the same time would be quite picky/hard - shipping only one file solves the issue only for some people
The original idea by Tim sounds OK imho and I'm actually giving it a try. FWIW the diff between 3.9 and 4.0 seems quite trivial - see below. It should be possible to update the python scripts to handle most/all of those. Perhaps we can have this as a long term solution? -Emil @@ -86,6 +86,11 @@ return IRB()->CreateLifetimeEnd(Ptr, Size); } +CallInst* INVARIANT_START(Value *Ptr, ConstantInt *Size = nullptr) +{ + return IRB()->CreateInvariantStart(Ptr, Size); +} + CallInst* MASKED_LOAD(Value *Ptr, unsigned Align, Value *Mask, Value *PassThru = nullptr, const Twine &Name = "") { return IRB()->CreateMaskedLoad(Ptr, Align, Mask, PassThru, Name); @@ -176,6 +181,11 @@ return IRB()->CreateCondBr(Cond, True, False, BranchWeights, Unpredictable); } +BranchInst* COND_BR(Value *Cond, BasicBlock *True, BasicBlock *False, Instruction *MDSrc) +{ + return IRB()->CreateCondBr(Cond, True, False, MDSrc); +} + SwitchInst* SWITCH(Value *V, BasicBlock *Dest, unsigned NumCases = 10, MDNode *BranchWeights = nullptr, MDNode *Unpredictable = nullptr) { return IRB()->CreateSwitch(V, Dest, NumCases, BranchWeights, Unpredictable); @@ -866,7 +876,7 @@ return IRB()->CreateCall(Callee, Args, Name, FPMathTag); } -CallInst* CALLA(llvm::FunctionType *FTy, Value *Callee, ArrayRef<Value *> Args, const Twine &Name = "", MDNode *FPMathTag = nullptr) +CallInst* CALLA(FunctionType *FTy, Value *Callee, ArrayRef<Value *> Args, const Twine &Name = "", MDNode *FPMathTag = nullptr) { return IRB()->CreateCall(FTy, Callee, Args, Name, FPMathTag); } _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev