Skip to content

Commit 7056885

Browse files
committed
Added hooks to run interprocedural analysis with clang instead of opt. This forces us to use the old pass manager w/ clang, however. We will probably want to transition to the new pass manager in the future.
1 parent 84e938c commit 7056885

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

llvm/lib/Transforms/UncoalescedAnalysis/InterprocUncoalescedAnalysisPass.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "InterprocUncoalescedAnalysisPass.h"
2+
#include "llvm/IR/LegacyPassManager.h"
3+
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
24

35
#define DEBUG_TYPE "uncoalesced-analysis"
46

@@ -46,3 +48,9 @@ bool InterproceduralUncoalescedAnalysisPass::runOnModule(Module &M) {
4648
char InterproceduralUncoalescedAnalysisPass::ID = 0;
4749
static RegisterPass<InterproceduralUncoalescedAnalysisPass>
4850
Y("interproc-uncoalesced-analysis", "Interprocedural analysis to detect uncoalesced accesses in gpu programs.");
51+
52+
// This lets us run the pass with Clang.
53+
static void registerInterproceduralUncoalescedAnalysisPass(const PassManagerBuilder &builder, legacy::PassManagerBase &manager) {
54+
manager.add(new InterproceduralUncoalescedAnalysisPass());
55+
}
56+
static RegisterStandardPasses RegisterInterproceduralUncoalescedAnalysisPass(PassManagerBuilder::EP_ModuleOptimizerEarly, registerInterproceduralUncoalescedAnalysisPass);

llvm/lib/Transforms/UncoalescedAnalysis/UncoalescedAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ void UncoalescedAnalysis::BuildAnalysisInfo(GPUState st) {
402402
UncoalescedAccesses_.clear();
403403

404404
LLVM_DEBUG(errs() << "-------------- computing uncoalesced accesses ------------------\n");
405-
errs() << "Function: " << F_->getName() << "\n";
405+
errs() << "Function: " << demangle(F_->getName().str()) << "\n";
406406
initialState_ = st;
407407
entryBlock_ = &F_->getEntryBlock();
408408
Execute();

0 commit comments

Comments
 (0)