Changeset View
Changeset View
Standalone View
Standalone View
lib/Target/NVPTX/NVPTXUtilities.cpp
//===- NVPTXUtilities.cpp - Utility Functions -----------------------------===// | //===- NVPTXUtilities.cpp - Utility Functions -----------------------------===// | ||||
// | // | ||||
// The LLVM Compiler Infrastructure | // The LLVM Compiler Infrastructure | ||||
// | // | ||||
// This file is distributed under the University of Illinois Open Source | // This file is distributed under the University of Illinois Open Source | ||||
// License. See LICENSE.TXT for details. | // License. See LICENSE.TXT for details. | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// This file contains miscellaneous utility functions | // This file contains miscellaneous utility functions | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "NVPTXUtilities.h" | #include "NVPTXUtilities.h" | ||||
#include "NVPTX.h" | #include "NVPTX.h" | ||||
#include "llvm/Analysis/CaptureTracking.h" | |||||
#include "llvm/IR/Constants.h" | #include "llvm/IR/Constants.h" | ||||
#include "llvm/IR/Function.h" | #include "llvm/IR/Function.h" | ||||
#include "llvm/IR/GlobalVariable.h" | #include "llvm/IR/GlobalVariable.h" | ||||
#include "llvm/IR/InstIterator.h" | #include "llvm/IR/InstIterator.h" | ||||
#include "llvm/IR/Module.h" | #include "llvm/IR/Module.h" | ||||
#include "llvm/IR/Operator.h" | #include "llvm/IR/Operator.h" | ||||
#include "llvm/Support/ManagedStatic.h" | #include "llvm/Support/ManagedStatic.h" | ||||
#include "llvm/Support/MutexGuard.h" | #include "llvm/Support/MutexGuard.h" | ||||
#include <algorithm> | #include <algorithm> | ||||
#include <cstring> | #include <cstring> | ||||
#include <map> | #include <map> | ||||
#include <string> | #include <string> | ||||
#include <vector> | #include <vector> | ||||
namespace llvm { | namespace llvm { | ||||
#define DEBUG_TYPE "nvptx-utilities" | |||||
namespace { | namespace { | ||||
typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t; | typedef std::map<std::string, std::vector<unsigned> > key_val_pair_t; | ||||
typedef std::map<const GlobalValue *, key_val_pair_t> global_val_annot_t; | typedef std::map<const GlobalValue *, key_val_pair_t> global_val_annot_t; | ||||
typedef std::map<const Module *, global_val_annot_t> per_module_annot_t; | typedef std::map<const Module *, global_val_annot_t> per_module_annot_t; | ||||
} // anonymous namespace | } // anonymous namespace | ||||
static ManagedStatic<per_module_annot_t> annotationCache; | static ManagedStatic<per_module_annot_t> annotationCache; | ||||
static sys::Mutex Lock; | static sys::Mutex Lock; | ||||
▲ Show 20 Lines • Show All 270 Lines • ▼ Show 20 Lines | for (int i = 0, n = alignNode->getNumOperands(); i < n; i++) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
/// Returns true if there are any instructions storing | |||||
/// the address of this pointer. | |||||
bool ptrIsStored(Value *Ptr) { | |||||
hfinkel: Can't you use PointerMayBeCaptured (include/llvm/Analysis/CaptureTracking.h) instead of this… | |||||
return PointerMayBeCaptured(Ptr, false, true); | |||||
} | |||||
} // namespace llvm | } // namespace llvm |
Can't you use PointerMayBeCaptured (include/llvm/Analysis/CaptureTracking.h) instead of this function? If so, please do.