Skip to content

Commit

Permalink
[LAA] Remove unused LoopAccessReport
Browse files Browse the repository at this point in the history
The need for this removed when I converted everything to use the opt-remark
classes directly with the streaming interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296017 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
anemet committed Feb 23, 2017
1 parent 66f6b76 commit d7e57f0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 64 deletions.
33 changes: 0 additions & 33 deletions include/llvm/Analysis/LoopAccessAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,6 @@ class SCEVUnionPredicate;
class LoopAccessInfo;
class OptimizationRemarkEmitter;

/// Optimization analysis message produced during vectorization. Messages inform
/// the user why vectorization did not occur.
class LoopAccessReport {
std::string Message;
const Instruction *Instr;

protected:
LoopAccessReport(const Twine &Message, const Instruction *I)
: Message(Message.str()), Instr(I) {}

public:
LoopAccessReport(const Instruction *I = nullptr) : Instr(I) {}

template <typename A> LoopAccessReport &operator<<(const A &Value) {
raw_string_ostream Out(Message);
Out << Value;
return *this;
}

const Instruction *getInstr() const { return Instr; }

std::string &str() { return Message; }
const std::string &str() const { return Message; }
operator Twine() { return Message; }

/// \brief Emit an analysis note for \p PassName with the debug location from
/// the instruction in \p Message if available. Otherwise use the location of
/// \p TheLoop.
static void emitAnalysis(const LoopAccessReport &Message, const Loop *TheLoop,
const char *PassName,
OptimizationRemarkEmitter &ORE);
};

/// \brief Collection of parameters shared beetween the Loop Vectorizer and the
/// Loop Access Analysis.
struct VectorizerParams {
Expand Down
15 changes: 0 additions & 15 deletions lib/Analysis/LoopAccessAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,6 @@ bool VectorizerParams::isInterleaveForced() {
return ::VectorizationInterleave.getNumOccurrences() > 0;
}

void LoopAccessReport::emitAnalysis(const LoopAccessReport &Message,
const Loop *TheLoop, const char *PassName,
OptimizationRemarkEmitter &ORE) {
DebugLoc DL = TheLoop->getStartLoc();
const Value *V = TheLoop->getHeader();
if (const Instruction *I = Message.getInstr()) {
// If there is no debug location attached to the instruction, revert back to
// using the loop's.
if (I->getDebugLoc())
DL = I->getDebugLoc();
V = I->getParent();
}
ORE.emitOptimizationRemarkAnalysis(PassName, DL, V, Message.str());
}

Value *llvm::stripIntegerCast(Value *V) {
if (auto *CI = dyn_cast<CastInst>(V))
if (CI->getOperand(0)->getType()->isIntegerTy())
Expand Down
16 changes: 0 additions & 16 deletions lib/Transforms/Vectorize/LoopVectorize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1520,14 +1520,6 @@ class LoopVectorizeHints {
OptimizationRemarkEmitter &ORE;
};

static void emitAnalysisDiag(const Loop *TheLoop,
const LoopVectorizeHints &Hints,
OptimizationRemarkEmitter &ORE,
const LoopAccessReport &Message) {
const char *Name = Hints.vectorizeAnalysisPassName();
LoopAccessReport::emitAnalysis(Message, TheLoop, Name, ORE);
}

static void emitMissedWarning(Function *F, Loop *L,
const LoopVectorizeHints &LH,
OptimizationRemarkEmitter *ORE) {
Expand Down Expand Up @@ -1741,14 +1733,6 @@ class LoopVectorizationLegality {
void addInductionPhi(PHINode *Phi, const InductionDescriptor &ID,
SmallPtrSetImpl<Value *> &AllowedExit);

/// Report an analysis message to assist the user in diagnosing loops that are
/// not vectorized. These are handled as LoopAccessReport rather than
/// VectorizationReport because the << operator of VectorizationReport returns
/// LoopAccessReport.
void emitAnalysis(const LoopAccessReport &Message) const {
emitAnalysisDiag(TheLoop, *Hints, *ORE, Message);
}

/// Create an analysis remark that explains why vectorization failed
///
/// \p RemarkName is the identifier for the remark. If \p I is passed it is
Expand Down

0 comments on commit d7e57f0

Please sign in to comment.