Polly 23.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 "Complicated access semantics (volatile or atomic)"),
75 SCOP_STAT(IncompatibleType, "Non-fixed size type (e.g. Scalable vector)"),
76 SCOP_STAT(Alias, "Base address aliasing"),
77 SCOP_STAT(Other, ""),
78 SCOP_STAT(IntToPtr, "Integer to pointer conversions"),
79 SCOP_STAT(Alloca, "Stack allocations"),
80 SCOP_STAT(UnknownInst, "Unknown Instructions"),
81 SCOP_STAT(Entry, "Contains entry block"),
82 SCOP_STAT(Unprofitable, "Assumed to be unprofitable"),
83 SCOP_STAT(LastOther, ""),
84};
85
86namespace polly {
87
88/// Small string conversion via raw_string_stream.
89template <typename T> std::string operator+(Twine LHS, const T &RHS) {
90 std::string Buf;
91 raw_string_ostream fmt(Buf);
92 fmt << RHS;
93
94 return LHS.concat(Buf).str();
95}
96} // namespace polly
97
98namespace llvm {
99
100// Lexicographic order on (line, col) of our debug locations.
101static bool operator<(const DebugLoc &LHS, const DebugLoc &RHS) {
102 return LHS.getLine() < RHS.getLine() ||
103 (LHS.getLine() == RHS.getLine() && LHS.getCol() < RHS.getCol());
104}
105} // namespace llvm
106
107namespace polly {
108
109BBPair getBBPairForRegion(const Region *R) {
110 return std::make_pair(R->getEntry(), R->getExit());
111}
112
113void getDebugLocations(const BBPair &P, DebugLoc &Begin, DebugLoc &End) {
114 SmallPtrSet<BasicBlock *, 32> Seen;
115 SmallVector<BasicBlock *, 32> Todo;
116 Todo.push_back(P.first);
117 while (!Todo.empty()) {
118 auto *BB = Todo.pop_back_val();
119 if (BB == P.second)
120 continue;
121 if (!Seen.insert(BB).second)
122 continue;
123 Todo.append(succ_begin(BB), succ_end(BB));
124 for (const Instruction &Inst : *BB) {
125 DebugLoc DL = Inst.getStableDebugLoc();
126 if (!DL)
127 continue;
128
129 Begin = Begin ? std::min(Begin, DL) : DL;
130 End = End ? std::max(End, DL) : DL;
131 }
132 }
133}
134
135void emitRejectionRemarks(const BBPair &P, const RejectLog &Log,
136 OptimizationRemarkEmitter &ORE) {
137 DebugLoc Begin, End;
138 getDebugLocations(P, Begin, End);
139
140 ORE.emit(
141 OptimizationRemarkMissed(DEBUG_TYPE, "RejectionErrors", Begin, P.first)
142 << "The following errors keep this region from being a Scop.");
143
144 for (RejectReasonPtr RR : Log) {
145
146 if (const DebugLoc &Loc = RR->getDebugLoc())
147 ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, RR->getRemarkName(), Loc,
148 RR->getRemarkBB())
149 << RR->getEndUserMessage());
150 else
151 ORE.emit(OptimizationRemarkMissed(DEBUG_TYPE, RR->getRemarkName(), Begin,
152 RR->getRemarkBB())
153 << RR->getEndUserMessage());
154 }
155
156 /* Check to see if Region is a top level region, getExit = NULL*/
157 if (P.second)
158 ORE.emit(
159 OptimizationRemarkMissed(DEBUG_TYPE, "InvalidScopEnd", End, P.second)
160 << "Invalid Scop candidate ends here.");
161 else
162 ORE.emit(
163 OptimizationRemarkMissed(DEBUG_TYPE, "InvalidScopEnd", End, P.first)
164 << "Invalid Scop candidate ends here.");
165}
166
167//===----------------------------------------------------------------------===//
168// RejectReason.
169
171 RejectStatistics[static_cast<int>(K)]++;
172}
173
174const DebugLoc RejectReason::Unknown = DebugLoc();
175
176const DebugLoc &RejectReason::getDebugLoc() const {
177 // Allocate an empty DebugLoc and return it a reference to it.
178 return Unknown;
179}
180
181// RejectLog.
182void RejectLog::print(raw_ostream &OS, int level) const {
183 int j = 0;
184 for (auto Reason : ErrorReports)
185 OS.indent(level) << "[" << j++ << "] " << Reason->getMessage() << "\n";
186}
187
188//===----------------------------------------------------------------------===//
189// ReportCFG.
190
192
194 return RR->getKind() >= RejectReasonKind::CFG &&
196}
197
198//===----------------------------------------------------------------------===//
199// ReportInvalidTerminator.
200
202 return "InvalidTerminator";
203}
204
205const BasicBlock *ReportInvalidTerminator::getRemarkBB() const { return BB; }
206
208 return ("Invalid instruction terminates BB: " + BB->getName()).str();
209}
210
212 return BB->getTerminator()->getDebugLoc();
213}
214
218
219//===----------------------------------------------------------------------===//
220// UnreachableInExit.
221
223 return "UnreachableInExit";
224}
225
226const BasicBlock *ReportUnreachableInExit::getRemarkBB() const { return BB; }
227
229 std::string BBName = BB->getName().str();
230 return "Unreachable in exit block" + BBName;
231}
232
233const DebugLoc &ReportUnreachableInExit::getDebugLoc() const { return DbgLoc; }
234
236 return "Unreachable in exit block.";
237}
238
242
243//===----------------------------------------------------------------------===//
244// IndirectPredecessor.
245
247 return "IndirectPredecessor";
248}
249
250const BasicBlock *ReportIndirectPredecessor::getRemarkBB() const {
251 if (Inst)
252 return Inst->getParent();
253 return nullptr;
254}
255
257 if (Inst)
258 return "Branch from indirect terminator: " + *Inst;
259 return getEndUserMessage();
260}
261
263 return DbgLoc;
264}
265
267 return "Branch from indirect terminator.";
268}
269
273
274//===----------------------------------------------------------------------===//
275// ReportIrreducibleRegion.
276
278 return "IrreducibleRegion";
279}
280
281const BasicBlock *ReportIrreducibleRegion::getRemarkBB() const {
282 return R->getEntry();
283}
284
286 return "Irreducible region encountered: " + R->getNameStr();
287}
288
289const DebugLoc &ReportIrreducibleRegion::getDebugLoc() const { return DbgLoc; }
290
292 return "Irreducible region encountered in control flow.";
293}
294
298
299//===----------------------------------------------------------------------===//
300// ReportAffFunc.
301
303 : RejectReason(K), Inst(Inst) {}
304
309
310//===----------------------------------------------------------------------===//
311// ReportUndefCond.
312
313std::string ReportUndefCond::getRemarkName() const { return "UndefCond"; }
314
315const BasicBlock *ReportUndefCond::getRemarkBB() const { return BB; }
316
317std::string ReportUndefCond::getMessage() const {
318 return ("Condition based on 'undef' value in BB: " + BB->getName()).str();
319}
320
324
325//===----------------------------------------------------------------------===//
326// ReportInvalidCond.
327
328std::string ReportInvalidCond::getRemarkName() const { return "InvalidCond"; }
329
330const BasicBlock *ReportInvalidCond::getRemarkBB() const { return BB; }
331
332std::string ReportInvalidCond::getMessage() const {
333 return ("Condition in BB '" + BB->getName()).str() +
334 "' neither constant nor an icmp instruction";
335}
336
340
341//===----------------------------------------------------------------------===//
342// ReportUndefOperand.
343
344std::string ReportUndefOperand::getRemarkName() const { return "UndefOperand"; }
345
346const BasicBlock *ReportUndefOperand::getRemarkBB() const { return BB; }
347
349 return ("undef operand in branch at BB: " + BB->getName()).str();
350}
351
355
356//===----------------------------------------------------------------------===//
357// ReportNonAffBranch.
358
359std::string ReportNonAffBranch::getRemarkName() const { return "NonAffBranch"; }
360
361const BasicBlock *ReportNonAffBranch::getRemarkBB() const { return BB; }
362
364 return ("Non affine branch in BB '" + BB->getName()).str() +
365 "' with LHS: " + *LHS + " and RHS: " + *RHS;
366}
367
371
372//===----------------------------------------------------------------------===//
373// ReportNoBasePtr.
374
375std::string ReportNoBasePtr::getRemarkName() const { return "NoBasePtr"; }
376
377const BasicBlock *ReportNoBasePtr::getRemarkBB() const {
378 return Inst->getParent();
379}
380
381std::string ReportNoBasePtr::getMessage() const { return "No base pointer"; }
382
386
387//===----------------------------------------------------------------------===//
388// ReportUndefBasePtr.
389
390std::string ReportUndefBasePtr::getRemarkName() const { return "UndefBasePtr"; }
391
392const BasicBlock *ReportUndefBasePtr::getRemarkBB() const {
393 return Inst->getParent();
394}
395
397 return "Undefined base pointer";
398}
399
403
404//===----------------------------------------------------------------------===//
405// ReportVariantBasePtr.
406
408 return "VariantBasePtr";
409}
410
411const BasicBlock *ReportVariantBasePtr::getRemarkBB() const {
412 return Inst->getParent();
413}
414
416 return "Base address not invariant in current region:" + *BaseValue;
417}
418
420 return "The base address of this array is not invariant inside the loop";
421}
422
426
427//===----------------------------------------------------------------------===//
428// ReportDifferentArrayElementSize
429
431 return "DifferentArrayElementSize";
432}
433
435 return Inst->getParent();
436}
437
439 return "Access to one array through data types of different size";
440}
441
445
447 StringRef BaseName = BaseValue->getName();
448 std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName.str();
449 return "The array \"" + Name +
450 "\" is accessed through elements that differ "
451 "in size";
452}
453
454//===----------------------------------------------------------------------===//
455// ReportNonAffineAccess.
456
458 return "NonAffineAccess";
459}
460
461const BasicBlock *ReportNonAffineAccess::getRemarkBB() const {
462 return Inst->getParent();
463}
464
466 return "Non affine access function: " + *AccessFunction;
467}
468
472
474 StringRef BaseName = BaseValue->getName();
475 std::string Name = BaseName.empty() ? "UNKNOWN" : BaseName.str();
476 return "The array subscript of \"" + Name + "\" is not affine";
477}
478
479//===----------------------------------------------------------------------===//
480// ReportLoopBound.
481
485
486std::string ReportLoopBound::getRemarkName() const { return "LoopBound"; }
487
488const BasicBlock *ReportLoopBound::getRemarkBB() const {
489 return L->getHeader();
490}
491
492std::string ReportLoopBound::getMessage() const {
493 return "Non affine loop bound '" + *LoopCount +
494 "' in loop: " + L->getHeader()->getName();
495}
496
497const DebugLoc &ReportLoopBound::getDebugLoc() const { return Loc; }
498
502
504 return "Failed to derive an affine function from the loop bounds.";
505}
506
507//===----------------------------------------------------------------------===//
508// ReportLoopHasNoExit.
509
511 return "LoopHasNoExit";
512}
513
514const BasicBlock *ReportLoopHasNoExit::getRemarkBB() const {
515 return L->getHeader();
516}
517
519 return "Loop " + L->getHeader()->getName() + " has no exit.";
520}
521
525
526const DebugLoc &ReportLoopHasNoExit::getDebugLoc() const { return Loc; }
527
529 return "Loop cannot be handled because it has no exit.";
530}
531
532//===----------------------------------------------------------------------===//
533// ReportLoopHasMultipleExits.
534
536 return "ReportLoopHasMultipleExits";
537}
538
540 return L->getHeader();
541}
542
544 return "Loop " + L->getHeader()->getName() + " has multiple exits.";
545}
546
550
551const DebugLoc &ReportLoopHasMultipleExits::getDebugLoc() const { return Loc; }
552
554 return "Loop cannot be handled because it has multiple exits.";
555}
556
557//===----------------------------------------------------------------------===//
558// ReportLoopOnlySomeLatches
559
561 return "LoopHasNoExit";
562}
563
564const BasicBlock *ReportLoopOnlySomeLatches::getRemarkBB() const {
565 return L->getHeader();
566}
567
569 return "Not all latches of loop " + L->getHeader()->getName() +
570 " part of scop.";
571}
572
576
577const DebugLoc &ReportLoopOnlySomeLatches::getDebugLoc() const { return Loc; }
578
580 return "Loop cannot be handled because not all latches are part of loop "
581 "region.";
582}
583
584//===----------------------------------------------------------------------===//
585// ReportFuncCall.
586
589
590std::string ReportFuncCall::getRemarkName() const { return "FuncCall"; }
591
592const BasicBlock *ReportFuncCall::getRemarkBB() const {
593 return Inst->getParent();
594}
595
596std::string ReportFuncCall::getMessage() const {
597 return "Call instruction: " + *Inst;
598}
599
600const DebugLoc &ReportFuncCall::getDebugLoc() const {
601 return Inst->getDebugLoc();
602}
603
605 return "This function call cannot be handled. "
606 "Try to inline it.";
607}
608
610 return RR->getKind() == RejectReasonKind::FuncCall;
611}
612
613//===----------------------------------------------------------------------===//
614// ReportNonSimpleMemoryAccess
615
618
620 return "NonSimpleMemoryAccess";
621}
622
624 return Inst->getParent();
625}
626
628 return "Non-simple memory access: " + *Inst;
629}
630
632 return Inst->getDebugLoc();
633}
634
636 return "Volatile memory accesses or memory accesses for atomic types "
637 "are not supported.";
638}
639
643
644//===----------------------------------------------------------------------===//
645// ReportAlias.
646
647ReportAlias::ReportAlias(Instruction *Inst, AliasSet &AS)
649 append_range(Pointers, AS.getPointers());
650}
651
652std::string ReportAlias::formatInvalidAlias(std::string Prefix,
653 std::string Suffix) const {
654 std::string Message;
655 raw_string_ostream OS(Message);
656
657 OS << Prefix;
658
659 for (PointerSnapshotTy::const_iterator PI = Pointers.begin(),
660 PE = Pointers.end();
661 ;) {
662 const Value *V = *PI;
663 assert(V && "Diagnostic info does not match found LLVM-IR anymore.");
664
665 if (V->getName().empty())
666 OS << "\" <unknown> \"";
667 else
668 OS << "\"" << V->getName() << "\"";
669
670 ++PI;
671
672 if (PI != PE)
673 OS << ", ";
674 else
675 break;
676 }
677
678 OS << Suffix;
679
680 return Message;
681}
682
683std::string ReportAlias::getRemarkName() const { return "Alias"; }
684
685const BasicBlock *ReportAlias::getRemarkBB() const { return Inst->getParent(); }
686
687std::string ReportAlias::getMessage() const {
688 return formatInvalidAlias("Possible aliasing: ");
689}
690
692 return formatInvalidAlias("Accesses to the arrays ",
693 " may access the same memory.");
694}
695
696const DebugLoc &ReportAlias::getDebugLoc() const { return Inst->getDebugLoc(); }
697
699 return RR->getKind() == RejectReasonKind::Alias;
700}
701
702//===----------------------------------------------------------------------===//
703// ReportOther.
704
705std::string ReportOther::getRemarkName() const { return "UnknownRejectReason"; }
706
707std::string ReportOther::getMessage() const { return "Unknown reject reason"; }
708
710
715
716//===----------------------------------------------------------------------===//
717// ReportIntToPtr.
720
721std::string ReportIntToPtr::getRemarkName() const { return "IntToPtr"; }
722
723const BasicBlock *ReportIntToPtr::getRemarkBB() const {
724 return BaseValue->getParent();
725}
726
727std::string ReportIntToPtr::getMessage() const {
728 return "Find bad intToptr prt: " + *BaseValue;
729}
730
731const DebugLoc &ReportIntToPtr::getDebugLoc() const {
732 return BaseValue->getDebugLoc();
733}
734
736 return RR->getKind() == RejectReasonKind::IntToPtr;
737}
738
739//===----------------------------------------------------------------------===//
740// ReportAlloca.
741
744
745std::string ReportAlloca::getRemarkName() const { return "Alloca"; }
746
747const BasicBlock *ReportAlloca::getRemarkBB() const {
748 return Inst->getParent();
749}
750
751std::string ReportAlloca::getMessage() const {
752 return "Alloca instruction: " + *Inst;
753}
754
755const DebugLoc &ReportAlloca::getDebugLoc() const {
756 return Inst->getDebugLoc();
757}
758
760 return RR->getKind() == RejectReasonKind::Alloca;
761}
762
763//===----------------------------------------------------------------------===//
764// ReportUnknownInst.
765
768
769std::string ReportUnknownInst::getRemarkName() const { return "UnknownInst"; }
770
771const BasicBlock *ReportUnknownInst::getRemarkBB() const {
772 return Inst->getParent();
773}
774
775std::string ReportUnknownInst::getMessage() const {
776 return "Unknown instruction: " + *Inst;
777}
778
779const DebugLoc &ReportUnknownInst::getDebugLoc() const {
780 return Inst->getDebugLoc();
781}
782
786
787//===----------------------------------------------------------------------===//
788// ReportEntry.
789
792
793std::string ReportEntry::getRemarkName() const { return "Entry"; }
794
795const BasicBlock *ReportEntry::getRemarkBB() const { return BB; }
796
797std::string ReportEntry::getMessage() const {
798 return "Region containing entry block of function is invalid!";
799}
800
802 return "Scop contains function entry (not yet supported).";
803}
804
805const DebugLoc &ReportEntry::getDebugLoc() const {
806 return BB->getTerminator()->getDebugLoc();
807}
808
810 return RR->getKind() == RejectReasonKind::Entry;
811}
812
813//===----------------------------------------------------------------------===//
814// ReportUnprofitable.
815
818
819std::string ReportUnprofitable::getRemarkName() const { return "Unprofitable"; }
820
821const BasicBlock *ReportUnprofitable::getRemarkBB() const {
822 return R->getEntry();
823}
824
826 return "Region can not profitably be optimized!";
827}
828
830 return "No profitable polyhedral optimization found";
831}
832
833const DebugLoc &ReportUnprofitable::getDebugLoc() const {
834 for (const BasicBlock *BB : R->blocks())
835 for (const Instruction &Inst : *BB)
836 if (const DebugLoc &DL = Inst.getStableDebugLoc())
837 return DL;
838
839 return R->getEntry()->getTerminator()->getDebugLoc();
840}
841
845
846//===----------------------------------------------------------------------===//
847// ReportIncompatibleType
848
851
853 return "IncompatibleType";
854}
855
856const BasicBlock *ReportIncompatibleType::getRemarkBB() const {
857 return Inst->getParent();
858}
859
861 return "Incompatible type: " + *Inst;
862}
863
864const DebugLoc &ReportIncompatibleType::getDebugLoc() const {
865 return Inst->getDebugLoc();
866}
867
869 return "Incompatible (non-fixed size) type: " + *Ty;
870}
871
875
876} // 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.
const RejectReasonKind Kind
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.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
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 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)
const BasicBlock * 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.
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 BasicBlock * 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 BasicBlock * 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.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
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 BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
ReportIncompatibleType(Instruction *Inst, llvm::Type *Ty)
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.
const BasicBlock * 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.
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 BasicBlock * 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.
std::string getRemarkName() const override
Generate the remark name to identify this remark.
static bool classof(const RejectReason *RR)
const BasicBlock * 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.
const BasicBlock * 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)
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.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing 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.
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 BasicBlock * 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.
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 BasicBlock * 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 BasicBlock * 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.
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.
const BasicBlock * 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 getRemarkName() const override
Generate the remark name to identify this remark.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
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)
std::string getRemarkName() const override
Generate the remark name to identify this remark.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const BasicBlock * 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.
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.
const BasicBlock * 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 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.
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.
std::string getMessage() const override
Generate a reasonable diagnostic message describing this error.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
const BasicBlock * 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.
static bool classof(const RejectReason *RR)
const BasicBlock * 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.
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 BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
static bool classof(const RejectReason *RR)
static bool classof(const RejectReason *RR)
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.
const BasicBlock * 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 getEndUserMessage() const override
Generate a message for the end-user describing this error.
const BasicBlock * getRemarkBB() const override
Get the Basic Block containing this remark.
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.
std::string getEndUserMessage() const override
Generate a message for the end-user describing this error.
const BasicBlock * 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.
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)
static bool operator<(const DebugLoc &LHS, const DebugLoc &RHS)
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.
@ Value
MemoryKind::Value: Models an llvm::Value.
Definition ScopInfo.h:149
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.
std::pair< llvm::BasicBlock *, llvm::BasicBlock * > BBPair
Type to hold region delimiters (entry & exit block).
Definition Utils.h:31