Polly 20.0.0git
ScopDetectionDiagnostic.cpp
Go to the documentation of this file.
1//===- ScopDetectionDiagnostic.cpp - Error diagnostics --------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Small set of diagnostic helper classes to encapsulate any errors occurred
10// during the detection of Scops.
11//
12// The ScopDetection defines a set of error classes (via Statistic variables)
13// that groups a number of individual errors into a group, e.g. non-affinity
14// related errors.
15// On error we generate an object that carries enough additional information
16// to diagnose the error and generate a helpful error message.
17//
18//===----------------------------------------------------------------------===//
19
21#include "llvm/ADT/SmallPtrSet.h"
22#include "llvm/ADT/SmallVector.h"
23#include "llvm/ADT/Statistic.h"
24#include "llvm/ADT/StringRef.h"
25#include "llvm/ADT/Twine.h"
26#include "llvm/Analysis/AliasSetTracker.h"
27#include "llvm/Analysis/LoopInfo.h"
28#include "llvm/Analysis/OptimizationRemarkEmitter.h"
29#include "llvm/Analysis/RegionInfo.h"
30#include "llvm/Analysis/ScalarEvolution.h"
31#include "llvm/IR/BasicBlock.h"
32#include "llvm/IR/CFG.h"
33#include "llvm/IR/DebugLoc.h"
34#include "llvm/IR/DiagnosticInfo.h"
35#include "llvm/IR/Instruction.h"
36#include "llvm/IR/Value.h"
37#include "llvm/Support/raw_ostream.h"
38#include <algorithm>
39#include <cassert>
40#include <string>
41#include <utility>
42
43using namespace llvm;
44
45#define DEBUG_TYPE "polly-detect"
46
47#define SCOP_STAT(NAME, DESC) \
48 {"polly-detect", "NAME", "Number of rejected regions: " DESC}
49
50static Statistic RejectStatistics[] = {
51 SCOP_STAT(CFG, ""),
52 SCOP_STAT(InvalidTerminator, "Unsupported terminator instruction"),
53 SCOP_STAT(IrreducibleRegion, "Irreducible loops"),
54 SCOP_STAT(UnreachableInExit, "Unreachable in exit block"),
55 SCOP_STAT(IndirectPredecessor, "Branch from indirect terminator"),
56 SCOP_STAT(LastCFG, ""),
57 SCOP_STAT(AffFunc, ""),
58 SCOP_STAT(UndefCond, "Undefined branch condition"),
59 SCOP_STAT(InvalidCond, "Non-integer branch condition"),
60 SCOP_STAT(UndefOperand, "Undefined operands in comparison"),
61 SCOP_STAT(NonAffBranch, "Non-affine branch condition"),
62 SCOP_STAT(NoBasePtr, "No base pointer"),
63 SCOP_STAT(UndefBasePtr, "Undefined base pointer"),
64 SCOP_STAT(VariantBasePtr, "Variant base pointer"),
65 SCOP_STAT(NonAffineAccess, "Non-affine memory accesses"),
66 SCOP_STAT(DifferentElementSize, "Accesses with differing sizes"),
67 SCOP_STAT(LastAffFunc, ""),
68 SCOP_STAT(LoopBound, "Uncomputable loop bounds"),
69 SCOP_STAT(LoopHasNoExit, "Loop without exit"),
70 SCOP_STAT(LoopHasMultipleExits, "Loop with multiple exits"),
71 SCOP_STAT(LoopOnlySomeLatches, "Not all loop latches in scop"),
72 SCOP_STAT(FuncCall, "Function call with side effects"),
73 SCOP_STAT(NonSimpleMemoryAccess,
74 "Compilated access semantics (volatile or atomic)"),
75 SCOP_STAT(Alias, "Base address aliasing"),
76 SCOP_STAT(Other, ""),
77 SCOP_STAT(IntToPtr, "Integer to pointer conversions"),
78 SCOP_STAT(Alloca, "Stack allocations"),
79 SCOP_STAT(UnknownInst, "Unknown Instructions"),
80 SCOP_STAT(Entry, "Contains entry block"),
81 SCOP_STAT(Unprofitable, "Assumed to be unprofitable"),
82 SCOP_STAT(LastOther, ""),
83};
84
85namespace polly {
86
87/// Small string conversion via raw_string_stream.
88template <typename T> std::string operator+(Twine LHS, const T &RHS) {
89 std::string Buf;
90 raw_string_ostream fmt(Buf);
91 fmt << RHS;
92
93 return LHS.concat(Buf).str();
94}
95} // namespace polly
96
97namespace llvm {
98
99// Lexicographic order on (line, col) of our debug locations.
100static bool operator<(const DebugLoc &LHS, const DebugLoc &RHS) {
101 return LHS.getLine() < RHS.getLine() ||
102 (LHS.getLine() == RHS.getLine() && LHS.getCol() < RHS.getCol());
103}
104} // namespace llvm
105
106namespace polly {
107
108BBPair getBBPairForRegion(const Region *R) {
109 return std::make_pair(R->getEntry(), R->getExit());
110}
111
112void getDebugLocations(const BBPair &P, DebugLoc &Begin, DebugLoc &End) {
113 SmallPtrSet<BasicBlock *, 32> Seen;
114 SmallVector<BasicBlock *, 32> Todo;
115 Todo.push_back(P.first);
116 while (!Todo.empty()) {
117 auto *BB = Todo.pop_back_val();
118 if (BB == P.second)
119 continue;
120 if (!Seen.insert(BB).second)
121 continue;
122 Todo.append(succ_begin(BB), succ_end(BB));
123 for (const Instruction &Inst : *BB) {
124 DebugLoc DL = Inst.getStableDebugLoc();
125 if (!DL)
126 continue;
127
128 Begin = Begin ? std::min(Begin, DL) : DL;
129 End = End ? std::max(End, DL) : DL;
130 }
131 }
132}
133
134void emitRejectionRemarks(const BBPair &P, const RejectLog &Log,
135 OptimizationRemarkEmitter &ORE) {
136 DebugLoc Begin, End;
137 getDebugLocations(P, Begin, End);
138
139 ORE.emit(
140 OptimizationRemarkMissed(DEBUG_TYPE, "RejectionErrors", Begin, P.first)
141 << "The following errors keep this region from being a Scop.");
142
143 for (RejectReasonPtr RR : Log) {
144
145 if (const DebugLoc &Loc = RR->getDebugLoc())
146 ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, RR->getRemarkName(), Loc,
147 RR->getRemarkBB())
148 << RR->getEndUserMessage());
149 else
150 ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, RR->getRemarkName(), Begin,
151 RR->getRemarkBB())
152 << RR->getEndUserMessage());
153 }
154
155 /* Check to see if Region is a top level region, getExit = NULL*/
156 if (P.second)
157 ORE.emit(
158 OptimizationRemarkMissed(DEBUG_TYPE, "InvalidScopEnd", End, P.second)
159 << "Invalid Scop candidate ends here.");
160 else
161 ORE.emit(
162 OptimizationRemarkMissed(DEBUG_TYPE, "InvalidScopEnd", End, P.first)
163 << "Invalid Scop candidate ends here.");
164}
165
166//===----------------------------------------------------------------------===//
167// RejectReason.
168
170 RejectStatistics[static_cast<int>(K)]++;
171}
172
173const DebugLoc RejectReason::Unknown = DebugLoc();
174
175const DebugLoc &RejectReason::getDebugLoc() const {
176 // Allocate an empty DebugLoc and return it a reference to it.
177 return Unknown;
178}
179
180// RejectLog.
181void RejectLog::print(raw_ostream &OS, int level) const {
182 int j = 0;
183 for (auto Reason : ErrorReports)
184 OS.indent(level) << "[" << j++ << "] " << Reason->getMessage() << "\n";
185}
186
187//===----------------------------------------------------------------------===//
188// ReportCFG.
189
191
193 return RR->getKind() >= RejectReasonKind::CFG &&
195}
196
197//===----------------------------------------------------------------------===//
198// ReportInvalidTerminator.
199
201 return "InvalidTerminator";
202}
203
205
207 return ("Invalid instruction terminates BB: " + BB->getName()).str();
208}
209
211 return BB->getTerminator()->getDebugLoc();
212}
213
216}
217
218//===----------------------------------------------------------------------===//
219// UnreachableInExit.
220
222 return "UnreachableInExit";
223}
224
226
228 std::string BBName = BB->getName().str();
229 return "Unreachable in exit block" + BBName;
230}
231
232const DebugLoc &ReportUnreachableInExit::getDebugLoc() const { return DbgLoc; }
233
235 return "Unreachable in exit block.";
236}
237
240}
241
242//===----------------------------------------------------------------------===//
243// IndirectPredecessor.
244
246 return "IndirectPredecessor";
247}
248
250 if (Inst)
251 return Inst->getParent();
252 return nullptr;
253}
254
256 if (Inst)
257 return "Branch from indirect terminator: " + *Inst;
258 return getEndUserMessage();
259}
260
262 return DbgLoc;
263}
264
266 return "Branch from indirect terminator.";
267}
268
271}
272
273//===----------------------------------------------------------------------===//
274// ReportIrreducibleRegion.
275
277 return "IrreducibleRegion";
278}
279
281 return R->getEntry();
282}
283
285 return "Irreducible region encountered: " + R->getNameStr();
286}
287
288const DebugLoc &ReportIrreducibleRegion::getDebugLoc() const { return DbgLoc; }
289
291 return "Irreducible region encountered in control flow.";
292}
293
296}
297
298//===----------------------------------------------------------------------===//
299// ReportAffFunc.
300
301ReportAffFunc::ReportAffFunc(const RejectReasonKind K, const Instruction *Inst)
302 : RejectReason(K), Inst(Inst) {}
303
305 return RR->getKind() >= RejectReasonKind::AffFunc &&
307}
308
309//===----------------------------------------------------------------------===//
310// ReportUndefCond.
311
312std::string ReportUndefCond::getRemarkName() const { return "UndefCond"; }
313
314const Value *ReportUndefCond::getRemarkBB() const { return BB; }
315
316std::string ReportUndefCond::getMessage() const {
317 return ("Condition based on 'undef' value in BB: " + BB->getName()).str();
318}
319
321 return RR->getKind() == RejectReasonKind::UndefCond;
322}
323
324//===----------------------------------------------------------------------===//
325// ReportInvalidCond.
326
327std::string ReportInvalidCond::getRemarkName() const { return "InvalidCond"; }
328
329const Value *ReportInvalidCond::getRemarkBB() const { return BB; }
330
331std::string ReportInvalidCond::getMessage() const {
332 return ("Condition in BB '" + BB->getName()).str() +
333 "' neither constant nor an icmp instruction";
334}
335
338}
339
340//===----------------------------------------------------------------------===//
341// ReportUndefOperand.
342
343std::string ReportUndefOperand::getRemarkName() const { return "UndefOperand"; }
344
345const Value *ReportUndefOperand::getRemarkBB() const { return BB; }
346
348 return ("undef operand in branch at BB: " + BB->getName()).str();
349}
350
353}
354
355//===----------------------------------------------------------------------===//
356// ReportNonAffBranch.
357
358std::string ReportNonAffBranch::getRemarkName() const { return "NonAffBranch"; }
359
360const Value *ReportNonAffBranch::getRemarkBB() const { return BB; }
361
363 return ("Non affine branch in BB '" + BB->getName()).str() +
364 "' with LHS: " + *LHS + " and RHS: " + *RHS;
365}
366
369}
370
371//===----------------------------------------------------------------------===//
372// ReportNoBasePtr.
373
374std::string ReportNoBasePtr::getRemarkName() const { return "NoBasePtr"; }
375
376const Value *ReportNoBasePtr::getRemarkBB() const { return Inst->getParent(); }
377
378std::string ReportNoBasePtr::getMessage() const { return "No base pointer"; }
379
381 return RR->getKind() == RejectReasonKind::NoBasePtr;
382}
383
384//===----------------------------------------------------------------------===//
385// ReportUndefBasePtr.
386
387std::string ReportUndefBasePtr::getRemarkName() const { return "UndefBasePtr"; }
388
390 return Inst->getParent();
391}
392
394 return "Undefined base pointer";
395}
396
399}
400
401//===----------------------------------------------------------------------===//
402// ReportVariantBasePtr.
403
405 return "VariantBasePtr";
406}
407
409 return Inst->getParent();
410}
411
413 return "Base address not invariant in current region:" + *BaseValue;
414}
415
417 return "The base address of this array is not invariant inside the loop";
418}
419
422}
423
424//===----------------------------------------------------------------------===//
425// ReportDifferentArrayElementSize
426
428 return "DifferentArrayElementSize";
429}
430
432 return Inst->getParent();
433}
434
436 return "Access to one array through data types of different size";
437}
438
441}
442
444 StringRef BaseName = BaseValue->getName();
445 std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName.str();
446 return "The array \"" + Name +
447 "\" is accessed through elements that differ "
448 "in size";
449}
450
451//===----------------------------------------------------------------------===//
452// ReportNonAffineAccess.
453
455 return "NonAffineAccess";
456}
457
459 return Inst->getParent();
460}
461
463 return "Non affine access function: " + *AccessFunction;
464}
465
468}
469
471 StringRef BaseName = BaseValue->getName();
472 std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName.str();
473 return "The array subscript of \"" + Name + "\" is not affine";
474}
475
476//===----------------------------------------------------------------------===//
477// ReportLoopBound.
478
479ReportLoopBound::ReportLoopBound(Loop *L, const SCEV *LoopCount)
480 : RejectReason(RejectReasonKind::LoopBound), L(L), LoopCount(LoopCount),
481 Loc(L->getStartLoc()) {}
482
483std::string ReportLoopBound::getRemarkName() const { return "LoopBound"; }
484
485const Value *ReportLoopBound::getRemarkBB() const { return L->getHeader(); }
486
487std::string ReportLoopBound::getMessage() const {
488 return "Non affine loop bound '" + *LoopCount +
489 "' in loop: " + L->getHeader()->getName();
490}
491
492const DebugLoc &ReportLoopBound::getDebugLoc() const { return Loc; }
493
495 return RR->getKind() == RejectReasonKind::LoopBound;
496}
497
499 return "Failed to derive an affine function from the loop bounds.";
500}
501
502//===----------------------------------------------------------------------===//
503// ReportLoopHasNoExit.
504
506 return "LoopHasNoExit";
507}
508
509const Value *ReportLoopHasNoExit::getRemarkBB() const { return L->getHeader(); }
510
512 return "Loop " + L->getHeader()->getName() + " has no exit.";
513}
514
517}
518
519const DebugLoc &ReportLoopHasNoExit::getDebugLoc() const { return Loc; }
520
522 return "Loop cannot be handled because it has no exit.";
523}
524
525//===----------------------------------------------------------------------===//
526// ReportLoopHasMultipleExits.
527
529 return "ReportLoopHasMultipleExits";
530}
531
533 return L->getHeader();
534}
535
537 return "Loop " + L->getHeader()->getName() + " has multiple exits.";
538}
539
542}
543
544const DebugLoc &ReportLoopHasMultipleExits::getDebugLoc() const { return Loc; }
545
547 return "Loop cannot be handled because it has multiple exits.";
548}
549
550//===----------------------------------------------------------------------===//
551// ReportLoopOnlySomeLatches
552
554 return "LoopHasNoExit";
555}
556
558 return L->getHeader();
559}
560
562 return "Not all latches of loop " + L->getHeader()->getName() +
563 " part of scop.";
564}
565
568}
569
570const DebugLoc &ReportLoopOnlySomeLatches::getDebugLoc() const { return Loc; }
571
573 return "Loop cannot be handled because not all latches are part of loop "
574 "region.";
575}
576
577//===----------------------------------------------------------------------===//
578// ReportFuncCall.
579
581 : RejectReason(RejectReasonKind::FuncCall), Inst(Inst) {}
582
583std::string ReportFuncCall::getRemarkName() const { return "FuncCall"; }
584
585const Value *ReportFuncCall::getRemarkBB() const { return Inst->getParent(); }
586
587std::string ReportFuncCall::getMessage() const {
588 return "Call instruction: " + *Inst;
589}
590
591const DebugLoc &ReportFuncCall::getDebugLoc() const {
592 return Inst->getDebugLoc();
593}
594
596 return "This function call cannot be handled. "
597 "Try to inline it.";
598}
599
601 return RR->getKind() == RejectReasonKind::FuncCall;
602}
603
604//===----------------------------------------------------------------------===//
605// ReportNonSimpleMemoryAccess
606
609
611 return "NonSimpleMemoryAccess";
612}
613
615 return Inst->getParent();
616}
617
619 return "Non-simple memory access: " + *Inst;
620}
621
623 return Inst->getDebugLoc();
624}
625
627 return "Volatile memory accesses or memory accesses for atomic types "
628 "are not supported.";
629}
630
633}
634
635//===----------------------------------------------------------------------===//
636// ReportAlias.
637
638ReportAlias::ReportAlias(Instruction *Inst, AliasSet &AS)
639 : RejectReason(RejectReasonKind::Alias), Inst(Inst) {
640 append_range(Pointers, AS.getPointers());
641}
642
643std::string ReportAlias::formatInvalidAlias(std::string Prefix,
644 std::string Suffix) const {
645 std::string Message;
646 raw_string_ostream OS(Message);
647
648 OS << Prefix;
649
650 for (PointerSnapshotTy::const_iterator PI = Pointers.begin(),
651 PE = Pointers.end();
652 ;) {
653 const Value *V = *PI;
654 assert(V && "Diagnostic info does not match found LLVM-IR anymore.");
655
656 if (V->getName().empty())
657 OS << "\" <unknown> \"";
658 else
659 OS << "\"" << V->getName() << "\"";
660
661 ++PI;
662
663 if (PI != PE)
664 OS << ", ";
665 else
666 break;
667 }
668
669 OS << Suffix;
670
671 return Message;
672}
673
674std::string ReportAlias::getRemarkName() const { return "Alias"; }
675
676const Value *ReportAlias::getRemarkBB() const { return Inst->getParent(); }
677
678std::string ReportAlias::getMessage() const {
679 return formatInvalidAlias("Possible aliasing: ");
680}
681
683 return formatInvalidAlias("Accesses to the arrays ",
684 " may access the same memory.");
685}
686
687const DebugLoc &ReportAlias::getDebugLoc() const { return Inst->getDebugLoc(); }
688
690 return RR->getKind() == RejectReasonKind::Alias;
691}
692
693//===----------------------------------------------------------------------===//
694// ReportOther.
695
696std::string ReportOther::getRemarkName() const { return "UnknownRejectReason"; }
697
698std::string ReportOther::getMessage() const { return "Unknown reject reason"; }
699
701
703 return RR->getKind() >= RejectReasonKind::Other &&
705}
706
707//===----------------------------------------------------------------------===//
708// ReportIntToPtr.
709ReportIntToPtr::ReportIntToPtr(Instruction *BaseValue)
710 : ReportOther(RejectReasonKind::IntToPtr), BaseValue(BaseValue) {}
711
712std::string ReportIntToPtr::getRemarkName() const { return "IntToPtr"; }
713
715 return BaseValue->getParent();
716}
717
718std::string ReportIntToPtr::getMessage() const {
719 return "Find bad intToptr prt: " + *BaseValue;
720}
721
722const DebugLoc &ReportIntToPtr::getDebugLoc() const {
723 return BaseValue->getDebugLoc();
724}
725
727 return RR->getKind() == RejectReasonKind::IntToPtr;
728}
729
730//===----------------------------------------------------------------------===//
731// ReportAlloca.
732
734 : ReportOther(RejectReasonKind::Alloca), Inst(Inst) {}
735
736std::string ReportAlloca::getRemarkName() const { return "Alloca"; }
737
738const Value *ReportAlloca::getRemarkBB() const { return Inst->getParent(); }
739
740std::string ReportAlloca::getMessage() const {
741 return "Alloca instruction: " + *Inst;
742}
743
744const DebugLoc &ReportAlloca::getDebugLoc() const {
745 return Inst->getDebugLoc();
746}
747
749 return RR->getKind() == RejectReasonKind::Alloca;
750}
751
752//===----------------------------------------------------------------------===//
753// ReportUnknownInst.
754
756 : ReportOther(RejectReasonKind::UnknownInst), Inst(Inst) {}
757
758std::string ReportUnknownInst::getRemarkName() const { return "UnknownInst"; }
759
761 return Inst->getParent();
762}
763
764std::string ReportUnknownInst::getMessage() const {
765 return "Unknown instruction: " + *Inst;
766}
767
768const DebugLoc &ReportUnknownInst::getDebugLoc() const {
769 return Inst->getDebugLoc();
770}
771
774}
775
776//===----------------------------------------------------------------------===//
777// ReportEntry.
778
780 : ReportOther(RejectReasonKind::Entry), BB(BB) {}
781
782std::string ReportEntry::getRemarkName() const { return "Entry"; }
783
784const Value *ReportEntry::getRemarkBB() const { return BB; }
785
786std::string ReportEntry::getMessage() const {
787 return "Region containing entry block of function is invalid!";
788}
789
791 return "Scop contains function entry (not yet supported).";
792}
793
794const DebugLoc &ReportEntry::getDebugLoc() const {
795 return BB->getTerminator()->getDebugLoc();
796}
797
799 return RR->getKind() == RejectReasonKind::Entry;
800}
801
802//===----------------------------------------------------------------------===//
803// ReportUnprofitable.
804
807
808std::string ReportUnprofitable::getRemarkName() const { return "Unprofitable"; }
809
810const Value *ReportUnprofitable::getRemarkBB() const { return R->getEntry(); }
811
813 return "Region can not profitably be optimized!";
814}
815
817 return "No profitable polyhedral optimization found";
818}
819
820const DebugLoc &ReportUnprofitable::getDebugLoc() const {
821 for (const BasicBlock *BB : R->blocks())
822 for (const Instruction &Inst : *BB)
823 if (const DebugLoc &DL = Inst.getStableDebugLoc())
824 return DL;
825
826 return R->getEntry()->getTerminator()->getDebugLoc();
827}
828
831}
832} // namespace polly
#define DEBUG_TYPE
#define SCOP_STAT(NAME, DESC)
static Statistic RejectStatistics[]
Stores all errors that occurred during the detection.
void print(raw_ostream &OS, int level=0) const
SmallVector< RejectReasonPtr, 1 > ErrorReports
Base class of all reject reasons found during Scop detection.
static const DebugLoc Unknown
RejectReason(RejectReasonKind K)
RejectReasonKind getKind() const
virtual const DebugLoc & getDebugLoc() const
Get the source location of this error.
static bool classof(const RejectReason *RR)
ReportAffFunc(const RejectReasonKind K, const Instruction *Inst)
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string formatInvalidAlias(std::string Prefix="", std::string Suffix="") const
Format an invalid alias set.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
ReportAlias(Instruction *Inst, AliasSet &AS)
PointerSnapshotTy Pointers
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
ReportAlloca(Instruction *Inst)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
static bool classof(const RejectReason *RR)
ReportCFG(const RejectReasonKind K)
static bool classof(const RejectReason *RR)
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
static bool classof(const RejectReason *RR)
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
static bool classof(const RejectReason *RR)
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
ReportIntToPtr(Instruction *BaseValue)
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
ReportLoopBound(Loop *L, const SCEV *LoopCount)
static bool classof(const RejectReason *RR)
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
static bool classof(const RejectReason *RR)
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
Loop * L
The loop that has multiple exits.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
Loop * L
The loop that has no exit.
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
Loop * L
The loop for which not all loop latches are part of the scop.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
static bool classof(const RejectReason *RR)
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
const SCEV * LHS
LHS & RHS of the failed condition.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
Base class for otherwise ungrouped reject reasons.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
ReportOther(const RejectReasonKind K)
static bool classof(const RejectReason *RR)
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
static bool classof(const RejectReason *RR)
static bool classof(const RejectReason *RR)
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
static bool classof(const RejectReason *RR)
const DebugLoc & getDebugLoc() const override
Get the source location of this error.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
const Value * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
static bool classof(const RejectReason *RR)
std::string getRemarkName() const override
Generate the remark name to identify this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
static __isl_give isl_union_map * append_range(__isl_take isl_union_map *umap, int extra)
#define assert(exp)
This file contains the declaration of the PolyhedralInfo class, which will provide an interface to ex...
static bool operator<(const DebugLoc &LHS, const DebugLoc &RHS)
std::pair< llvm::BasicBlock *, llvm::BasicBlock * > BBPair
Type to hold region delimiters (entry & exit block).
Definition: Utils.h:31
std::shared_ptr< RejectReason > RejectReasonPtr
void getDebugLocations(const BBPair &P, DebugLoc &Begin, DebugLoc &End)
Set the begin and end source location for the region limited by P.
isl::pw_aff operator+(isl::pw_aff Left, isl::pw_aff Right)
Addition.
Definition: ISLOperators.h:22
@ Value
MemoryKind::Value: Models an llvm::Value.
void emitRejectionRemarks(const BBPair &P, const RejectLog &Log, OptimizationRemarkEmitter &ORE)
Emit optimization remarks about the rejected regions to the user.
BBPair getBBPairForRegion(const Region *R)
Return the region delimiters (entry & exit block) of R.