diff options
Diffstat (limited to 'llvm')
60 files changed, 212 insertions, 160 deletions
diff --git a/llvm/docs/YamlIO.rst b/llvm/docs/YamlIO.rst index c5079d8..4f523cb 100644 --- a/llvm/docs/YamlIO.rst +++ b/llvm/docs/YamlIO.rst @@ -807,7 +807,7 @@ Flow Mapping A YAML "flow mapping" is a mapping that uses the inline notation (e.g { x: 1, y: 0 } ) when written to YAML. To specify that a type should be written in YAML using flow mapping, your MappingTraits specialization should -add "static const bool flow = true;". For instance: +add ``static constexpr bool flow = true;``. For instance: .. code-block:: c++ @@ -824,7 +824,7 @@ add "static const bool flow = true;". For instance: ... } - static const bool flow = true; + static constexpr bool flow = true; } Flow mappings are subject to line wrapping according to the ``Output`` object @@ -859,7 +859,7 @@ Flow Sequence A YAML "flow sequence" is a sequence that when written to YAML it uses the inline notation (e.g [ foo, bar ] ). To specify that a sequence type should be written in YAML as a flow sequence, your SequenceTraits specialization should -add "static const bool flow = true;". For instance: +add ``static constexpr bool flow = true;``. For instance: .. code-block:: c++ @@ -869,7 +869,7 @@ add "static const bool flow = true;". For instance: static MyListEl &element(IO &io, MyList &list, size_t index) { ... } // The existence of this member causes YAML I/O to use a flow sequence - static const bool flow = true; + static constexpr bool flow = true; }; With the above, if you used MyList as the data type in your native data diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h index eb977fb..1c53291 100644 --- a/llvm/include/llvm/Analysis/DDG.h +++ b/llvm/include/llvm/Analysis/DDG.h @@ -96,7 +96,7 @@ public: RootDDGNode() : DDGNode(NodeKind::Root) {} RootDDGNode(const RootDDGNode &N) = delete; RootDDGNode(RootDDGNode &&N) : DDGNode(std::move(N)) {} - ~RootDDGNode() = default; + ~RootDDGNode() override = default; /// Define classof to be able to use isa<>, cast<>, dyn_cast<>, etc. static bool classof(const DDGNode *N) { @@ -114,7 +114,7 @@ public: SimpleDDGNode(Instruction &I); SimpleDDGNode(const SimpleDDGNode &N); SimpleDDGNode(SimpleDDGNode &&N); - ~SimpleDDGNode(); + ~SimpleDDGNode() override; SimpleDDGNode &operator=(const SimpleDDGNode &N) = default; @@ -176,7 +176,7 @@ public: PiBlockDDGNode(const PiNodeList &List); PiBlockDDGNode(const PiBlockDDGNode &N); PiBlockDDGNode(PiBlockDDGNode &&N); - ~PiBlockDDGNode(); + ~PiBlockDDGNode() override; PiBlockDDGNode &operator=(const PiBlockDDGNode &N) = default; @@ -318,7 +318,7 @@ public: : DDGBase(std::move(G)), DDGInfo(std::move(G)) {} DataDependenceGraph(Function &F, DependenceInfo &DI); DataDependenceGraph(Loop &L, LoopInfo &LI, DependenceInfo &DI); - ~DataDependenceGraph(); + ~DataDependenceGraph() override; /// If node \p N belongs to a pi-block return a pointer to the pi-block, /// otherwise return null. diff --git a/llvm/include/llvm/Analysis/InteractiveModelRunner.h b/llvm/include/llvm/Analysis/InteractiveModelRunner.h index 66473ae..cfa0506 100644 --- a/llvm/include/llvm/Analysis/InteractiveModelRunner.h +++ b/llvm/include/llvm/Analysis/InteractiveModelRunner.h @@ -51,7 +51,7 @@ public: Log->flush(); } - virtual ~InteractiveModelRunner(); + ~InteractiveModelRunner() override; private: void *evaluateUntyped() override; diff --git a/llvm/include/llvm/Analysis/MLInlineAdvisor.h b/llvm/include/llvm/Analysis/MLInlineAdvisor.h index cc4c482..d71fa55 100644 --- a/llvm/include/llvm/Analysis/MLInlineAdvisor.h +++ b/llvm/include/llvm/Analysis/MLInlineAdvisor.h @@ -33,7 +33,7 @@ public: GetModelRunner, std::function<bool(CallBase &)> GetDefaultAdvice); - virtual ~MLInlineAdvisor() = default; + ~MLInlineAdvisor() override = default; void onPassEntry(LazyCallGraph::SCC *SCC) override; void onPassExit(LazyCallGraph::SCC *SCC) override; @@ -105,7 +105,7 @@ class MLInlineAdvice : public InlineAdvice { public: MLInlineAdvice(MLInlineAdvisor *Advisor, CallBase &CB, OptimizationRemarkEmitter &ORE, bool Recommendation); - virtual ~MLInlineAdvice() = default; + ~MLInlineAdvice() override = default; void recordInliningImpl() override; void recordInliningWithCalleeDeletedImpl() override; diff --git a/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h b/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h index 641036d..ff423a9 100644 --- a/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h +++ b/llvm/include/llvm/Analysis/ReleaseModeModelRunner.h @@ -106,7 +106,7 @@ public: assert(ResultIndex >= 0 && "Cannot find DecisionName in inlining model"); } - virtual ~ReleaseModeModelRunner() = default; + ~ReleaseModeModelRunner() override = default; static bool classof(const MLModelRunner *R) { return R->getKind() == MLModelRunner::Kind::Release; diff --git a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h index 2966f0c..b7b816f 100644 --- a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h +++ b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h @@ -156,7 +156,7 @@ public: static char ID; StackSafetyGlobalInfoWrapperPass(); - ~StackSafetyGlobalInfoWrapperPass(); + ~StackSafetyGlobalInfoWrapperPass() override; const StackSafetyGlobalInfo &getResult() const { return SSGI; } diff --git a/llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h b/llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h index 03e93de..3895da2 100644 --- a/llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h +++ b/llvm/include/llvm/DWARFCFIChecker/DWARFCFIFunctionFrameAnalyzer.h @@ -32,7 +32,7 @@ class LLVM_ABI CFIFunctionFrameAnalyzer : public CFIFunctionFrameReceiver { public: CFIFunctionFrameAnalyzer(MCContext &Context, const MCInstrInfo &MCII) : CFIFunctionFrameReceiver(Context), MCII(MCII) {} - ~CFIFunctionFrameAnalyzer(); + ~CFIFunctionFrameAnalyzer() override; void startFunctionFrame(bool IsEH, ArrayRef<MCCFIInstruction> Prologue) override; diff --git a/llvm/include/llvm/DWARFLinker/Classic/DWARFStreamer.h b/llvm/include/llvm/DWARFLinker/Classic/DWARFStreamer.h index 03fc729..4ffef90 100644 --- a/llvm/include/llvm/DWARFLinker/Classic/DWARFStreamer.h +++ b/llvm/include/llvm/DWARFLinker/Classic/DWARFStreamer.h @@ -48,7 +48,7 @@ public: raw_pwrite_stream &OutFile, DWARFLinkerBase::MessageHandlerTy Warning) : OutFile(OutFile), OutFileType(OutFileType), WarningHandler(Warning) {} - virtual ~DwarfStreamer() = default; + ~DwarfStreamer() override = default; static Expected<std::unique_ptr<DwarfStreamer>> createStreamer( const Triple &TheTriple, DWARFLinkerBase::OutputFileType FileType, diff --git a/llvm/include/llvm/DWARFLinker/Parallel/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/Parallel/DWARFLinker.h index 8046513..db60695 100644 --- a/llvm/include/llvm/DWARFLinker/Parallel/DWARFLinker.h +++ b/llvm/include/llvm/DWARFLinker/Parallel/DWARFLinker.h @@ -120,7 +120,7 @@ using SectionHandlerTy = class DWARFLinker : public DWARFLinkerBase { public: - virtual ~DWARFLinker() = default; + ~DWARFLinker() override = default; /// Creates dwarf linker instance. LLVM_ABI static std::unique_ptr<DWARFLinker> diff --git a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h index a64a2e8..7af2ff1 100644 --- a/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h +++ b/llvm/include/llvm/DebugInfo/PDB/PDBTypes.h @@ -600,10 +600,7 @@ struct Variant { namespace std { template <> struct hash<llvm::pdb::PDB_SymType> { - using argument_type = llvm::pdb::PDB_SymType; - using result_type = std::size_t; - - result_type operator()(const argument_type &Arg) const { + std::size_t operator()(const llvm::pdb::PDB_SymType &Arg) const { return std::hash<int>()(static_cast<int>(Arg)); } }; diff --git a/llvm/include/llvm/Debuginfod/BuildIDFetcher.h b/llvm/include/llvm/Debuginfod/BuildIDFetcher.h index f0ecea1..8f9c2aa 100644 --- a/llvm/include/llvm/Debuginfod/BuildIDFetcher.h +++ b/llvm/include/llvm/Debuginfod/BuildIDFetcher.h @@ -24,7 +24,7 @@ class DebuginfodFetcher : public object::BuildIDFetcher { public: DebuginfodFetcher(std::vector<std::string> DebugFileDirectories) : BuildIDFetcher(std::move(DebugFileDirectories)) {} - virtual ~DebuginfodFetcher() = default; + ~DebuginfodFetcher() override = default; /// Fetches the given Build ID using debuginfod and returns a local path to /// the resulting file. diff --git a/llvm/include/llvm/IR/DroppedVariableStatsIR.h b/llvm/include/llvm/IR/DroppedVariableStatsIR.h index 3e18256..9fc2319 100644 --- a/llvm/include/llvm/IR/DroppedVariableStatsIR.h +++ b/llvm/include/llvm/IR/DroppedVariableStatsIR.h @@ -71,13 +71,12 @@ private: StringRef PassLevel); /// Override base class method to run on an llvm::Function specifically. - virtual void - visitEveryInstruction(unsigned &DroppedCount, - DenseMap<VarID, DILocation *> &InlinedAtsMap, - VarID Var) override; + void visitEveryInstruction(unsigned &DroppedCount, + DenseMap<VarID, DILocation *> &InlinedAtsMap, + VarID Var) override; /// Override base class method to run on #dbg_values specifically. - virtual void visitEveryDebugRecord( + void visitEveryDebugRecord( DenseSet<VarID> &VarIDSet, DenseMap<StringRef, DenseMap<VarID, DILocation *>> &InlinedAtsMap, StringRef FuncName, bool Before) override; diff --git a/llvm/include/llvm/IR/OptBisect.h b/llvm/include/llvm/IR/OptBisect.h index d813ae9..a8cd56f 100644 --- a/llvm/include/llvm/IR/OptBisect.h +++ b/llvm/include/llvm/IR/OptBisect.h @@ -51,7 +51,7 @@ public: /// through LLVMContext. OptBisect() = default; - virtual ~OptBisect() = default; + ~OptBisect() override = default; /// Checks the bisect limit to determine if the specified pass should run. /// diff --git a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h index 3700901..296a19c 100644 --- a/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h +++ b/llvm/include/llvm/MCA/HardwareUnits/LSUnit.h @@ -57,7 +57,7 @@ public: LSUnitBase(const MCSchedModel &SM, unsigned LoadQueueSize, unsigned StoreQueueSize, bool AssumeNoAlias); - virtual ~LSUnitBase(); + ~LSUnitBase() override; /// Returns the total number of entries in the load queue. unsigned getLoadQueueSize() const { return LQSize; } @@ -465,19 +465,19 @@ public: /// 6. A store has to wait until an older store barrier is fully executed. unsigned dispatch(const InstRef &IR) override; - virtual void onInstructionIssued(const InstRef &IR) override { + void onInstructionIssued(const InstRef &IR) override { unsigned GroupID = IR.getInstruction()->getLSUTokenID(); Groups[GroupID]->onInstructionIssued(IR); } - virtual void onInstructionRetired(const InstRef &IR) override; + void onInstructionRetired(const InstRef &IR) override; - virtual void onInstructionExecuted(const InstRef &IR) override; + void onInstructionExecuted(const InstRef &IR) override; - virtual void cycleEvent() override; + void cycleEvent() override; #ifndef NDEBUG - virtual void dump() const override; + void dump() const override; #endif private: diff --git a/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h b/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h index d88ee7c..958911d 100644 --- a/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h +++ b/llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h @@ -121,7 +121,7 @@ public: DefaultResourceStrategy(uint64_t UnitMask) : ResourceUnitMask(UnitMask), NextInSequenceMask(UnitMask), RemovedFromNextInSequence(0) {} - virtual ~DefaultResourceStrategy() = default; + ~DefaultResourceStrategy() override = default; uint64_t select(uint64_t ReadyMask) override; void used(uint64_t Mask) override; diff --git a/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h b/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h index 0372600..34ff155 100644 --- a/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h +++ b/llvm/include/llvm/MCA/HardwareUnits/Scheduler.h @@ -47,7 +47,7 @@ class LLVM_ABI DefaultSchedulerStrategy : public SchedulerStrategy { public: DefaultSchedulerStrategy() = default; - virtual ~DefaultSchedulerStrategy(); + ~DefaultSchedulerStrategy() override; bool compare(const InstRef &Lhs, const InstRef &Rhs) const override { int LhsRank = computeRank(Lhs); diff --git a/llvm/include/llvm/MCA/View.h b/llvm/include/llvm/MCA/View.h index 4d6f930..5b2e546 100644 --- a/llvm/include/llvm/MCA/View.h +++ b/llvm/include/llvm/MCA/View.h @@ -26,7 +26,7 @@ namespace mca { class LLVM_ABI View : public HWEventListener { public: - virtual ~View() = default; + ~View() override = default; virtual void printView(llvm::raw_ostream &OS) const = 0; virtual StringRef getNameAsString() const = 0; diff --git a/llvm/include/llvm/ObjCopy/ConfigManager.h b/llvm/include/llvm/ObjCopy/ConfigManager.h index 27fbd96..1568799 100644 --- a/llvm/include/llvm/ObjCopy/ConfigManager.h +++ b/llvm/include/llvm/ObjCopy/ConfigManager.h @@ -23,7 +23,7 @@ namespace llvm { namespace objcopy { struct LLVM_ABI ConfigManager : public MultiFormatConfig { - virtual ~ConfigManager() {} + ~ConfigManager() override {} const CommonConfig &getCommonConfig() const override { return Common; } diff --git a/llvm/include/llvm/Object/GOFFObjectFile.h b/llvm/include/llvm/Object/GOFFObjectFile.h index b6b22ee..80da64e 100644 --- a/llvm/include/llvm/Object/GOFFObjectFile.h +++ b/llvm/include/llvm/Object/GOFFObjectFile.h @@ -91,10 +91,10 @@ private: // SectionRef. void moveSectionNext(DataRefImpl &Sec) const override; - virtual Expected<StringRef> getSectionName(DataRefImpl Sec) const override; + Expected<StringRef> getSectionName(DataRefImpl Sec) const override; uint64_t getSectionAddress(DataRefImpl Sec) const override; uint64_t getSectionSize(DataRefImpl Sec) const override; - virtual Expected<ArrayRef<uint8_t>> + Expected<ArrayRef<uint8_t>> getSectionContents(DataRefImpl Sec) const override; uint64_t getSectionIndex(DataRefImpl Sec) const override { return Sec.d.a; } uint64_t getSectionAlignment(DataRefImpl Sec) const override; diff --git a/llvm/include/llvm/ProfileData/MemProfReader.h b/llvm/include/llvm/ProfileData/MemProfReader.h index 25578ec..8fdae7a 100644 --- a/llvm/include/llvm/ProfileData/MemProfReader.h +++ b/llvm/include/llvm/ProfileData/MemProfReader.h @@ -110,7 +110,7 @@ class LLVM_ABI RawMemProfReader final : public MemProfReader { public: RawMemProfReader(const RawMemProfReader &) = delete; RawMemProfReader &operator=(const RawMemProfReader &) = delete; - virtual ~RawMemProfReader() override; + ~RawMemProfReader() override; // Prints the contents of the profile in YAML format. void printYAML(raw_ostream &OS); diff --git a/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h b/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h index 7031728..6733e1c 100644 --- a/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h +++ b/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h @@ -92,7 +92,7 @@ public: PGOCtxProfileWriter(raw_ostream &Out, std::optional<unsigned> VersionOverride = std::nullopt, bool IncludeEmpty = false); - ~PGOCtxProfileWriter() { Writer.ExitBlock(); } + ~PGOCtxProfileWriter() override { Writer.ExitBlock(); } void startContextSection() override; void writeContextual(const ctx_profile::ContextNode &RootNode, diff --git a/llvm/include/llvm/SandboxIR/BasicBlock.h b/llvm/include/llvm/SandboxIR/BasicBlock.h index 25bbb6c..a8dd508 100644 --- a/llvm/include/llvm/SandboxIR/BasicBlock.h +++ b/llvm/include/llvm/SandboxIR/BasicBlock.h @@ -78,7 +78,7 @@ class BasicBlock : public Value { } public: - ~BasicBlock() = default; + ~BasicBlock() override = default; /// For isa/dyn_cast. static bool classof(const Value *From) { return From->getSubclassID() == Value::ClassID::Block; diff --git a/llvm/include/llvm/SandboxIR/PassManager.h b/llvm/include/llvm/SandboxIR/PassManager.h index 6fccaf0..93ca710 100644 --- a/llvm/include/llvm/SandboxIR/PassManager.h +++ b/llvm/include/llvm/SandboxIR/PassManager.h @@ -49,7 +49,7 @@ protected: } PassManager(const PassManager &) = delete; PassManager(PassManager &&) = default; - virtual ~PassManager() = default; + ~PassManager() override = default; PassManager &operator=(const PassManager &) = delete; public: diff --git a/llvm/include/llvm/Target/TargetLoweringObjectFile.h b/llvm/include/llvm/Target/TargetLoweringObjectFile.h index 4d6cbc5..06508bf 100644 --- a/llvm/include/llvm/Target/TargetLoweringObjectFile.h +++ b/llvm/include/llvm/Target/TargetLoweringObjectFile.h @@ -74,7 +74,7 @@ public: TargetLoweringObjectFile(const TargetLoweringObjectFile &) = delete; TargetLoweringObjectFile & operator=(const TargetLoweringObjectFile &) = delete; - virtual ~TargetLoweringObjectFile(); + ~TargetLoweringObjectFile() override; Mangler &getMangler() const { return *Mang; } diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h index e57032a..a013f27 100644 --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -3325,7 +3325,7 @@ struct LLVM_ABI AbstractAttribute : public IRPosition, public AADepGraphNode { AbstractAttribute(const IRPosition &IRP) : IRPosition(IRP) {} /// Virtual destructor. - virtual ~AbstractAttribute() = default; + ~AbstractAttribute() override = default; /// Compile time access to the IR attribute kind. static constexpr Attribute::AttrKind IRAttributeKind = Attribute::None; @@ -5588,7 +5588,7 @@ struct AACallEdges : public StateWrapper<BooleanState, AbstractAttribute>, // Synthetic root node for the Attributor's internal call graph. struct AttributorCallGraph : public AACallGraphNode { AttributorCallGraph(Attributor &A) : AACallGraphNode(A) {} - virtual ~AttributorCallGraph() = default; + ~AttributorCallGraph() override = default; AACallEdgeIterator optimisticEdgesBegin() const override { return AACallEdgeIterator(A, A.Functions.begin()); diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h index 7d02d9a..588a6eb 100644 --- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h +++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h @@ -305,7 +305,7 @@ public: return make_range(MemSuccs.begin(), MemSuccs.end()); } #ifndef NDEBUG - virtual void print(raw_ostream &OS, bool PrintDeps = true) const override; + void print(raw_ostream &OS, bool PrintDeps = true) const override; #endif // NDEBUG }; diff --git a/llvm/include/llvm/XRay/FDRRecords.h b/llvm/include/llvm/XRay/FDRRecords.h index 91689cae..8a12e33 100644 --- a/llvm/include/llvm/XRay/FDRRecords.h +++ b/llvm/include/llvm/XRay/FDRRecords.h @@ -101,7 +101,7 @@ public: MetadataType metadataType() const { return MT; } - virtual ~MetadataRecord() = default; + ~MetadataRecord() override = default; }; // What follows are specific Metadata record types which encapsulate the diff --git a/llvm/include/llvm/XRay/FDRTraceWriter.h b/llvm/include/llvm/XRay/FDRTraceWriter.h index 957039d..dc68c7f 100644 --- a/llvm/include/llvm/XRay/FDRTraceWriter.h +++ b/llvm/include/llvm/XRay/FDRTraceWriter.h @@ -30,7 +30,7 @@ class LLVM_ABI FDRTraceWriter : public RecordVisitor { public: // Construct an FDRTraceWriter associated with an output stream. explicit FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H); - ~FDRTraceWriter(); + ~FDRTraceWriter() override; Error visit(BufferExtents &) override; Error visit(WallclockRecord &) override; diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index c4fee39..5169b43 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -1242,7 +1242,7 @@ public: return std::nullopt; } - virtual ~InlineCostCallAnalyzer() = default; + ~InlineCostCallAnalyzer() override = default; int getThreshold() const { return Threshold; } int getCost() const { return Cost; } int getStaticBonusApplied() const { return StaticBonusApplied; } diff --git a/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp b/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp index 12a784e..11ca48d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp @@ -18,8 +18,7 @@ using namespace llvm; unsigned AddressPool::getIndex(const MCSymbol *Sym, bool TLS) { resetUsedFlag(true); - auto IterBool = - Pool.insert(std::make_pair(Sym, AddressPoolEntry(Pool.size(), TLS))); + auto IterBool = Pool.try_emplace(Sym, Pool.size(), TLS); return IterBool.first->second.Number; } diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp index 93ae548..7bef3a8 100644 --- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp +++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp @@ -86,10 +86,7 @@ template <> struct llvm::DenseMapInfo<VariableID> { using VarLocInsertPt = PointerUnion<const Instruction *, const DbgRecord *>; template <> struct std::hash<VarLocInsertPt> { - using argument_type = VarLocInsertPt; - using result_type = std::size_t; - - result_type operator()(const argument_type &Arg) const { + std::size_t operator()(const VarLocInsertPt &Arg) const { return std::hash<void *>()(Arg.getOpaqueValue()); } }; diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp index 8e48d19..109444b 100644 --- a/llvm/lib/CodeGen/TailDuplicator.cpp +++ b/llvm/lib/CodeGen/TailDuplicator.cpp @@ -363,7 +363,7 @@ void TailDuplicator::processPHI( Register SrcReg = MI->getOperand(SrcOpIdx).getReg(); unsigned SrcSubReg = MI->getOperand(SrcOpIdx).getSubReg(); const TargetRegisterClass *RC = MRI->getRegClass(DefReg); - LocalVRMap.insert(std::make_pair(DefReg, RegSubRegPair(SrcReg, SrcSubReg))); + LocalVRMap.try_emplace(DefReg, SrcReg, SrcSubReg); // Insert a copy from source to the end of the block. The def register is the // available value liveout of the block. @@ -411,7 +411,7 @@ void TailDuplicator::duplicateInstruction( const TargetRegisterClass *RC = MRI->getRegClass(Reg); Register NewReg = MRI->createVirtualRegister(RC); MO.setReg(NewReg); - LocalVRMap.insert(std::make_pair(Reg, RegSubRegPair(NewReg, 0))); + LocalVRMap.try_emplace(Reg, NewReg, 0); if (isDefLiveOut(Reg, TailBB, MRI) || UsedByPhi.count(Reg)) addSSAUpdateEntry(Reg, NewReg, PredBB); continue; @@ -463,7 +463,7 @@ void TailDuplicator::duplicateInstruction( NewReg) .addReg(VI->second.Reg, 0, VI->second.SubReg); LocalVRMap.erase(VI); - LocalVRMap.insert(std::make_pair(Reg, RegSubRegPair(NewReg, 0))); + LocalVRMap.try_emplace(Reg, NewReg, 0); MO.setReg(NewReg); // The composed VI.Reg:VI.SubReg is replaced with NewReg, which // is equivalent to the whole register Reg. Hence, Reg:subreg diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 1096e57..3c222f5 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -843,7 +843,7 @@ public: SlotTracker(const SlotTracker &) = delete; SlotTracker &operator=(const SlotTracker &) = delete; - ~SlotTracker() = default; + ~SlotTracker() override = default; void setProcessHook( std::function<void(AbstractSlotTrackerStorage *, const Module *, bool)>); @@ -5323,7 +5323,7 @@ struct MDTreeAsmWriterContext : public AsmWriterContext { --Level; } - ~MDTreeAsmWriterContext() { + ~MDTreeAsmWriterContext() override { for (const auto &Entry : Buffer) { MainOS << "\n"; unsigned NumIndent = Entry.first * 2U; diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp index 4bc2a18..b618222 100644 --- a/llvm/lib/LTO/LTO.cpp +++ b/llvm/lib/LTO/LTO.cpp @@ -1711,7 +1711,7 @@ public: /*ShouldEmitImportsFiles=*/false), IRFiles(std::move(IRFiles)), CombinedCGDataHash(CombinedCGDataHash) {} - virtual Error runThinLTOBackendThread( + Error runThinLTOBackendThread( AddStreamFn AddStream, FileCache Cache, unsigned Task, BitcodeModule BM, ModuleSummaryIndex &CombinedIndex, const FunctionImporter::ImportMapTy &ImportList, @@ -2271,8 +2271,8 @@ public: RemoteCompilerPrependArgs(RemoteCompilerPrependArgs), RemoteCompilerArgs(RemoteCompilerArgs), SaveTemps(SaveTemps) {} - virtual void setup(unsigned ThinLTONumTasks, unsigned ThinLTOTaskOffset, - llvm::Triple Triple) override { + void setup(unsigned ThinLTONumTasks, unsigned ThinLTOTaskOffset, + llvm::Triple Triple) override { UID = itostr(sys::Process::getProcessId()); Jobs.resize((size_t)ThinLTONumTasks); this->ThinLTOTaskOffset = ThinLTOTaskOffset; diff --git a/llvm/lib/ObjCopy/ELF/ELFObject.h b/llvm/lib/ObjCopy/ELF/ELFObject.h index 7ec0e9b..4f6473f 100644 --- a/llvm/lib/ObjCopy/ELF/ELFObject.h +++ b/llvm/lib/ObjCopy/ELF/ELFObject.h @@ -109,7 +109,7 @@ protected: WritableMemoryBuffer &Out; public: - virtual ~SectionWriter() = default; + ~SectionWriter() override = default; Error visit(const Section &Sec) override; Error visit(const OwnedDataSection &Sec) override; @@ -134,7 +134,7 @@ private: using Elf_Sym = typename ELFT::Sym; public: - virtual ~ELFSectionWriter() {} + ~ELFSectionWriter() override {} Error visit(const SymbolTableSection &Sec) override; Error visit(const RelocationSection &Sec) override; Error visit(const GnuDebugLinkSection &Sec) override; @@ -180,7 +180,7 @@ public: class BinarySectionWriter : public SectionWriter { public: - virtual ~BinarySectionWriter() {} + ~BinarySectionWriter() override {} Error visit(const SymbolTableSection &Sec) override; Error visit(const RelocationSection &Sec) override; @@ -346,7 +346,7 @@ private: size_t totalSize() const; public: - virtual ~ELFWriter() {} + ~ELFWriter() override {} bool WriteSectionHeaders; // For --only-keep-debug, select an alternative section/segment layout @@ -367,7 +367,7 @@ private: uint64_t TotalSize = 0; public: - ~BinaryWriter() {} + ~BinaryWriter() override {} Error finalize() override; Error write() override; BinaryWriter(Object &Obj, raw_ostream &Out, const CommonConfig &Config) @@ -784,7 +784,7 @@ private: SymbolTableSection *Symbols = nullptr; public: - virtual ~SectionIndexSection() {} + ~SectionIndexSection() override {} void addIndex(uint32_t Index) { assert(Size > 0); Indexes.push_back(Index); diff --git a/llvm/lib/ObjectYAML/GOFFEmitter.cpp b/llvm/lib/ObjectYAML/GOFFEmitter.cpp index c26893c..82800b1 100644 --- a/llvm/lib/ObjectYAML/GOFFEmitter.cpp +++ b/llvm/lib/ObjectYAML/GOFFEmitter.cpp @@ -71,7 +71,7 @@ public: SetBufferSize(GOFF::PayloadLength); } - ~GOFFOstream() { finalize(); } + ~GOFFOstream() override { finalize(); } void makeNewRecord(GOFF::RecordType Type, size_t Size) { fillRecord(); diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 4787604..e21cf8e 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -5354,7 +5354,7 @@ APInt DoubleAPFloat::bitcastToAPInt() const { Floats[0].bitcastToAPInt().getRawData()[0], Floats[1].bitcastToAPInt().getRawData()[0], }; - return APInt(128, 2, Data); + return APInt(128, Data); } Expected<APFloat::opStatus> DoubleAPFloat::convertFromString(StringRef S, @@ -5643,8 +5643,7 @@ APFloat::opStatus DoubleAPFloat::convertFromUnsignedParts( // Create a minimally-sized APInt to represent the source value. const unsigned SrcBitWidth = SrcMSB + 1; - APSInt SrcInt{APInt{/*numBits=*/SrcBitWidth, - /*numWords=*/SrcCount, Src}, + APSInt SrcInt{APInt{/*numBits=*/SrcBitWidth, ArrayRef(Src, SrcCount)}, /*isUnsigned=*/true}; // Stage 1: Initial Approximation. diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp index 6d16599..5048561 100644 --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -1044,15 +1044,13 @@ struct AAPointerInfoImpl return AAPointerInfo::manifest(A); } - virtual const_bin_iterator begin() const override { return State::begin(); } - virtual const_bin_iterator end() const override { return State::end(); } - virtual int64_t numOffsetBins() const override { - return State::numOffsetBins(); - } - virtual bool reachesReturn() const override { + const_bin_iterator begin() const override { return State::begin(); } + const_bin_iterator end() const override { return State::end(); } + int64_t numOffsetBins() const override { return State::numOffsetBins(); } + bool reachesReturn() const override { return !ReturnedOffsets.isUnassigned(); } - virtual void addReturnedOffsetsTo(OffsetInfo &OI) const override { + void addReturnedOffsetsTo(OffsetInfo &OI) const override { if (ReturnedOffsets.isUnknown()) { OI.setUnknown(); return; @@ -6653,7 +6651,7 @@ struct AAHeapToStackFunction final : public AAHeapToStack { AAHeapToStackFunction(const IRPosition &IRP, Attributor &A) : AAHeapToStack(IRP, A) {} - ~AAHeapToStackFunction() { + ~AAHeapToStackFunction() override { // Ensure we call the destructor so we release any memory allocated in the // sets. for (auto &It : AllocationInfos) @@ -8374,7 +8372,7 @@ struct AAMemoryLocationImpl : public AAMemoryLocation { AccessKind2Accesses.fill(nullptr); } - ~AAMemoryLocationImpl() { + ~AAMemoryLocationImpl() override { // The AccessSets are allocated via a BumpPtrAllocator, we call // the destructor manually. for (AccessSet *AS : AccessKind2Accesses) diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp index 5e2247f..d7eb745 100644 --- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp +++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp @@ -2693,7 +2693,7 @@ struct AAExecutionDomainFunction : public AAExecutionDomain { AAExecutionDomainFunction(const IRPosition &IRP, Attributor &A) : AAExecutionDomain(IRP, A) {} - ~AAExecutionDomainFunction() { delete RPOT; } + ~AAExecutionDomainFunction() override { delete RPOT; } void initialize(Attributor &A) override { Function *F = getAnchorScope(); diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index ede73f8..9c75d9a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -72,7 +72,7 @@ public: : InstCombiner(Worklist, Builder, F, AA, AC, TLI, TTI, DT, ORE, BFI, BPI, PSI, DL, RPOT) {} - virtual ~InstCombinerImpl() = default; + ~InstCombinerImpl() override = default; /// Perform early cleanup and prepare the InstCombine worklist. bool prepareWorklist(Function &F); diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index cdb9e7e..4fcaf6d 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -17641,12 +17641,28 @@ Instruction &BoUpSLP::getLastInstructionInBundle(const TreeEntry *E) { [](Value *V) { return !isa<GetElementPtrInst>(V) && isa<Instruction>(V); })) || - all_of(E->Scalars, [&](Value *V) { - return isa<PoisonValue>(V) || - (E->Idx == 0 && isa<InsertElementInst>(V)) || - E->isCopyableElement(V) || - (!isVectorLikeInstWithConstOps(V) && isUsedOutsideBlock(V)); - })) + (all_of(E->Scalars, + [&](Value *V) { + return isa<PoisonValue>(V) || + (E->Idx == 0 && isa<InsertElementInst>(V)) || + E->isCopyableElement(V) || + (!isVectorLikeInstWithConstOps(V) && + isUsedOutsideBlock(V)); + }) && + (!E->doesNotNeedToSchedule() || + any_of(E->Scalars, + [&](Value *V) { + if (!isa<Instruction>(V) || + (E->hasCopyableElements() && E->isCopyableElement(V))) + return false; + return !areAllOperandsNonInsts(V); + }) || + none_of(E->Scalars, [&](Value *V) { + if (!isa<Instruction>(V) || + (E->hasCopyableElements() && E->isCopyableElement(V))) + return false; + return MustGather.contains(V); + })))) Res = FindLastInst(); else Res = FindFirstInst(); diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index 2591df8..5b9f005 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -398,7 +398,7 @@ public: DebugLoc DL = DebugLoc::getUnknown()) : VPDef(SC), VPUser(Operands), DL(DL) {} - virtual ~VPRecipeBase() = default; + ~VPRecipeBase() override = default; /// Clone the current recipe. virtual VPRecipeBase *clone() = 0; @@ -576,7 +576,7 @@ public: return R && classof(R); } - virtual VPSingleDefRecipe *clone() override = 0; + VPSingleDefRecipe *clone() override = 0; /// Returns the underlying instruction. Instruction *getUnderlyingInstr() { @@ -907,7 +907,7 @@ struct VPRecipeWithIRFlags : public VPSingleDefRecipe, public VPIRFlags { return R && classof(R); } - virtual VPRecipeWithIRFlags *clone() override = 0; + VPRecipeWithIRFlags *clone() override = 0; static inline bool classof(const VPSingleDefRecipe *U) { auto *R = dyn_cast<VPRecipeBase>(U); @@ -2068,7 +2068,7 @@ public: return classof(static_cast<const VPRecipeBase *>(R)); } - virtual void execute(VPTransformState &State) override = 0; + void execute(VPTransformState &State) override = 0; /// Returns the step value of the induction. VPValue *getStepValue() { return getOperand(1); } @@ -2557,7 +2557,7 @@ public: VPCostContext &Ctx) const override; /// Returns true if the recipe only uses the first lane of operand \p Op. - virtual bool onlyFirstLaneUsed(const VPValue *Op) const override = 0; + bool onlyFirstLaneUsed(const VPValue *Op) const override = 0; /// Returns the number of stored operands of this interleave group. Returns 0 /// for load interleave groups. diff --git a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-reused-with-bv-subvector.ll b/llvm/test/Transforms/SLPVectorizer/X86/buildvector-reused-with-bv-subvector.ll index ff0887c..fbf6323 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/buildvector-reused-with-bv-subvector.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/buildvector-reused-with-bv-subvector.ll @@ -6,9 +6,9 @@ define void @test(ptr %0, i64 %1, i64 %2) { ; CHECK-SAME: ptr [[TMP0:%.*]], i64 [[TMP1:%.*]], i64 [[TMP2:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x ptr> poison, ptr [[TMP0]], i32 0 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x ptr> [[TMP4]], <4 x ptr> poison, <4 x i32> zeroinitializer -; CHECK-NEXT: [[TMP6:%.*]] = ptrtoint <4 x ptr> [[TMP5]] to <4 x i64> ; CHECK-NEXT: [[TMP7:%.*]] = ptrtoint <4 x ptr> [[TMP5]] to <4 x i64> ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <4 x i64> [[TMP7]], <4 x i64> poison, <8 x i32> <i32 0, i32 0, i32 1, i32 2, i32 2, i32 1, i32 3, i32 1> +; CHECK-NEXT: [[TMP6:%.*]] = ptrtoint <4 x ptr> [[TMP5]] to <4 x i64> ; CHECK-NEXT: br [[DOTPREHEADER_LR_PH:label %.*]] ; CHECK: [[_PREHEADER_LR_PH:.*:]] ; CHECK-NEXT: br [[DOTPREHEADER_US_US_PREHEADER:label %.*]] diff --git a/llvm/test/Transforms/SLPVectorizer/X86/entry-no-bundle-but-extra-use-on-vec.ll b/llvm/test/Transforms/SLPVectorizer/X86/entry-no-bundle-but-extra-use-on-vec.ll index bfb623a..6d713e8 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/entry-no-bundle-but-extra-use-on-vec.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/entry-no-bundle-but-extra-use-on-vec.ll @@ -9,11 +9,11 @@ define void @test(ptr %nExp, float %0, i1 %cmp, float %1) { ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x float> [[TMP2]], float [[TMP0]], i32 3 ; CHECK-NEXT: br i1 [[CMP]], label %[[IF_THEN:.*]], label %[[IF_END:.*]] ; CHECK: [[IF_THEN]]: -; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[NEXP]], align 4 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x float> [[TMP3]], <4 x float> poison, <2 x i32> <i32 3, i32 3> +; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x float> [[TMP5]], zeroinitializer +; CHECK-NEXT: [[TMP4:%.*]] = load float, ptr [[NEXP]], align 4 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x float> [[TMP5]], float [[TMP4]], i32 0 ; CHECK-NEXT: [[TMP7:%.*]] = fmul <2 x float> [[TMP6]], zeroinitializer -; CHECK-NEXT: [[TMP8:%.*]] = fmul <2 x float> [[TMP5]], zeroinitializer ; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x float> <float poison, float 0.000000e+00, float 0.000000e+00, float poison>, float [[TMP1]], i32 3 ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <2 x float> [[TMP8]], <2 x float> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison> ; CHECK-NEXT: [[TMP11:%.*]] = shufflevector <4 x float> [[TMP9]], <4 x float> [[TMP10]], <4 x i32> <i32 4, i32 1, i32 2, i32 3> diff --git a/llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-extern-use.ll b/llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-extern-use.ll new file mode 100644 index 0000000..ec554b4 --- /dev/null +++ b/llvm/test/Transforms/SLPVectorizer/X86/non-scheduled-inst-extern-use.ll @@ -0,0 +1,45 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6 +; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -slp-threshold=-100 < %s | FileCheck %s + +define void @test(i32 %arg) { +; CHECK-LABEL: define void @test( +; CHECK-SAME: i32 [[ARG:%.*]]) { +; CHECK-NEXT: [[BB:.*:]] +; CHECK-NEXT: br label %[[BB1:.*]] +; CHECK: [[BB1]]: +; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 [[ARG]], i32 0 +; CHECK-NEXT: [[TMP1:%.*]] = sub <4 x i32> zeroinitializer, [[TMP0]] +; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, <4 x i32> <i32 0, i32 5, i32 6, i32 7> +; CHECK-NEXT: [[TMP3:%.*]] = add <4 x i32> zeroinitializer, [[TMP2]] +; CHECK-NEXT: br i1 false, label %[[BB8:.*]], label %[[BB4:.*]] +; CHECK: [[BB4]]: +; CHECK-NEXT: [[TMP4:%.*]] = add <4 x i32> zeroinitializer, [[TMP3]] +; CHECK-NEXT: br label %[[BB8]] +; CHECK: [[BB8]]: +; CHECK-NEXT: [[TMP5:%.*]] = phi <4 x i32> [ [[TMP4]], %[[BB4]] ], [ [[TMP1]], %[[BB1]] ] +; CHECK-NEXT: ret void +; +bb: + br label %bb1 + +bb1: + %sub = sub i32 0, %arg + %add = add i32 0, 0 + %add2 = add i32 0, 0 + %add3 = add i32 0, 0 + br i1 false, label %bb8, label %bb4 + +bb4: + %add5 = add i32 %add3, 0 + %add6 = add i32 0, 0 + %add7 = add i32 0, 0 + br label %bb8 + +bb8: + %phi = phi i32 [ %sub, %bb4 ], [ %sub, %bb1 ] + %phi9 = phi i32 [ %add5, %bb4 ], [ %add, %bb1 ] + %phi10 = phi i32 [ %add6, %bb4 ], [ %add2, %bb1 ] + %phi11 = phi i32 [ %add7, %bb4 ], [ %add3, %bb1 ] + ret void +} + diff --git a/llvm/test/Transforms/SLPVectorizer/X86/parent-node-non-schedulable.ll b/llvm/test/Transforms/SLPVectorizer/X86/parent-node-non-schedulable.ll index 7c8cb02..2623366 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/parent-node-non-schedulable.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/parent-node-non-schedulable.ll @@ -5,11 +5,11 @@ define void @test(ptr %0, i64 %1, i64 %2, i1 %3, i64 %4, i64 %5) { ; CHECK-LABEL: define void @test( ; CHECK-SAME: ptr [[TMP0:%.*]], i64 [[TMP1:%.*]], i64 [[TMP2:%.*]], i1 [[TMP3:%.*]], i64 [[TMP4:%.*]], i64 [[TMP5:%.*]]) #[[ATTR0:[0-9]+]] { ; CHECK-NEXT: [[TMP7:%.*]] = getelementptr i8, ptr [[TMP0]], i32 240 -; CHECK-NEXT: [[TMP8:%.*]] = getelementptr i8, ptr [[TMP0]], i32 128 ; CHECK-NEXT: [[TMP9:%.*]] = insertelement <4 x i64> poison, i64 [[TMP1]], i32 0 ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <4 x i64> [[TMP9]], <4 x i64> poison, <4 x i32> zeroinitializer ; CHECK-NEXT: [[TMP11:%.*]] = insertelement <4 x i64> <i64 1, i64 1, i64 1, i64 poison>, i64 [[TMP2]], i32 3 ; CHECK-NEXT: [[TMP12:%.*]] = add <4 x i64> [[TMP10]], [[TMP11]] +; CHECK-NEXT: [[TMP8:%.*]] = getelementptr i8, ptr [[TMP0]], i32 128 ; CHECK-NEXT: [[TMP13:%.*]] = load <2 x i64>, ptr [[TMP7]], align 4 ; CHECK-NEXT: [[TMP14:%.*]] = load i64, ptr null, align 4 ; CHECK-NEXT: [[TMP15:%.*]] = load <2 x i64>, ptr [[TMP8]], align 4 diff --git a/llvm/test/Transforms/SLPVectorizer/X86/same-last-instruction-different-parents.ll b/llvm/test/Transforms/SLPVectorizer/X86/same-last-instruction-different-parents.ll index ef75a8d..88e2cca 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/same-last-instruction-different-parents.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/same-last-instruction-different-parents.ll @@ -10,13 +10,13 @@ define i32 @test(i32 %0, i1 %1) { ; CHECK-NEXT: [[TMP6:%.*]] = sitofp <2 x i32> [[TMP4]] to <2 x double> ; CHECK-NEXT: br i1 [[TMP1]], label %[[BB7:.*]], label %[[BB9:.*]] ; CHECK: [[BB7]]: -; CHECK-NEXT: [[TMP8:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP6]], <2 x double> zeroinitializer, <2 x double> zeroinitializer) +; CHECK-NEXT: [[TMP8:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP5]], <2 x double> zeroinitializer, <2 x double> zeroinitializer) ; CHECK-NEXT: br label %[[BB16:.*]] ; CHECK: [[BB9]]: ; CHECK-NEXT: br i1 false, label %[[BB14:.*]], label %[[BB10:.*]] ; CHECK: [[BB10]]: -; CHECK-NEXT: [[TMP11:%.*]] = call <2 x double> @llvm.copysign.v2f64(<2 x double> zeroinitializer, <2 x double> [[TMP5]]) -; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <2 x double> [[TMP6]], <2 x double> <double 0.000000e+00, double poison>, <2 x i32> <i32 2, i32 1> +; CHECK-NEXT: [[TMP11:%.*]] = call <2 x double> @llvm.copysign.v2f64(<2 x double> zeroinitializer, <2 x double> [[TMP6]]) +; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <2 x double> [[TMP5]], <2 x double> <double 0.000000e+00, double poison>, <2 x i32> <i32 2, i32 1> ; CHECK-NEXT: [[TMP13:%.*]] = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[TMP11]], <2 x double> [[TMP12]], <2 x double> zeroinitializer) ; CHECK-NEXT: br label %[[BB14]] ; CHECK: [[BB14]]: diff --git a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp index 5dae6c0..b4437f7 100644 --- a/llvm/tools/llvm-exegesis/lib/X86/Target.cpp +++ b/llvm/tools/llvm-exegesis/lib/X86/Target.cpp @@ -666,7 +666,7 @@ public: #endif } - ~X86SavedState() { + ~X86SavedState() override { // Restoring the X87 state does not flush pending exceptions, make sure // these exceptions are flushed now. #if defined(_MSC_VER) && defined(_M_X64) && !defined(_M_ARM64EC) diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink-statistics.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink-statistics.cpp index 1179795..71eb422 100644 --- a/llvm/tools/llvm-jitlink/llvm-jitlink-statistics.cpp +++ b/llvm/tools/llvm-jitlink/llvm-jitlink-statistics.cpp @@ -52,7 +52,7 @@ public: S.ObjLayer.addPlugin(std::move(Instance)); } - ~StatsPlugin() { publish(dbgs()); } + ~StatsPlugin() override { publish(dbgs()); } void publish(raw_ostream &OS); diff --git a/llvm/tools/llvm-mca/Views/InstructionView.h b/llvm/tools/llvm-mca/Views/InstructionView.h index ae57246..fbaa527 100644 --- a/llvm/tools/llvm-mca/Views/InstructionView.h +++ b/llvm/tools/llvm-mca/Views/InstructionView.h @@ -38,7 +38,7 @@ public: llvm::MCInstPrinter &Printer, llvm::ArrayRef<llvm::MCInst> S) : STI(STI), MCIP(Printer), Source(S), InstrStream(InstructionString) {} - virtual ~InstructionView(); + ~InstructionView() override; StringRef getNameAsString() const override { return "Instructions"; } diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index 9c9b2dd..423a11f 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -795,7 +795,7 @@ public: void printFileSummary(StringRef FileStr, ObjectFile &Obj, ArrayRef<std::string> InputFilenames, const Archive *A) override; - virtual void printZeroSymbolOtherField(const Elf_Sym &Symbol) const override; + void printZeroSymbolOtherField(const Elf_Sym &Symbol) const override; void printDefaultRelRelaReloc(const Relocation<ELFT> &R, StringRef SymbolName, diff --git a/llvm/unittests/ADT/APFloatTest.cpp b/llvm/unittests/ADT/APFloatTest.cpp index 30f0a8e5..fbe96bb 100644 --- a/llvm/unittests/ADT/APFloatTest.cpp +++ b/llvm/unittests/ADT/APFloatTest.cpp @@ -5062,8 +5062,8 @@ TEST(APFloatTest, PPCDoubleDoubleAddSpecial) { std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected, RM) = Tp; { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.add(A2, RM); EXPECT_EQ(Expected, A1.getCategory()) @@ -5072,8 +5072,8 @@ TEST(APFloatTest, PPCDoubleDoubleAddSpecial) { .str(); } { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A2.add(A1, RM); EXPECT_EQ(Expected, A2.getCategory()) @@ -5126,8 +5126,8 @@ TEST(APFloatTest, PPCDoubleDoubleAdd) { std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected[0], Expected[1], RM) = Tp; { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.add(A2, RM); EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]) @@ -5140,8 +5140,8 @@ TEST(APFloatTest, PPCDoubleDoubleAdd) { .str(); } { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A2.add(A1, RM); EXPECT_EQ(Expected[0], A2.bitcastToAPInt().getRawData()[0]) @@ -5175,8 +5175,8 @@ TEST(APFloatTest, PPCDoubleDoubleSubtract) { APFloat::roundingMode RM; std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected[0], Expected[1], RM) = Tp; - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.subtract(A2, RM); EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]) @@ -5230,8 +5230,8 @@ TEST(APFloatTest, PPCDoubleDoubleMultiplySpecial) { std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected, RM) = Tp; { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.multiply(A2, RM); EXPECT_EQ(Expected, A1.getCategory()) @@ -5240,8 +5240,8 @@ TEST(APFloatTest, PPCDoubleDoubleMultiplySpecial) { .str(); } { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A2.multiply(A1, RM); EXPECT_EQ(Expected, A2.getCategory()) @@ -5303,8 +5303,8 @@ TEST(APFloatTest, PPCDoubleDoubleMultiply) { std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected[0], Expected[1], RM) = Tp; { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.multiply(A2, RM); EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]) @@ -5317,8 +5317,8 @@ TEST(APFloatTest, PPCDoubleDoubleMultiply) { .str(); } { - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A2.multiply(A1, RM); EXPECT_EQ(Expected[0], A2.bitcastToAPInt().getRawData()[0]) @@ -5350,8 +5350,8 @@ TEST(APFloatTest, PPCDoubleDoubleDivide) { APFloat::roundingMode RM; std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected[0], Expected[1], RM) = Tp; - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.divide(A2, RM); EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]) @@ -5383,8 +5383,8 @@ TEST(APFloatTest, PPCDoubleDoubleRemainder) { uint64_t Op1[2], Op2[2], Expected[2]; std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected[0], Expected[1]) = Tp; - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.remainder(A2); EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]) @@ -5418,8 +5418,8 @@ TEST(APFloatTest, PPCDoubleDoubleMod) { uint64_t Op1[2], Op2[2], Expected[2]; std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected[0], Expected[1]) = Tp; - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); A1.mod(A2); EXPECT_EQ(Expected[0], A1.bitcastToAPInt().getRawData()[0]) @@ -6282,8 +6282,8 @@ TEST(APFloatTest, PPCDoubleDoubleCompare) { APFloat::cmpResult Expected; std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected) = Tp; - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); EXPECT_EQ(Expected, A1.compare(A2)) << formatv("compare(({0:x} + {1:x}), ({2:x} + {3:x}))", Op1[0], Op1[1], Op2[0], Op2[1]) @@ -6410,8 +6410,8 @@ TEST(APFloatTest, PPCDoubleDoubleBitwiseIsEqual) { bool Expected; std::tie(Op1[0], Op1[1], Op2[0], Op2[1], Expected) = Tp; - APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, 2, Op1)); - APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, 2, Op2)); + APFloat A1(APFloat::PPCDoubleDouble(), APInt(128, Op1)); + APFloat A2(APFloat::PPCDoubleDouble(), APInt(128, Op2)); EXPECT_EQ(Expected, A1.bitwiseIsEqual(A2)) << formatv("({0:x} + {1:x}) = ({2:x} + {3:x})", Op1[0], Op1[1], Op2[0], Op2[1]) @@ -6423,16 +6423,15 @@ TEST(APFloatTest, PPCDoubleDoubleHashValue) { uint64_t Data1[] = {0x3ff0000000000001ull, 0x0000000000000001ull}; uint64_t Data2[] = {0x3ff0000000000001ull, 0}; // The hash values are *hopefully* different. - EXPECT_NE( - hash_value(APFloat(APFloat::PPCDoubleDouble(), APInt(128, 2, Data1))), - hash_value(APFloat(APFloat::PPCDoubleDouble(), APInt(128, 2, Data2)))); + EXPECT_NE(hash_value(APFloat(APFloat::PPCDoubleDouble(), APInt(128, Data1))), + hash_value(APFloat(APFloat::PPCDoubleDouble(), APInt(128, Data2)))); } TEST(APFloatTest, PPCDoubleDoubleChangeSign) { uint64_t Data[] = { 0x400f000000000000ull, 0xbcb0000000000000ull, }; - APFloat Float(APFloat::PPCDoubleDouble(), APInt(128, 2, Data)); + APFloat Float(APFloat::PPCDoubleDouble(), APInt(128, Data)); { APFloat Actual = APFloat::copySign(Float, APFloat(APFloat::IEEEdouble(), "1")); @@ -6452,14 +6451,14 @@ TEST(APFloatTest, PPCDoubleDoubleFactories) { uint64_t Data[] = { 0, 0, }; - EXPECT_EQ(APInt(128, 2, Data), + EXPECT_EQ(APInt(128, Data), APFloat::getZero(APFloat::PPCDoubleDouble()).bitcastToAPInt()); } { uint64_t Data[] = { 0x7fefffffffffffffull, 0x7c8ffffffffffffeull, }; - EXPECT_EQ(APInt(128, 2, Data), + EXPECT_EQ(APInt(128, Data), APFloat::getLargest(APFloat::PPCDoubleDouble()).bitcastToAPInt()); } { @@ -6467,12 +6466,12 @@ TEST(APFloatTest, PPCDoubleDoubleFactories) { 0x0000000000000001ull, 0, }; EXPECT_EQ( - APInt(128, 2, Data), + APInt(128, Data), APFloat::getSmallest(APFloat::PPCDoubleDouble()).bitcastToAPInt()); } { uint64_t Data[] = {0x0360000000000000ull, 0}; - EXPECT_EQ(APInt(128, 2, Data), + EXPECT_EQ(APInt(128, Data), APFloat::getSmallestNormalized(APFloat::PPCDoubleDouble()) .bitcastToAPInt()); } @@ -6481,7 +6480,7 @@ TEST(APFloatTest, PPCDoubleDoubleFactories) { 0x8000000000000000ull, 0x0000000000000000ull, }; EXPECT_EQ( - APInt(128, 2, Data), + APInt(128, Data), APFloat::getZero(APFloat::PPCDoubleDouble(), true).bitcastToAPInt()); } { @@ -6489,14 +6488,14 @@ TEST(APFloatTest, PPCDoubleDoubleFactories) { 0xffefffffffffffffull, 0xfc8ffffffffffffeull, }; EXPECT_EQ( - APInt(128, 2, Data), + APInt(128, Data), APFloat::getLargest(APFloat::PPCDoubleDouble(), true).bitcastToAPInt()); } { uint64_t Data[] = { 0x8000000000000001ull, 0x0000000000000000ull, }; - EXPECT_EQ(APInt(128, 2, Data), + EXPECT_EQ(APInt(128, Data), APFloat::getSmallest(APFloat::PPCDoubleDouble(), true) .bitcastToAPInt()); } @@ -6504,7 +6503,7 @@ TEST(APFloatTest, PPCDoubleDoubleFactories) { uint64_t Data[] = { 0x8360000000000000ull, 0x0000000000000000ull, }; - EXPECT_EQ(APInt(128, 2, Data), + EXPECT_EQ(APInt(128, Data), APFloat::getSmallestNormalized(APFloat::PPCDoubleDouble(), true) .bitcastToAPInt()); } @@ -6523,7 +6522,7 @@ TEST(APFloatTest, PPCDoubleDoubleIsDenormal) { 0x4010000000000000ull, 0x4008000000000000ull, }; EXPECT_TRUE( - APFloat(APFloat::PPCDoubleDouble(), APInt(128, 2, Data)).isDenormal()); + APFloat(APFloat::PPCDoubleDouble(), APInt(128, Data)).isDenormal()); } } @@ -6533,7 +6532,7 @@ TEST(APFloatTest, PPCDoubleDoubleScalbn) { 0x4008000000000000ull, 0x3cb8000000000000ull, }; APFloat Result = - scalbn(APFloat(APFloat::PPCDoubleDouble(), APInt(128, 2, Input)), 1, + scalbn(APFloat(APFloat::PPCDoubleDouble(), APInt(128, Input)), 1, APFloat::rmNearestTiesToEven); // 6.0 + 6.0 << 53 EXPECT_EQ(0x4018000000000000ull, Result.bitcastToAPInt().getRawData()[0]); diff --git a/llvm/unittests/ADT/TrieRawHashMapTest.cpp b/llvm/unittests/ADT/TrieRawHashMapTest.cpp index c9081f5..7a95f1d 100644 --- a/llvm/unittests/ADT/TrieRawHashMapTest.cpp +++ b/llvm/unittests/ADT/TrieRawHashMapTest.cpp @@ -64,7 +64,7 @@ public: } void destroyTrie() { Trie.reset(); } - ~SimpleTrieHashMapTest() { destroyTrie(); } + ~SimpleTrieHashMapTest() override { destroyTrie(); } // Use the number itself as hash to test the pathological case. static HashType hash(uint64_t Num) { diff --git a/llvm/unittests/CAS/CASTestConfig.h b/llvm/unittests/CAS/CASTestConfig.h index c08968b..8d3c553 100644 --- a/llvm/unittests/CAS/CASTestConfig.h +++ b/llvm/unittests/CAS/CASTestConfig.h @@ -42,8 +42,8 @@ protected: auto TD = GetParam()(++(*NextCASIndex)); return std::move(TD.Cache); } - void SetUp() { NextCASIndex = 0; } - void TearDown() { NextCASIndex = std::nullopt; } + void SetUp() override { NextCASIndex = 0; } + void TearDown() override { NextCASIndex = std::nullopt; } }; #endif diff --git a/llvm/unittests/SandboxIR/PassTest.cpp b/llvm/unittests/SandboxIR/PassTest.cpp index 0c813b2..1a32702 100644 --- a/llvm/unittests/SandboxIR/PassTest.cpp +++ b/llvm/unittests/SandboxIR/PassTest.cpp @@ -84,7 +84,9 @@ define void @foo() { class TestNamePass final : public FunctionPass { public: TestNamePass(llvm::StringRef Name) : FunctionPass(Name) {} - bool runOnFunction(Function &F, const Analyses &A) { return false; } + bool runOnFunction(Function &F, const Analyses &A) override { + return false; + } }; EXPECT_DEATH(TestNamePass("white space"), ".*whitespace.*"); EXPECT_DEATH(TestNamePass("-dash"), ".*start with.*"); @@ -146,7 +148,7 @@ define i8 @foo(i8 %v0, i8 %v1) { class TestNamePass final : public RegionPass { public: TestNamePass(llvm::StringRef Name) : RegionPass(Name) {} - bool runOnRegion(Region &F, const Analyses &A) { return false; } + bool runOnRegion(Region &F, const Analyses &A) override { return false; } }; EXPECT_DEATH(TestNamePass("white space"), ".*whitespace.*"); EXPECT_DEATH(TestNamePass("-dash"), ".*start with.*"); diff --git a/llvm/unittests/Support/ScopedPrinterTest.cpp b/llvm/unittests/Support/ScopedPrinterTest.cpp index 1e2b138..280b3ee 100644 --- a/llvm/unittests/Support/ScopedPrinterTest.cpp +++ b/llvm/unittests/Support/ScopedPrinterTest.cpp @@ -109,7 +109,7 @@ protected: verifyJSONScopedPrinter(JSONExpectedOut, Func); } - void TearDown() { + void TearDown() override { // JSONScopedPrinter fails an assert if nothing's been printed. if (!HasPrintedToJSON) JSONWriter.printString(""); diff --git a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp index 86ad41f..e39cd70 100644 --- a/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp +++ b/llvm/unittests/Transforms/Utils/ValueMapperTest.cpp @@ -401,7 +401,8 @@ TEST(ValueMapperTest, mapValueLocalAsMetadataToConstant) { class TestTypeRemapper : public ValueMapTypeRemapper { public: TestTypeRemapper(Type *Ty) : DstTy(Ty) { } - Type *remapType(Type *srcTy) { return DstTy; } + Type *remapType(Type *srcTy) override { return DstTy; } + private: Type *DstTy; }; diff --git a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h index 6477589..0f1241e 100644 --- a/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h +++ b/llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.h @@ -899,7 +899,7 @@ public: OperandPredicateMatcher(PredicateKind Kind, unsigned InsnVarID, unsigned OpIdx) : PredicateMatcher(Kind, InsnVarID, OpIdx) {} - virtual ~OperandPredicateMatcher(); + ~OperandPredicateMatcher() override; /// Compare the priority of this object and B. /// @@ -1375,7 +1375,7 @@ class InstructionPredicateMatcher : public PredicateMatcher { public: InstructionPredicateMatcher(PredicateKind Kind, unsigned InsnVarID) : PredicateMatcher(Kind, InsnVarID) {} - virtual ~InstructionPredicateMatcher() {} + ~InstructionPredicateMatcher() override {} /// Compare the priority of this object and B. /// diff --git a/llvm/utils/TableGen/Common/GlobalISel/Patterns.h b/llvm/utils/TableGen/Common/GlobalISel/Patterns.h index b0d47c3..2bf2a22 100644 --- a/llvm/utils/TableGen/Common/GlobalISel/Patterns.h +++ b/llvm/utils/TableGen/Common/GlobalISel/Patterns.h @@ -318,7 +318,7 @@ private: /// instruction. class InstructionPattern : public Pattern { public: - virtual ~InstructionPattern() = default; + ~InstructionPattern() override = default; static bool classof(const Pattern *P) { return P->getKind() == K_CodeGenInstruction || P->getKind() == K_PatFrag || diff --git a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp index 28723bf..043bc628 100644 --- a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp @@ -2441,7 +2441,7 @@ public: explicit GICombinerEmitter(const RecordKeeper &RK, const CodeGenTarget &Target, StringRef Name, const Record *Combiner); - ~GICombinerEmitter() {} + ~GICombinerEmitter() override {} void run(raw_ostream &OS); }; |
