[llvm] r306208 - Ensure backends available in 'opt' are also available in 'bugpoint'

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 25 23:31:16 PDT 2017


On Mon, Jun 26, 2017, at 08:25 AM, Chandler Carruth via llvm-commits
wrote:
> On Sat, Jun 24, 2017 at 1:10 AM Tobias Grosser via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
> 
> > Author: grosser
> > Date: Sat Jun 24 03:09:33 2017
> > New Revision: 306208
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=306208&view=rev
> > Log:
> > Ensure backends available in 'opt' are also available in 'bugpoint'
> >
> > This patch links LLVM back-ends into bugpoint the same way they are already
> > available in 'opt' and 'clang'. This resolves an inconsistency that
> > allowed the
> > use of LLVM backends in loadable modules that run in 'opt', but that would
> > prevent the debugging of these modules with bugpoint due to unavailable /
> > unresolved symbols.
> >
> > For e.g. In D31859, Polly requires the NVPTX back-end.
> >
> > Reviewers: hfinkel, bogner, chandlerc, grosser, Meinersbur
> >
> > Subscribers: bollu, mgorny, grosser, Meinersbur
> >
> > Tags: #polly
> >
> > Contributed by: Singapuram Sanjay
> >
> > Differential Revision: https://reviews.llvm.org/D32003
> >
> > Modified:
> >     llvm/trunk/tools/bugpoint/CMakeLists.txt
> >     llvm/trunk/tools/bugpoint/LLVMBuild.txt
> >     llvm/trunk/tools/bugpoint/bugpoint.cpp
> >
> > Modified: llvm/trunk/tools/bugpoint/CMakeLists.txt
> > URL:
> > http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/CMakeLists.txt?rev=306208&r1=306207&r2=306208&view=diff
> >
> > ==============================================================================
> > --- llvm/trunk/tools/bugpoint/CMakeLists.txt (original)
> > +++ llvm/trunk/tools/bugpoint/CMakeLists.txt Sat Jun 24 03:09:33 2017
> > @@ -1,4 +1,5 @@
> >  set(LLVM_LINK_COMPONENTS
> > +  ${LLVM_TARGETS_TO_BUILD}
> >    Analysis
> >    BitWriter
> >    CodeGen
> >
> > Modified: llvm/trunk/tools/bugpoint/LLVMBuild.txt
> > URL:
> > http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/LLVMBuild.txt?rev=306208&r1=306207&r2=306208&view=diff
> >
> > ==============================================================================
> > --- llvm/trunk/tools/bugpoint/LLVMBuild.txt (original)
> > +++ llvm/trunk/tools/bugpoint/LLVMBuild.txt Sat Jun 24 03:09:33 2017
> > @@ -30,3 +30,4 @@ required_libraries =
> >   Linker
> >   ObjCARC
> >   Scalar
> > + all-targets
> >
> > Modified: llvm/trunk/tools/bugpoint/bugpoint.cpp
> > URL:
> > http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/bugpoint.cpp?rev=306208&r1=306207&r2=306208&view=diff
> >
> > ==============================================================================
> > --- llvm/trunk/tools/bugpoint/bugpoint.cpp (original)
> > +++ llvm/trunk/tools/bugpoint/bugpoint.cpp Sat Jun 24 03:09:33 2017
> > @@ -26,6 +26,7 @@
> >  #include "llvm/Support/PrettyStackTrace.h"
> >  #include "llvm/Support/Process.h"
> >  #include "llvm/Support/Signals.h"
> > +#include "llvm/Support/TargetSelect.h"
> >  #include "llvm/Support/Valgrind.h"
> >  #include "llvm/Transforms/IPO/AlwaysInliner.h"
> >  #include "llvm/Transforms/IPO/PassManagerBuilder.h"
> > @@ -138,6 +139,14 @@ int main(int argc, char **argv) {
> >    polly::initializePollyPasses(Registry);
> >  #endif
> >
> > +  if (std::getenv("bar") == (char*) -1) {
> > +    InitializeAllTargets();
> > +    InitializeAllTargetMCs();
> > +    InitializeAllAsmPrinters();
> > +    InitializeAllAsmParsers();
> > +    InitializeAllDisassemblers();
> >
> 
> Why would it need *dis*assemblers? Doesn't really make sense. It also
> doesn't match the initialization in the 'opt' tool...

Right. This was an oversight. I will drop the Disassemblers. opt has
indeed only:

  InitializeAllTargets();                                                
  InitializeAllTargetMCs();                                              
  InitializeAllAsmPrinters();                                            
  InitializeAllAsmParsers();           

Best,
Tobias

> 
> 
> > +  }
> > +
> >    cl::ParseCommandLineOptions(argc, argv,
> >                                "LLVM automatic testcase reducer.
> > See\nhttp://"
> >                                "llvm.org/cmds/bugpoint.html"
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> >
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list