Skip to content
  1. May 03, 2021
  2. Apr 13, 2021
    • Anirudh Prasad's avatar
      [SystemZ][z/OS] Introduce dialect querying helper functions · 7da22dfc
      Anirudh Prasad authored
      - In the SystemZAsmParser, there will be a few queries to the type of dialect it is (AD_ATT, AD_HLASM) in future patches.
      - It would be nice to have two small helper functions `isParsingATT()` and `isParsingHLASM()`
      - Putting this as a separate smaller patch allows us to remove its definitions from other dependent patches.
      
      Reviewed By: uweigand, abhina.sreeskantharajan
      
      Differential Revision: https://reviews.llvm.org/D99891
      7da22dfc
  3. Mar 08, 2021
    • Anirudh Prasad's avatar
      [SystemZ][z/OS] Add support to validate a HLASM Label. · 7a46d34a
      Anirudh Prasad authored
      - This patch adds in support to determine whether a particular label
        is valid for the hlasm variant
      - The label syntax being checked is that of an ordinary HLASM symbol
        (Reference, Chapter 2 (Coding and Structure) - Terms, Literals and
        Expressions - Terms - Symbols - Ordinary Symbol)
      - To achieve this, the virtual function isLabel defined in
        MCTargetAsmParser.h is made use of
      - The isLabel function is overridden in SystemZAsmParser for the
        hlasm variant, and the syntax is checked appropriately
      - Things remain unchanged for the att variant
      - Further patches will add in support to emit the label. These future
        patches will make use of this isLabel function
      
      Reviewed By: uweigand, Kai
      
      Differential Revision: https://reviews.llvm.org/D97748
      7a46d34a
  4. Feb 26, 2021
    • Anirudh Prasad's avatar
      [SystemZ] Introducing assembler dialects for the Z backend · bcc1aba6
      Anirudh Prasad authored
      - This patch introduces a different assembler dialect ("hlasm") for z/OS.
        The default dialect has now been given the "att" dialect name. For this
        appropriate changes have been added to SystemZ.td.
      - This patch also makes a few changes to SystemZInstrFormats.td which
        restrict a few condition code mnemonics to just the "att" dialect
        variant (he, le, lh, nhe, nle, nlh). These extended condition code
        mnemonics are not available in HLASM.
      - A new private function has been introduced in SystemZAsmParser.cpp to
        return the assembler dialect set in SystemZMCAsmInfo.cpp. The reason we
        couldn't/haven't explicitly queried the overriden getAssemblerDialect
        function from AsmParser is outlined in this thread here. This returned
        dialect is directly passed onto the relevant matcher functions which taken
        in a variantID, so that the matcher functions can appropriately choose an
        instruction based on the variant.
      
      Reviewed By: uweigand
      
      Differential Revision: https://reviews.llvm.org/D94250
      bcc1aba6
  5. Dec 02, 2020
    • Anirudh Prasad's avatar
      [SystemZ] Adding extra extended mnemonics for SystemZ target · f03c21df
      Anirudh Prasad authored
      This patch consists of the addition of some common additional
      extended mnemonics to the SystemZ target.
      
      - These are jnop, jct, jctg, jas, jasl, jxh, jxhg, jxle,
        jxleg, bru, brul, br*, br*l.
      - These mnemonics and the instructions they map to are
        defined here, Chapter 4 - Branching with extended
        mnemonic codes.
      - Except for jnop (which is a variant of brc 0, label), every
        other mnemonic is marked as a MnemonicAlias since there is
        already a "defined" instruction with the same encoding
        and/or condition mask values.
      - brc 0, label doesn't have a defined extended mnemonic, thus
        jnop is defined using as an InstAlias. Furthermore, the
        applyMnemonicAliases function is called in the overridden
        parseInstruction function in SystemZAsmParser.cpp to ensure
        any mnemonic aliases are applied before any further
        processing on the instruction is done.
      
      Reviewed By: uweigand
      
      Differential Revision: https://reviews.llvm.org/D92185
      f03c21df
  6. Oct 06, 2020
  7. Oct 05, 2020
  8. Jul 08, 2020
  9. Apr 29, 2020
  10. Mar 31, 2020
    • Ulrich Weigand's avatar
      [SystemZ] Allow %r0 in address context for AsmParser · c726c920
      Ulrich Weigand authored
      Registers used in any address (as well as in a few other contexts)
      have special semantics when a "zero" register is used, which is
      why the back-end defines extra register classes ADDR32, ADDR64 etc
      to be used to prevent the register allocator from using %r0 there.
      
      However, when writing assembler code "by hand", you sometimes need
      to trigger that special semantics.  However, currently the AsmParser
      will reject %r0 in those places.  In some cases it may be possible
      to write that instruction differently - but in others it is currently
      not possible at all.
      
      This check in AsmParser simply seems overly strict, so this patch
      just removes the check completely.  This brings the behaviour of
      AsmParser in line with the GNU assembler as well.
      
      Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=45092
      c726c920
  11. Feb 15, 2020
  12. Feb 14, 2020
  13. Feb 11, 2020
    • Eric Astor's avatar
      [ms] [llvm-ml] Add support for attempted register parsing · 8d5bf042
      Eric Astor authored
      Summary:
      Add a new method (tryParseRegister) that attempts to parse a register specification.
      
      MASM allows the use of IFDEF <register>, as well as IFDEF <symbol>. To accommodate this, we make it possible to check whether a register specification can be parsed at the current location, without failing the entire parse if it can't.
      
      Reviewers: thakis
      
      Reviewed By: thakis
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73486
      8d5bf042
  14. Jan 15, 2020
    • Tom Stellard's avatar
      CMake: Make most target symbols hidden by default · 0dbcb363
      Tom Stellard authored
      Summary:
      For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF
      this change makes all symbols in the target specific libraries hidden
      by default.
      
      A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these
      libraries public, which is mainly needed for the definitions of the
      LLVMInitialize* functions.
      
      This patch reduces the number of public symbols in libLLVM.so by about
      25%.  This should improve load times for the dynamic library and also
      make abi checker tools, like abidiff require less memory when analyzing
      libLLVM.so
      
      One side-effect of this change is that for builds with
      LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that
      access symbols that are no longer public will need to be statically linked.
      
      Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1):
      nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
      36221
      nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
      26278
      
      Reviewers: chandlerc, beanz, mgorny, rnk, hans
      
      Reviewed By: rnk, hans
      
      Subscribers: merge_guards_bot, luismarques, smeenai, ldionne, lenary, s.egerton, pzheng, sameer.abuasal, MaskRay, wuzish, echristo, Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D54439
      0dbcb363
  15. Nov 04, 2019
    • Jonas Paulsson's avatar
      [SystemZ] Improve handling of huge PC relative immediate offsets. · 580310ff
      Jonas Paulsson authored
      Demand that an immediate offset to a PC relative address fits in 32 bits, or
      else load it into a register and perform a separate add.
      
      Verify in the assembler that such immediate offsets fit the bitwidth.
      
      Even though the final address of a Load Address Relative Long may fit in 32
      bits even with a >32 bit offset (depending on where the symbol lives relative
      to PC), the GNU toolchain demands the offset by itself to be in range. This
      patch adapts the same behavior for llvm.
      
      Review: Ulrich Weigand
      https://reviews.llvm.org/D69749
      580310ff
  16. Aug 15, 2019
  17. Jun 11, 2019
    • Tom Stellard's avatar
      Revert CMake: Make most target symbols hidden by default · 4b0b2619
      Tom Stellard authored
      This reverts r362990 (git commit 37457130)
      
      This was causing linker warnings on Darwin:
      
      ld: warning: direct access in function 'llvm::initializeEvexToVexInstPassPass(llvm::PassRegistry&)'
      from file '../../lib/libLLVMX86CodeGen.a(X86EvexToVex.cpp.o)' to global weak symbol
      'void std::__1::__call_once_proxy<std::__1::tuple<void* (&)(llvm::PassRegistry&),
      std::__1::reference_wrapper<llvm::PassRegistry>&&> >(void*)' from file '../../lib/libLLVMCore.a(Verifier.cpp.o)'
      means the weak symbol cannot be overridden at runtime. This was likely caused by different translation
      units being compiled with different visibility settings.
      
      llvm-svn: 363028
      4b0b2619
    • Tom Stellard's avatar
      CMake: Make most target symbols hidden by default · 37457130
      Tom Stellard authored
      Summary:
      For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF
      this change makes all symbols in the target specific libraries hidden
      by default.
      
      A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these
      libraries public, which is mainly needed for the definitions of the
      LLVMInitialize* functions.
      
      This patch reduces the number of public symbols in libLLVM.so by about
      25%.  This should improve load times for the dynamic library and also
      make abi checker tools, like abidiff require less memory when analyzing
      libLLVM.so
      
      One side-effect of this change is that for builds with
      LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that
      access symbols that are no longer public will need to be statically linked.
      
      Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1):
      nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
      36221
      nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
      26278
      
      Reviewers: chandlerc, beanz, mgorny, rnk, hans
      
      Reviewed By: rnk, hans
      
      Subscribers: Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D54439
      
      llvm-svn: 362990
      37457130
  18. May 15, 2019
    • Richard Trieu's avatar
      [SystemZ] Create a TargetInfo header. NFC · 1e6f98b8
      Richard Trieu authored
      Move the declarations of getThe<Name>Target() functions into a new header in
      TargetInfo and make users of these functions include this new header.
      This fixes a layering problem.
      
      llvm-svn: 360734
      1e6f98b8
  19. May 11, 2019
    • Richard Trieu's avatar
      [SystemZ] Move InstPrinter files to MCTargetDesc. NFC · d0124bd7
      Richard Trieu authored
      For some targets, there is a circular dependency between InstPrinter and
      MCTargetDesc.  Merging them together will fix this.  For the other targets,
      the merging is to maintain consistency so all targets will have the same
      structure.
      
      llvm-svn: 360510
      d0124bd7
  20. Apr 29, 2019
  21. Mar 11, 2019
    • Stanislav Mekhanoshin's avatar
      Use bitset for assembler predicates · e98944ed
      Stanislav Mekhanoshin authored
      AMDGPU target run out of Subtarget feature flags hitting the limit of 64.
      AssemblerPredicates uses at most uint64_t for their representation.
      At the same time CodeGen has exhausted this a long time ago and switched
      to a FeatureBitset with the current limit of 192 bits.
      
      This patch completes transition to the bitset for feature bits extending
      it to asm matcher and MC code emitter.
      
      Differential Revision: https://reviews.llvm.org/D59002
      
      llvm-svn: 355839
      e98944ed
  22. Jan 19, 2019
    • Chandler Carruth's avatar
      Update the file headers across all of the LLVM projects in the monorepo · 2946cd70
      Chandler Carruth authored
      to reflect the new license.
      
      We understand that people may be surprised that we're moving the header
      entirely to discuss the new license. We checked this carefully with the
      Foundation's lawyer and we believe this is the correct approach.
      
      Essentially, all code in the project is now made available by the LLVM
      project under our new license, so you will see that the license headers
      include that license only. Some of our contributors have contributed
      code under our old license, and accordingly, we have retained a copy of
      our old license notice in the top-level files in each project and
      repository.
      
      llvm-svn: 351636
      2946cd70
  23. Oct 26, 2018
  24. Oct 26, 2017
  25. Oct 11, 2017
    • Oliver Stannard's avatar
      [Asm] Add debug tracing in table-generated assembly matcher · 4191b9ea
      Oliver Stannard authored
      This adds debug tracing to the table-generated assembly instruction matcher,
      enabled by the -debug-only=asm-matcher option.
      
      The changes in the target AsmParsers are to add an MCInstrInfo reference under
      a consistent name, so that we can use it from table-generated code. This was
      already being used this way for targets that use deprecation warnings, but 5
      targets did not have it, and Hexagon had it under a different name to the other
      backends.
      
      llvm-svn: 315445
      4191b9ea
  26. Jul 18, 2017
  27. Jun 30, 2017
    • Ulrich Weigand's avatar
      [SystemZ] Add all remaining instructions · 03ab2e2b
      Ulrich Weigand authored
      This adds all remaining instructions that were still missing, mostly
      privileged and semi-privileged system-level instructions.  These are
      provided for use with the assembler and disassembler only.
      
      This brings the LLVM assembler / disassembler to parity with the
      GNU binutils tools.
      
      llvm-svn: 306876
      03ab2e2b
  28. Jun 06, 2017
    • Chandler Carruth's avatar
      Sort the remaining #include lines in include/... and lib/.... · 6bda14b3
      Chandler Carruth authored
      I did this a long time ago with a janky python script, but now
      clang-format has built-in support for this. I fed clang-format every
      line with a #include and let it re-sort things according to the precise
      LLVM rules for include ordering baked into clang-format these days.
      
      I've reverted a number of files where the results of sorting includes
      isn't healthy. Either places where we have legacy code relying on
      particular include ordering (where possible, I'll fix these separately)
      or where we have particular formatting around #include lines that
      I didn't want to disturb in this patch.
      
      This patch is *entirely* mechanical. If you get merge conflicts or
      anything, just ignore the changes in this patch and run clang-format
      over your #include lines in the files.
      
      Sorry for any noise here, but it is important to keep these things
      stable. I was seeing an increasing number of patches with irrelevant
      re-ordering of #include lines because clang-format was used. This patch
      at least isolates that churn, makes it easy to skip when resolving
      conflicts, and gets us to a clean baseline (again).
      
      llvm-svn: 304787
      6bda14b3
  29. May 10, 2017
  30. Feb 04, 2017
  31. Nov 28, 2016
    • Ulrich Weigand's avatar
      [SystemZ] Support execution hint instructions · 84404f30
      Ulrich Weigand authored
      This adds assembler support for the instructions provided by the
      execution-hint facility (NIAI and BP(R)P).  This required adding
      support for the new relocation types for 12-bit and 24-bit PC-
      relative offsets used by the BP(R)P instructions.
      
      llvm-svn: 288031
      84404f30
  32. Nov 08, 2016
    • Ulrich Weigand's avatar
      [SystemZ] Model access registers as LLVM registers · fffc7110
      Ulrich Weigand authored
      Add the 16 access registers as LLVM registers.  This allows removing
      a lot of special cases in the assembler and disassembler where we
      were handling access registers; this can all just use the generic
      register code now.
      
      Also add a bunch of instructions to operate on access registers,
      for assembler/disassembler use only.  No change in code generation
      intended.
      
      llvm-svn: 286283
      fffc7110
  33. Nov 02, 2016
  34. Nov 01, 2016
    • Alex Bradbury's avatar
      [TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h · 58eba099
      Alex Bradbury authored
      As it stands, the OperandMatchResultTy is only included in the generated
      header if there is custom operand parsing. However, almost all backends
      make use of MatchOperand_Success and friends from OperandMatchResultTy for
      e.g. parseRegister. This is a pain when starting an AsmParser for a new
      backend that doesn't yet have custom operand parsing. Move the enum to
      MCTargetAsmParser.h.
      
      This patch is a prerequisite for D23563
      
      Differential Revision: https://reviews.llvm.org/D23496
      
      llvm-svn: 285705
      58eba099
  35. Oct 31, 2016
    • Ulrich Weigand's avatar
      [SystemZ] Correctly diagnose missing features in AsmParser · d9001301
      Ulrich Weigand authored
      Currently, when using an instruction that is not supported on the
      currently selected architecture, the LLVM assembler is likely to
      diagnose an "invalid operand" instead of a "missing feature".
      
      This is because many operands require a custom parser in order to
      be processed correctly, and if an instruction is not available
      according to the current feature set, the generated parser code
      will also not detect the associated custom operand parsers.
      
      Fixed by temporarily enabling all features while parsing operands.
      The missing features will then be correctly detected when actually
      parsing the instruction itself.
      
      llvm-svn: 285575
      d9001301
    • Ulrich Weigand's avatar
      [SystemZ] Fix encoding of MVCK and .insn ss · ec5d779e
      Ulrich Weigand authored
      LLVM currently treats the first operand of MVCK as if it were a
      regular base+index+displacement address.  However, it is in fact
      a base+displacement combined with a length register field.
      
      While the two might look syntactically similar, there are two
      semantic differences:
      - %r0 is a valid length register, even though it cannot be used
        as an index register.
      - In an expression with just a single register like 0(%rX), the
        register is treated as base with normal addresses, while it is
        treated as the length register (with an empty base) for MVCK.
      
      Fixed by adding a new operand parser class BDRAddr and reworking
      the assembler parser to distinguish between address + length
      register operands and regular addresses.
      
      llvm-svn: 285574
      ec5d779e
Loading