[llvm] r317904 - [Hexagon] Create HexagonISelDAGToDAG.h, NFC

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 11:35:02 PST 2017


Reverted in r317916.
-Krzysztof

On 11/10/2017 1:12 PM, Vitaly Buka wrote:
> windows builder is broken
> http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/6092
> FAILED: 
> lib/Target/Hexagon/CMakeFiles/LLVMHexagonCodeGen.dir/HexagonISelDAGToDAG.cpp.obj 
> 
> 
> C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo /TP 
> -DEXPENSIVE_CHECKS -DGTEST_HAS_RTTI=0 -DUNICODE 
> -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_DEBUG 
> -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS 
> -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS 
> -D__STDC_LIMIT_MACROS -Ilib\Target\Hexagon 
> -IC:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\lib\Target\Hexagon 
> -Iinclude 
> -IC:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\include 
> /DWIN32 /D_WINDOWS /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
> -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 
> -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 
> -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 
> -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 
> -wd4592 -wd4319 -wd4324 -w14062 -we4238 /MDd /Zi /Ob0 /Od /RTC1 /EHs-c- 
> /GR- /showIncludes 
> /Folib\Target\Hexagon\CMakeFiles\LLVMHexagonCodeGen.dir\HexagonISelDAGToDAG.cpp.obj 
> /Fdlib\Target\Hexagon\CMakeFiles\LLVMHexagonCodeGen.dir\LLVMHexagonCodeGen.pdb 
> /FS -c 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\lib\Target\Hexagon\HexagonISelDAGToDAG.cpp 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(18): 
> error C2065: 'OPC_SwitchOpcode': undeclared identifier 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(19): 
> error C2065: 'OPC_RecordMemRef': undeclared identifier 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(20): 
> error C2065: 'OPC_RecordNode': undeclared identifier 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(21): 
> error C2065: 'OPC_Scope': undeclared identifier 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(22): 
> error C2065: 'OPC_MoveChild1': undeclared identifier 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(23): 
> error C2065: 'OPC_SwitchOpcode': undeclared identifier 
> C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\Target\Hexagon\HexagonGenDAGISel.inc(24): 
> error C2065: 'OPC_Scope': undeclared identifier
> 
> 
> On Fri, Nov 10, 2017 at 10:39 AM, Krzysztof Parzyszek via llvm-commits 
> <llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>> wrote:
> 
>     Author: kparzysz
>     Date: Fri Nov 10 10:39:45 2017
>     New Revision: 317904
> 
>     URL: http://llvm.org/viewvc/llvm-project?rev=317904&view=rev
>     <http://llvm.org/viewvc/llvm-project?rev=317904&view=rev>
>     Log:
>     [Hexagon] Create HexagonISelDAGToDAG.h, NFC
> 
>     Added:
>          llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.h
>     Modified:
>          llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
> 
>     Modified: llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
>     URL:
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp?rev=317904&r1=317903&r2=317904&view=diff
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp?rev=317904&r1=317903&r2=317904&view=diff>
>     ==============================================================================
>     --- llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp (original)
>     +++ llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp Fri Nov 10
>     10:39:45 2017
>     @@ -12,6 +12,7 @@
>       //===----------------------------------------------------------------------===//
> 
>       #include "Hexagon.h"
>     +#include "HexagonISelDAGToDAG.h"
>       #include "HexagonISelLowering.h"
>       #include "HexagonMachineFunctionInfo.h"
>       #include "HexagonTargetMachine.h"
>     @@ -50,115 +51,8 @@ static cl::opt<bool> CheckSingleUse("hex
>       // Instruction Selector Implementation
>       //===----------------------------------------------------------------------===//
> 
>     -//===--------------------------------------------------------------------===//
>     -/// HexagonDAGToDAGISel - Hexagon specific code to select Hexagon
>     machine
>     -/// instructions for SelectionDAG operations.
>     -///
>     -namespace {
>     -class HexagonDAGToDAGISel : public SelectionDAGISel {
>     -  const HexagonSubtarget *HST;
>     -  const HexagonInstrInfo *HII;
>     -  const HexagonRegisterInfo *HRI;
>     -public:
>     -  explicit HexagonDAGToDAGISel(HexagonTargetMachine &tm,
>     -                               CodeGenOpt::Level OptLevel)
>     -      : SelectionDAGISel(tm, OptLevel), HST(nullptr), HII(nullptr),
>     -        HRI(nullptr) {}
>     -
>     -  bool runOnMachineFunction(MachineFunction &MF) override {
>     -    // Reset the subtarget each time through.
>     -    HST = &MF.getSubtarget<HexagonSubtarget>();
>     -    HII = HST->getInstrInfo();
>     -    HRI = HST->getRegisterInfo();
>     -    SelectionDAGISel::runOnMachineFunction(MF);
>     -    return true;
>     -  }
>     -
>     -  bool ComplexPatternFuncMutatesDAG() const override {
>     -    return true;
>     -  }
>     -  void PreprocessISelDAG() override;
>     -  void EmitFunctionEntryCode() override;
>     -
>     -  void Select(SDNode *N) override;
>     -
>     -  // Complex Pattern Selectors.
>     -  inline bool SelectAddrGA(SDValue &N, SDValue &R);
>     -  inline bool SelectAddrGP(SDValue &N, SDValue &R);
>     -  inline bool SelectAnyImm(SDValue &N, SDValue &R);
>     -  inline bool SelectAnyInt(SDValue &N, SDValue &R);
>     -  bool SelectAnyImmediate(SDValue &N, SDValue &R, uint32_t LogAlign);
>     -  bool SelectGlobalAddress(SDValue &N, SDValue &R, bool UseGP,
>     -                           uint32_t LogAlign);
>     -  bool SelectAddrFI(SDValue &N, SDValue &R);
>     -  bool DetectUseSxtw(SDValue &N, SDValue &R);
>     -
>     -  inline bool SelectAnyImm0(SDValue &N, SDValue &R);
>     -  inline bool SelectAnyImm1(SDValue &N, SDValue &R);
>     -  inline bool SelectAnyImm2(SDValue &N, SDValue &R);
>     -  inline bool SelectAnyImm3(SDValue &N, SDValue &R);
>     -
>     -  StringRef getPassName() const override {
>     -    return "Hexagon DAG->DAG Pattern Instruction Selection";
>     -  }
>     -
>     -  // Generate a machine instruction node corresponding to the circ/brev
>     -  // load intrinsic.
>     -  MachineSDNode *LoadInstrForLoadIntrinsic(SDNode *IntN);
>     -  // Given the circ/brev load intrinsic and the already generated
>     machine
>     -  // instruction, generate the appropriate store (that is a part of the
>     -  // intrinsic's functionality).
>     -  SDNode *StoreInstrForLoadIntrinsic(MachineSDNode *LoadN, SDNode
>     *IntN);
>     -
>     -  void SelectFrameIndex(SDNode *N);
>     -  /// SelectInlineAsmMemoryOperand - Implement addressing mode
>     selection for
>     -  /// inline asm expressions.
>     -  bool SelectInlineAsmMemoryOperand(const SDValue &Op,
>     -                                    unsigned ConstraintID,
>     -                                    std::vector<SDValue> &OutOps)
>     override;
>     -  bool tryLoadOfLoadIntrinsic(LoadSDNode *N);
>     -  void SelectLoad(SDNode *N);
>     -  void SelectIndexedLoad(LoadSDNode *LD, const SDLoc &dl);
>     -  void SelectIndexedStore(StoreSDNode *ST, const SDLoc &dl);
>     -  void SelectStore(SDNode *N);
>     -  void SelectSHL(SDNode *N);
>     -  void SelectZeroExtend(SDNode *N);
>     -  void SelectIntrinsicWChain(SDNode *N);
>     -  void SelectIntrinsicWOChain(SDNode *N);
>     -  void SelectConstant(SDNode *N);
>     -  void SelectConstantFP(SDNode *N);
>     -  void SelectBitcast(SDNode *N);
>     -
>     -  // Include the pieces autogenerated from the target description.
>     -  #include "HexagonGenDAGISel.inc"
>     -
>     -private:
>     -  bool keepsLowBits(const SDValue &Val, unsigned NumBits, SDValue
>     &Src);
>     -  bool isOrEquivalentToAdd(const SDNode *N) const;
>     -  bool isAlignedMemNode(const MemSDNode *N) const;
>     -  bool isSmallStackStore(const StoreSDNode *N) const;
>     -  bool isPositiveHalfWord(const SDNode *N) const;
>     -  bool hasOneUse(const SDNode *N) const;
>     -
>     -  // DAG preprocessing functions.
>     -  void ppSimplifyOrSelect0(std::vector<SDNode*> &&Nodes);
>     -  void ppAddrReorderAddShl(std::vector<SDNode*> &&Nodes);
>     -  void ppAddrRewriteAndSrl(std::vector<SDNode*> &&Nodes);
>     -  void ppHoistZextI1(std::vector<SDNode*> &&Nodes);
>     -
>     -  SmallDenseMap<SDNode *,int> RootWeights;
>     -  SmallDenseMap<SDNode *,int> RootHeights;
>     -  SmallDenseMap<const Value *,int> GAUsesInFunction;
>     -  int getWeight(SDNode *N);
>     -  int getHeight(SDNode *N);
>     -  SDValue getMultiplierForSHL(SDNode *N);
>     -  SDValue factorOutPowerOf2(SDValue V, unsigned Power);
>     -  unsigned getUsesInFunction(const Value *V);
>     -  SDValue balanceSubTree(SDNode *N, bool Factorize = false);
>     -  void rebalanceAddressTrees();
>     -}; // end HexagonDAGToDAGISel
>     -}  // end anonymous namespace
>     -
>     +#define GET_DAGISEL_BODY HexagonDAGToDAGISel
>     +#include "HexagonGenDAGISel.inc"
> 
>       /// createHexagonISelDag - This pass converts a legalized DAG into a
>       /// Hexagon-specific DAG, ready for instruction scheduling.
> 
>     Added: llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.h
>     URL:
>     http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.h?rev=317904&view=auto
>     <http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.h?rev=317904&view=auto>
>     ==============================================================================
>     --- llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.h (added)
>     +++ llvm/trunk/lib/Target/Hexagon/HexagonISelDAGToDAG.h Fri Nov 10
>     10:39:45 2017
>     @@ -0,0 +1,136 @@
>     +//===-- HexagonISelDAGToDAG.h -----------------------------------*-
>     C++ -*-===//
>     +//
>     +//                     The LLVM Compiler Infrastructure
>     +//
>     +// This file is distributed under the University of Illinois Open
>     Source
>     +// License. See LICENSE.TXT for details.
>     +//
>     +//===----------------------------------------------------------------------===//
>     +// Hexagon specific code to select Hexagon machine instructions for
>     +// SelectionDAG operations.
>     +//===----------------------------------------------------------------------===//
>     +
>     +#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONISELDAGTODAG_H
>     +#define LLVM_LIB_TARGET_HEXAGON_HEXAGONISELDAGTODAG_H
>     +
>     +#include "HexagonSubtarget.h"
>     +#include "HexagonTargetMachine.h"
>     +#include "llvm/ADT/StringRef.h"
>     +#include "llvm/CodeGen/SelectionDAG.h"
>     +#include "llvm/CodeGen/SelectionDAGISel.h"
>     +#include "llvm/Support/CodeGen.h"
>     +
>     +#include <vector>
>     +
>     +namespace llvm {
>     +class MachineFunction;
>     +class HexagonInstrInfo;
>     +class HexagonRegisterInfo;
>     +
>     +class HexagonDAGToDAGISel : public SelectionDAGISel {
>     +  const HexagonSubtarget *HST;
>     +  const HexagonInstrInfo *HII;
>     +  const HexagonRegisterInfo *HRI;
>     +public:
>     +  explicit HexagonDAGToDAGISel(HexagonTargetMachine &tm,
>     +                               CodeGenOpt::Level OptLevel)
>     +      : SelectionDAGISel(tm, OptLevel), HST(nullptr), HII(nullptr),
>     +        HRI(nullptr) {}
>     +
>     +  bool runOnMachineFunction(MachineFunction &MF) override {
>     +    // Reset the subtarget each time through.
>     +    HST = &MF.getSubtarget<HexagonSubtarget>();
>     +    HII = HST->getInstrInfo();
>     +    HRI = HST->getRegisterInfo();
>     +    SelectionDAGISel::runOnMachineFunction(MF);
>     +    return true;
>     +  }
>     +
>     +  bool ComplexPatternFuncMutatesDAG() const override {
>     +    return true;
>     +  }
>     +  void PreprocessISelDAG() override;
>     +  void EmitFunctionEntryCode() override;
>     +
>     +  void Select(SDNode *N) override;
>     +
>     +  // Complex Pattern Selectors.
>     +  inline bool SelectAddrGA(SDValue &N, SDValue &R);
>     +  inline bool SelectAddrGP(SDValue &N, SDValue &R);
>     +  inline bool SelectAnyImm(SDValue &N, SDValue &R);
>     +  inline bool SelectAnyInt(SDValue &N, SDValue &R);
>     +  bool SelectAnyImmediate(SDValue &N, SDValue &R, uint32_t LogAlign);
>     +  bool SelectGlobalAddress(SDValue &N, SDValue &R, bool UseGP,
>     +                           uint32_t LogAlign);
>     +  bool SelectAddrFI(SDValue &N, SDValue &R);
>     +  bool DetectUseSxtw(SDValue &N, SDValue &R);
>     +
>     +  inline bool SelectAnyImm0(SDValue &N, SDValue &R);
>     +  inline bool SelectAnyImm1(SDValue &N, SDValue &R);
>     +  inline bool SelectAnyImm2(SDValue &N, SDValue &R);
>     +  inline bool SelectAnyImm3(SDValue &N, SDValue &R);
>     +
>     +  StringRef getPassName() const override {
>     +    return "Hexagon DAG->DAG Pattern Instruction Selection";
>     +  }
>     +
>     +  // Generate a machine instruction node corresponding to the circ/brev
>     +  // load intrinsic.
>     +  MachineSDNode *LoadInstrForLoadIntrinsic(SDNode *IntN);
>     +  // Given the circ/brev load intrinsic and the already generated
>     machine
>     +  // instruction, generate the appropriate store (that is a part of the
>     +  // intrinsic's functionality).
>     +  SDNode *StoreInstrForLoadIntrinsic(MachineSDNode *LoadN, SDNode
>     *IntN);
>     +
>     +  void SelectFrameIndex(SDNode *N);
>     +  /// SelectInlineAsmMemoryOperand - Implement addressing mode
>     selection for
>     +  /// inline asm expressions.
>     +  bool SelectInlineAsmMemoryOperand(const SDValue &Op,
>     +                                    unsigned ConstraintID,
>     +                                    std::vector<SDValue> &OutOps)
>     override;
>     +  bool tryLoadOfLoadIntrinsic(LoadSDNode *N);
>     +  void SelectLoad(SDNode *N);
>     +  void SelectIndexedLoad(LoadSDNode *LD, const SDLoc &dl);
>     +  void SelectIndexedStore(StoreSDNode *ST, const SDLoc &dl);
>     +  void SelectStore(SDNode *N);
>     +  void SelectSHL(SDNode *N);
>     +  void SelectZeroExtend(SDNode *N);
>     +  void SelectIntrinsicWChain(SDNode *N);
>     +  void SelectIntrinsicWOChain(SDNode *N);
>     +  void SelectConstant(SDNode *N);
>     +  void SelectConstantFP(SDNode *N);
>     +  void SelectBitcast(SDNode *N);
>     +  void SelectVectorShuffle(SDNode *N);
>     +
>     +  // Include the pieces autogenerated from the target description.
>     +  #define GET_DAGISEL_DECL
>     +  #include "HexagonGenDAGISel.inc"
>     +
>     +private:
>     +  bool keepsLowBits(const SDValue &Val, unsigned NumBits, SDValue
>     &Src);
>     +  bool isOrEquivalentToAdd(const SDNode *N) const;
>     +  bool isAlignedMemNode(const MemSDNode *N) const;
>     +  bool isSmallStackStore(const StoreSDNode *N) const;
>     +  bool isPositiveHalfWord(const SDNode *N) const;
>     +  bool hasOneUse(const SDNode *N) const;
>     +
>     +  // DAG preprocessing functions.
>     +  void ppSimplifyOrSelect0(std::vector<SDNode*> &&Nodes);
>     +  void ppAddrReorderAddShl(std::vector<SDNode*> &&Nodes);
>     +  void ppAddrRewriteAndSrl(std::vector<SDNode*> &&Nodes);
>     +  void ppHoistZextI1(std::vector<SDNode*> &&Nodes);
>     +
>     +  SmallDenseMap<SDNode *,int> RootWeights;
>     +  SmallDenseMap<SDNode *,int> RootHeights;
>     +  SmallDenseMap<const Value *,int> GAUsesInFunction;
>     +  int getWeight(SDNode *N);
>     +  int getHeight(SDNode *N);
>     +  SDValue getMultiplierForSHL(SDNode *N);
>     +  SDValue factorOutPowerOf2(SDValue V, unsigned Power);
>     +  unsigned getUsesInFunction(const Value *V);
>     +  SDValue balanceSubTree(SDNode *N, bool Factorize = false);
>     +  void rebalanceAddressTrees();
>     +}; // end HexagonDAGToDAGISel
>     +}
>     +
>     +#endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONISELDAGTODAG_H
> 
> 
>     _______________________________________________
>     llvm-commits mailing list
>     llvm-commits at lists.llvm.org <mailto:llvm-commits at lists.llvm.org>
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>     <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


More information about the llvm-commits mailing list