[llvm] r271650 - Remove bogus initialization of the PPC and Hexagon SelectionDAGISel

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 12:00:22 PDT 2016


I'm not sure, but not by using the pass registration mechanism. You could
potentially add support directly to SDAG ISel base class for doing this?
others might have more ideas.

The core problem here is that there isn't a distinct pass ID to register.
As a consequence, these violate a large number of assumptions about how the
pass registration system works, which makes it really brittle to use this,
especially to just get IR dumping for debugging (an important use case, but
one which might be solved in any number of other ways).

On Fri, Jun 3, 2016 at 6:53 AM Krzysztof Parzyszek via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> The reason for these was to get the IR dump after the initial
> instruction selection with -print-after-all.  Now that no longer works.
>
> How do I get it back?
>
> -Krzysztof
>
>
> On 6/3/2016 5:13 AM, Chandler Carruth via llvm-commits wrote:
> > Author: chandlerc
> > Date: Fri Jun  3 05:13:31 2016
> > New Revision: 271650
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=271650&view=rev
> > Log:
> > Remove bogus initialization of the PPC and Hexagon SelectionDAGISel
> > subclasses. These are not passes proper. We don't support registering
> > them, they can't be constructed with default arguments, and the ID is
> > actually in a base class.
> >
> > Only these two targets even had any boiler plate to try to do this, and
> > it had to be munged out of the INITIALIZE_PASS macros to work. What's
> > worse, the boiler plate has rotted and the "name" of the pass is
> > actually the description string now!!! =/ All of this is completely
> > unnecessary. No other target bothers, and nothing breaks if you don't
> > initialize them because CodeGen has an entirely separate initialization
> > path that is somewhat more durable than relying on the implicit
> > initialization the way the 'opt' tool does for registered passes.
> >
> > Modified:
> >     llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
> >     llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
> >
> > Modified: llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp?rev=271650&r1=271649&r2=271650&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp (original)
> > +++ llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Fri Jun  3
> 05:13:31 2016
> > @@ -36,10 +36,6 @@ MaxNumOfUsesForConstExtenders("ga-max-nu
> >  // Instruction Selector Implementation
> >
> //===----------------------------------------------------------------------===//
> >
> > -namespace llvm {
> > -  void initializeHexagonDAGToDAGISelPass(PassRegistry&);
> > -}
> > -
> >
> //===--------------------------------------------------------------------===//
> >  /// HexagonDAGToDAGISel - Hexagon specific code to select Hexagon
> machine
> >  /// instructions for SelectionDAG operations.
> > @@ -54,9 +50,7 @@ public:
> >    explicit HexagonDAGToDAGISel(HexagonTargetMachine &tm,
> >                                 CodeGenOpt::Level OptLevel)
> >        : SelectionDAGISel(tm, OptLevel), HTM(tm), HST(nullptr),
> HII(nullptr),
> > -        HRI(nullptr) {
> > -    initializeHexagonDAGToDAGISelPass(*PassRegistry::getPassRegistry());
> > -  }
> > +        HRI(nullptr) {}
> >
> >    bool runOnMachineFunction(MachineFunction &MF) override {
> >      // Reset the subtarget each time through.
> > @@ -200,18 +194,6 @@ FunctionPass *createHexagonISelDag(Hexag
> >  }
> >  }
> >
> > -static void initializePassOnce(PassRegistry &Registry) {
> > -  const char *Name = "Hexagon DAG->DAG Pattern Instruction Selection";
> > -  PassInfo *PI = new PassInfo(Name, "hexagon-isel",
> > -                              &SelectionDAGISel::ID, nullptr, false,
> false);
> > -  Registry.registerPass(*PI, true);
> > -}
> > -
> > -void llvm::initializeHexagonDAGToDAGISelPass(PassRegistry &Registry) {
> > -  CALL_ONCE_INITIALIZATION(initializePassOnce)
> > -}
> > -
> > -
> >  // Intrinsics that return a a predicate.
> >  static bool doesIntrinsicReturnPredicate(unsigned ID) {
> >    switch (ID) {
> >
> > Modified: llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp?rev=271650&r1=271649&r2=271650&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp (original)
> > +++ llvm/trunk/lib/Target/PowerPC/PPCISelDAGToDAG.cpp Fri Jun  3
> 05:13:31 2016
> > @@ -59,10 +59,6 @@ static cl::opt<bool> EnableBranchHint(
> >      cl::desc("Enable static hinting of branches on ppc"),
> >      cl::Hidden);
> >
> > -namespace llvm {
> > -  void initializePPCDAGToDAGISelPass(PassRegistry&);
> > -}
> > -
> >  namespace {
> >
> //===--------------------------------------------------------------------===//
> >    /// PPCDAGToDAGISel - PPC specific code to select PPC machine
> > @@ -75,9 +71,7 @@ namespace {
> >      unsigned GlobalBaseReg;
> >    public:
> >      explicit PPCDAGToDAGISel(PPCTargetMachine &tm)
> > -        : SelectionDAGISel(tm), TM(tm) {
> > -      initializePPCDAGToDAGISelPass(*PassRegistry::getPassRegistry());
> > -    }
> > +        : SelectionDAGISel(tm), TM(tm) {}
> >
> >      bool runOnMachineFunction(MachineFunction &MF) override {
> >        // Make sure we re-emit a set of the global base reg if necessary
> > @@ -4431,14 +4425,3 @@ void PPCDAGToDAGISel::PeepholePPC64() {
> >  FunctionPass *llvm::createPPCISelDag(PPCTargetMachine &TM) {
> >    return new PPCDAGToDAGISel(TM);
> >  }
> > -
> > -static void initializePassOnce(PassRegistry &Registry) {
> > -  const char *Name = "PowerPC DAG->DAG Pattern Instruction Selection";
> > -  PassInfo *PI = new PassInfo(Name, "ppc-codegen",
> &SelectionDAGISel::ID,
> > -                              nullptr, false, false);
> > -  Registry.registerPass(*PI, true);
> > -}
> > -
> > -void llvm::initializePPCDAGToDAGISelPass(PassRegistry &Registry) {
> > -  CALL_ONCE_INITIALIZATION(initializePassOnce);
> > -}
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> >
>
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> hosted by The Linux Foundation
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/6029b8fd/attachment.html>


More information about the llvm-commits mailing list