Loading .gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ # External projects /cheetah /cilktools #==============================================================================# # Explicit files to ignore (only matches one). Loading kitsune/cmake/caches/kitsune-dev.cmake +2 −2 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") # you are working on. By default we provide the full suite of # clang+tools, openmp, lld, and a debugger via lldb. set(LLVM_ENABLE_PROJECTS clang;openmp; clang;openmp CACHE STRING "") message(DEBUG " --> KITSUNE-DEV - enabled LLVM projects: ${LLVM_ENABLE_PROJECTS}") Loading Loading @@ -63,7 +63,7 @@ set(CLANG_CONFIG_FILE_USER_DIR "$ENV{HOME}/.kitsune" CACHE STRING "") set(CUDA_HOST_COMPILER "/usr/bin/gcc-8" CACHE STRING "") #endif() set(_runtimes_list "cheetah") set(_runtimes_list "cheetah;cilktools") # Various helpful LLVM-level settings for development/debugging. set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "") # sometimes errors get lost in all the warnings... Loading kitsune/examples/kokkos/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ set(_example_srcs set(_example_view_srcs raytrace.cpp vecadd-views.cpp ) # Build the pure-kokkos serial target version of all the examples first. Loading llvm/include/llvm/Analysis/MemoryBuiltins.h +6 −3 Original line number Diff line number Diff line Loading @@ -170,10 +170,13 @@ inline CallInst *extractCallocCall(Value *I, const TargetLibraryInfo *TLI) { bool isLibFreeFunction(const Function *F, const LibFunc TLIFn); /// isFreeCall - Returns non-null if the value is a call to the builtin free() const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI); const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI, bool IgnoreBuiltinAttr = false); inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) { return const_cast<CallInst*>(isFreeCall((const Value*)I, TLI)); inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI, bool IgnoreBuiltinAttr = false) { return const_cast<CallInst *>( isFreeCall((const Value *)I, TLI, IgnoreBuiltinAttr)); } //===----------------------------------------------------------------------===// Loading llvm/include/llvm/Transforms/Instrumentation/CSI.h +26 −17 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ static const char *const CsiDisableInstrumentationName = using csi_id_t = int64_t; static const csi_id_t CsiUnknownId = -1; static const csi_id_t CsiCallsiteUnknownTargetId = CsiUnknownId; // See llvm/tools/clang/lib/CodeGen/CodeGenModule.h: // See clang/lib/CodeGen/CodeGenModule.h: static const int CsiUnitCtorPriority = 0; /// Maintains a mapping from CSI ID to static data for that ID. Loading Loading @@ -803,6 +803,7 @@ public: IntegerType::get(C, PropBits.IsConstant), IntegerType::get(C, PropBits.IsOnStack), IntegerType::get(C, PropBits.MayBeCaptured), IntegerType::get(C, PropBits.IsAtomic), IntegerType::get(C, PropBits.LoadReadBeforeWriteInBB), IntegerType::get(C, PropBits.Padding))); } Loading Loading @@ -844,6 +845,8 @@ public: void setIsOnStack(bool v) { PropValue.Fields.IsOnStack = v; } /// Set the value of the MayBeCaptured property. void setMayBeCaptured(bool v) { PropValue.Fields.MayBeCaptured = v; } /// Set the value of the IsAtomic property. void setIsAtomic(bool v) { PropValue.Fields.IsAtomic = v; } /// Set the value of the LoadReadBeforeWriteInBB property. void setLoadReadBeforeWriteInBB(bool v) { PropValue.Fields.LoadReadBeforeWriteInBB = v; Loading @@ -858,8 +861,9 @@ private: unsigned IsConstant : 1; unsigned IsOnStack : 1; unsigned MayBeCaptured : 1; unsigned IsAtomic : 1; unsigned LoadReadBeforeWriteInBB : 1; uint64_t Padding : 53; uint64_t Padding : 50; } Fields; uint64_t Bits; } Property; Loading @@ -873,13 +877,14 @@ private: int IsConstant; int IsOnStack; int MayBeCaptured; int IsAtomic; int LoadReadBeforeWriteInBB; int Padding; } PropertyBits; /// The number of bits representing each property. static constexpr PropertyBits PropBits = { 8, 1, 1, 1, 1, 1, (64 - 8 - 1 - 1 - 1 - 1 - 1)}; 8, 1, 1, 1, 1, 1, 1, (64 - 8 - 1 - 1 - 1 - 1 - 1 - 1)}; }; class CsiAllocaProperty : public CsiProperty { Loading Loading @@ -1049,18 +1054,6 @@ public: Options(Options) { loadConfiguration(); } CSIImpl(Module &M, CallGraph *CG, function_ref<DominatorTree &(Function &)> GetDomTree, function_ref<LoopInfo &(Function &)> GetLoopInfo, function_ref<TaskInfo &(Function &)> GetTaskInfo, function_ref<TargetLibraryInfo &(Function &)> GetTLI, function_ref<ScalarEvolution &(Function &)> GetSE, const CSIOptions &Options = CSIOptions()) : M(M), DL(M.getDataLayout()), CG(CG), GetDomTree(GetDomTree), GetLoopInfo(GetLoopInfo), GetTaskInfo(GetTaskInfo), GetTLI(GetTLI), GetScalarEvolution(GetSE), Options(Options) { loadConfiguration(); } virtual ~CSIImpl() {} Loading @@ -1073,7 +1066,7 @@ public: static bool isVtableAccess(Instruction *I); static bool addrPointsToConstantData(Value *Addr); static bool isAtomic(Instruction *I); static void getAllocFnArgs(const Instruction *I, static bool getAllocFnArgs(const Instruction *I, SmallVectorImpl<Value *> &AllocFnArgs, Type *SizeTy, Type *AddrTy, const TargetLibraryInfo &TLI); Loading @@ -1095,6 +1088,9 @@ public: static bool spawnsTapirLoopBody(DetachInst *DI, LoopInfo &LI, TaskInfo &TI); static BasicBlock::iterator getFirstInsertionPtInDetachedBlock(BasicBlock *Detached); protected: /// Initialize the CSI pass. void initializeCsi(); Loading Loading @@ -1239,6 +1235,9 @@ protected: ZnwmSt11align_val_tRKSt9nothrow_t, ZnajSt11align_val_tRKSt9nothrow_t, ZnamSt11align_val_tRKSt9nothrow_t, posix_memalign, strdup, strndup, LAST_ALLOCFNTY }; Loading @@ -1250,8 +1249,8 @@ protected: return AllocFnTy::malloc; case LibFunc_valloc: return AllocFnTy::valloc; // aligned_alloc(align_val_t, size_t) case LibFunc_aligned_alloc: // aligned_alloc(align_val_t, size_t) return AllocFnTy::aligned_alloc; case LibFunc_calloc: return AllocFnTy::calloc; Loading Loading @@ -1331,6 +1330,15 @@ protected: case LibFunc_ZnamSt11align_val_tRKSt9nothrow_t: // new[](unsigned long, align_val_t, nothrow) return AllocFnTy::ZnamSt11align_val_tRKSt9nothrow_t; case LibFunc_posix_memalign: // posix_memalign(void **, size_t, size_t) return AllocFnTy::posix_memalign; case LibFunc_strdup: // strdup(const char *) return AllocFnTy::strdup; case LibFunc_strndup: // strdup(const char *, size_t) return AllocFnTy::strndup; } } Loading Loading @@ -1496,6 +1504,7 @@ protected: DenseMap<std::pair<BasicBlock *, Function *>, SmallVector<PHINode *, 4>> ArgPHIs; SmallPtrSet<SyncInst *, 12> SyncsWithUnwinds; DenseMap<BasicBlock *, CallInst *> callsAfterSync; std::unique_ptr<InstrumentationConfig> Config; Loading Loading
.gitignore +1 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ # External projects /cheetah /cilktools #==============================================================================# # Explicit files to ignore (only matches one). Loading
kitsune/cmake/caches/kitsune-dev.cmake +2 −2 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") # you are working on. By default we provide the full suite of # clang+tools, openmp, lld, and a debugger via lldb. set(LLVM_ENABLE_PROJECTS clang;openmp; clang;openmp CACHE STRING "") message(DEBUG " --> KITSUNE-DEV - enabled LLVM projects: ${LLVM_ENABLE_PROJECTS}") Loading Loading @@ -63,7 +63,7 @@ set(CLANG_CONFIG_FILE_USER_DIR "$ENV{HOME}/.kitsune" CACHE STRING "") set(CUDA_HOST_COMPILER "/usr/bin/gcc-8" CACHE STRING "") #endif() set(_runtimes_list "cheetah") set(_runtimes_list "cheetah;cilktools") # Various helpful LLVM-level settings for development/debugging. set(LLVM_ENABLE_WARNINGS OFF CACHE BOOL "") # sometimes errors get lost in all the warnings... Loading
kitsune/examples/kokkos/CMakeLists.txt +0 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,6 @@ set(_example_srcs set(_example_view_srcs raytrace.cpp vecadd-views.cpp ) # Build the pure-kokkos serial target version of all the examples first. Loading
llvm/include/llvm/Analysis/MemoryBuiltins.h +6 −3 Original line number Diff line number Diff line Loading @@ -170,10 +170,13 @@ inline CallInst *extractCallocCall(Value *I, const TargetLibraryInfo *TLI) { bool isLibFreeFunction(const Function *F, const LibFunc TLIFn); /// isFreeCall - Returns non-null if the value is a call to the builtin free() const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI); const CallInst *isFreeCall(const Value *I, const TargetLibraryInfo *TLI, bool IgnoreBuiltinAttr = false); inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI) { return const_cast<CallInst*>(isFreeCall((const Value*)I, TLI)); inline CallInst *isFreeCall(Value *I, const TargetLibraryInfo *TLI, bool IgnoreBuiltinAttr = false) { return const_cast<CallInst *>( isFreeCall((const Value *)I, TLI, IgnoreBuiltinAttr)); } //===----------------------------------------------------------------------===// Loading
llvm/include/llvm/Transforms/Instrumentation/CSI.h +26 −17 Original line number Diff line number Diff line Loading @@ -71,7 +71,7 @@ static const char *const CsiDisableInstrumentationName = using csi_id_t = int64_t; static const csi_id_t CsiUnknownId = -1; static const csi_id_t CsiCallsiteUnknownTargetId = CsiUnknownId; // See llvm/tools/clang/lib/CodeGen/CodeGenModule.h: // See clang/lib/CodeGen/CodeGenModule.h: static const int CsiUnitCtorPriority = 0; /// Maintains a mapping from CSI ID to static data for that ID. Loading Loading @@ -803,6 +803,7 @@ public: IntegerType::get(C, PropBits.IsConstant), IntegerType::get(C, PropBits.IsOnStack), IntegerType::get(C, PropBits.MayBeCaptured), IntegerType::get(C, PropBits.IsAtomic), IntegerType::get(C, PropBits.LoadReadBeforeWriteInBB), IntegerType::get(C, PropBits.Padding))); } Loading Loading @@ -844,6 +845,8 @@ public: void setIsOnStack(bool v) { PropValue.Fields.IsOnStack = v; } /// Set the value of the MayBeCaptured property. void setMayBeCaptured(bool v) { PropValue.Fields.MayBeCaptured = v; } /// Set the value of the IsAtomic property. void setIsAtomic(bool v) { PropValue.Fields.IsAtomic = v; } /// Set the value of the LoadReadBeforeWriteInBB property. void setLoadReadBeforeWriteInBB(bool v) { PropValue.Fields.LoadReadBeforeWriteInBB = v; Loading @@ -858,8 +861,9 @@ private: unsigned IsConstant : 1; unsigned IsOnStack : 1; unsigned MayBeCaptured : 1; unsigned IsAtomic : 1; unsigned LoadReadBeforeWriteInBB : 1; uint64_t Padding : 53; uint64_t Padding : 50; } Fields; uint64_t Bits; } Property; Loading @@ -873,13 +877,14 @@ private: int IsConstant; int IsOnStack; int MayBeCaptured; int IsAtomic; int LoadReadBeforeWriteInBB; int Padding; } PropertyBits; /// The number of bits representing each property. static constexpr PropertyBits PropBits = { 8, 1, 1, 1, 1, 1, (64 - 8 - 1 - 1 - 1 - 1 - 1)}; 8, 1, 1, 1, 1, 1, 1, (64 - 8 - 1 - 1 - 1 - 1 - 1 - 1)}; }; class CsiAllocaProperty : public CsiProperty { Loading Loading @@ -1049,18 +1054,6 @@ public: Options(Options) { loadConfiguration(); } CSIImpl(Module &M, CallGraph *CG, function_ref<DominatorTree &(Function &)> GetDomTree, function_ref<LoopInfo &(Function &)> GetLoopInfo, function_ref<TaskInfo &(Function &)> GetTaskInfo, function_ref<TargetLibraryInfo &(Function &)> GetTLI, function_ref<ScalarEvolution &(Function &)> GetSE, const CSIOptions &Options = CSIOptions()) : M(M), DL(M.getDataLayout()), CG(CG), GetDomTree(GetDomTree), GetLoopInfo(GetLoopInfo), GetTaskInfo(GetTaskInfo), GetTLI(GetTLI), GetScalarEvolution(GetSE), Options(Options) { loadConfiguration(); } virtual ~CSIImpl() {} Loading @@ -1073,7 +1066,7 @@ public: static bool isVtableAccess(Instruction *I); static bool addrPointsToConstantData(Value *Addr); static bool isAtomic(Instruction *I); static void getAllocFnArgs(const Instruction *I, static bool getAllocFnArgs(const Instruction *I, SmallVectorImpl<Value *> &AllocFnArgs, Type *SizeTy, Type *AddrTy, const TargetLibraryInfo &TLI); Loading @@ -1095,6 +1088,9 @@ public: static bool spawnsTapirLoopBody(DetachInst *DI, LoopInfo &LI, TaskInfo &TI); static BasicBlock::iterator getFirstInsertionPtInDetachedBlock(BasicBlock *Detached); protected: /// Initialize the CSI pass. void initializeCsi(); Loading Loading @@ -1239,6 +1235,9 @@ protected: ZnwmSt11align_val_tRKSt9nothrow_t, ZnajSt11align_val_tRKSt9nothrow_t, ZnamSt11align_val_tRKSt9nothrow_t, posix_memalign, strdup, strndup, LAST_ALLOCFNTY }; Loading @@ -1250,8 +1249,8 @@ protected: return AllocFnTy::malloc; case LibFunc_valloc: return AllocFnTy::valloc; // aligned_alloc(align_val_t, size_t) case LibFunc_aligned_alloc: // aligned_alloc(align_val_t, size_t) return AllocFnTy::aligned_alloc; case LibFunc_calloc: return AllocFnTy::calloc; Loading Loading @@ -1331,6 +1330,15 @@ protected: case LibFunc_ZnamSt11align_val_tRKSt9nothrow_t: // new[](unsigned long, align_val_t, nothrow) return AllocFnTy::ZnamSt11align_val_tRKSt9nothrow_t; case LibFunc_posix_memalign: // posix_memalign(void **, size_t, size_t) return AllocFnTy::posix_memalign; case LibFunc_strdup: // strdup(const char *) return AllocFnTy::strdup; case LibFunc_strndup: // strdup(const char *, size_t) return AllocFnTy::strndup; } } Loading Loading @@ -1496,6 +1504,7 @@ protected: DenseMap<std::pair<BasicBlock *, Function *>, SmallVector<PHINode *, 4>> ArgPHIs; SmallPtrSet<SyncInst *, 12> SyncsWithUnwinds; DenseMap<BasicBlock *, CallInst *> callsAfterSync; std::unique_ptr<InstrumentationConfig> Config; Loading