Mercurial > hg > CbC > CbC_llvm
diff lib/Target/NVPTX/NVPTXUtilities.cpp @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | 60c9769439b8 |
children | 7d135dc70f03 |
line wrap: on
line diff
--- a/lib/Target/NVPTX/NVPTXUtilities.cpp Wed Feb 18 14:56:07 2015 +0900 +++ b/lib/Target/NVPTX/NVPTXUtilities.cpp Tue Oct 13 17:48:58 2015 +0900 @@ -293,12 +293,9 @@ unsigned x = 0; bool retval = llvm::findOneNVVMAnnotation( &F, llvm::PropertyAnnotationNames[llvm::PROPERTY_ISKERNEL_FUNCTION], x); - if (retval == false) { + if (!retval) { // There is no NVVM metadata, check the calling convention - if (F.getCallingConv() == llvm::CallingConv::PTX_Kernel) - return true; - else - return false; + return F.getCallingConv() == llvm::CallingConv::PTX_Kernel; } return (x == 1); } @@ -307,7 +304,7 @@ std::vector<unsigned> Vs; bool retval = llvm::findAllNVVMAnnotation( &F, llvm::PropertyAnnotationNames[llvm::PROPERTY_ALIGN], Vs); - if (retval == false) + if (!retval) return false; for (int i = 0, e = Vs.size(); i < e; i++) { unsigned v = Vs[i]; @@ -339,18 +336,16 @@ } bool llvm::isBarrierIntrinsic(Intrinsic::ID id) { - if ((id == Intrinsic::nvvm_barrier0) || - (id == Intrinsic::nvvm_barrier0_popc) || - (id == Intrinsic::nvvm_barrier0_and) || - (id == Intrinsic::nvvm_barrier0_or) || - (id == Intrinsic::cuda_syncthreads)) - return true; - return false; + return (id == Intrinsic::nvvm_barrier0) || + (id == Intrinsic::nvvm_barrier0_popc) || + (id == Intrinsic::nvvm_barrier0_and) || + (id == Intrinsic::nvvm_barrier0_or) || + (id == Intrinsic::cuda_syncthreads); } // Interface for checking all memory space transfer related intrinsics bool llvm::isMemorySpaceTransferIntrinsic(Intrinsic::ID id) { - if (id == Intrinsic::nvvm_ptr_local_to_gen || + return id == Intrinsic::nvvm_ptr_local_to_gen || id == Intrinsic::nvvm_ptr_shared_to_gen || id == Intrinsic::nvvm_ptr_global_to_gen || id == Intrinsic::nvvm_ptr_constant_to_gen || @@ -358,16 +353,12 @@ id == Intrinsic::nvvm_ptr_gen_to_shared || id == Intrinsic::nvvm_ptr_gen_to_local || id == Intrinsic::nvvm_ptr_gen_to_constant || - id == Intrinsic::nvvm_ptr_gen_to_param) { - return true; - } - - return false; + id == Intrinsic::nvvm_ptr_gen_to_param; } // consider several special intrinsics in striping pointer casts, and -// provide an option to ignore GEP indicies for find out the base address only -// which could be used in simple alias disambigurate. +// provide an option to ignore GEP indices for find out the base address only +// which could be used in simple alias disambiguation. const Value * llvm::skipPointerTransfer(const Value *V, bool ignore_GEP_indices) { V = V->stripPointerCasts(); @@ -388,9 +379,9 @@ } // consider several special intrinsics in striping pointer casts, and -// - ignore GEP indicies for find out the base address only, and +// - ignore GEP indices for find out the base address only, and // - tracking PHINode -// which could be used in simple alias disambigurate. +// which could be used in simple alias disambiguation. const Value * llvm::skipPointerTransfer(const Value *V, std::set<const Value *> &processed) { if (processed.find(V) != processed.end()) @@ -437,7 +428,7 @@ return V; } -// The following are some useful utilities for debuggung +// The following are some useful utilities for debugging BasicBlock *llvm::getParentBlock(Value *v) { if (BasicBlock *B = dyn_cast<BasicBlock>(v)) @@ -493,7 +484,7 @@ return nullptr; } -// Dump an instruction by nane +// Dump an instruction by name void llvm::dumpInst(Value *base, char *instName) { Instruction *I = getInst(base, instName); if (I)