mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-12 15:51:35 +00:00
[LoopDataPrefetch] Port to new streaming API for opt remarks
llvm-svn: 282826
This commit is contained in:
parent
2e623163a0
commit
d6eee273b7
@ -524,6 +524,11 @@ public:
|
||||
OptimizationRemark(const char *PassName, StringRef RemarkName,
|
||||
const DebugLoc &DLoc, Value *CodeRegion);
|
||||
|
||||
/// Same as above but the debug location and code region is derived from \p
|
||||
/// Instr.
|
||||
OptimizationRemark(const char *PassName, StringRef RemarkName,
|
||||
Instruction *Inst);
|
||||
|
||||
static bool classof(const DiagnosticInfo *DI) {
|
||||
return DI->getKind() == DK_OptimizationRemark;
|
||||
}
|
||||
|
@ -190,6 +190,13 @@ OptimizationRemark::OptimizationRemark(const char *PassName,
|
||||
DK_OptimizationRemark, DS_Remark, PassName, RemarkName,
|
||||
*cast<BasicBlock>(CodeRegion)->getParent(), DLoc, CodeRegion) {}
|
||||
|
||||
OptimizationRemark::OptimizationRemark(const char *PassName,
|
||||
StringRef RemarkName, Instruction *Inst)
|
||||
: DiagnosticInfoOptimizationBase(DK_OptimizationRemark, DS_Remark, PassName,
|
||||
RemarkName,
|
||||
*Inst->getParent()->getParent(),
|
||||
Inst->getDebugLoc(), Inst->getParent()) {}
|
||||
|
||||
bool OptimizationRemark::isEnabled() const {
|
||||
return PassRemarksOptLoc.Pattern &&
|
||||
PassRemarksOptLoc.Pattern->match(getPassName());
|
||||
|
@ -329,7 +329,8 @@ bool LoopDataPrefetch::runOnLoop(Loop *L) {
|
||||
++NumPrefetches;
|
||||
DEBUG(dbgs() << " Access: " << *PtrValue << ", SCEV: " << *LSCEV
|
||||
<< "\n");
|
||||
ORE->emitOptimizationRemark(DEBUG_TYPE, MemI, "prefetched memory access");
|
||||
ORE->emit(OptimizationRemark(DEBUG_TYPE, "Prefetched", MemI)
|
||||
<< "prefetched memory access");
|
||||
|
||||
MadeChange = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user