diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h --- a/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/CSEInfo.h @@ -214,6 +214,7 @@ void setMF(MachineFunction &MFunc) { MF = &MFunc; } void setComputed(bool Computed) { AlreadyComputed = Computed; } void releaseMemory() { Info.releaseMemory(); } + void verify(); }; /// The actual analysis pass wrapper. @@ -235,6 +236,10 @@ Wrapper.releaseMemory(); Wrapper.setComputed(false); } + + void verifyAnalysis() const override { + const_cast(&Wrapper)->verify(); + } }; } // namespace llvm diff --git a/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp b/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp --- a/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp @@ -430,6 +430,9 @@ } return Info; } + +void GISelCSEAnalysisWrapper::verify() { cantFail(Info.verify()); } + void GISelCSEAnalysisWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); MachineFunctionPass::getAnalysisUsage(AU);