1. Jul 30, 2022
    • Jay Foad's avatar
      [LangRef] Reduce depth of table of contents · fe07161a
      Jay Foad authored
      The table of contents in the HTML version of this doc takes up 25 pages
      (in my browser, on my 4K monitor) and is too long for me to navigate
      comfortably. And most of it is irrelevant detail like this:
      
      - Bitwise Binary Operations
        - 'shl' Instruction
          - Syntax:
          - Overview:
          - Arguments:
          - Semantics:
          - Example:
        - 'lshr' Instruction
          - Syntax:
          - Overview:
          - Arguments:
          - Semantics:
          - Example:
      
      Reducing the contents depth from 4 to 3 removes most of this detail,
      leaving just a list of instructions, which only takes up 7 pages and I
      find it much easier to navigate.
      
      Incidentally the depth was set to 3 when this document was first
      converted to reST and was only increased to 4 in what looks like an
      accidental change: 08013345
      
      Differential Revision: https://reviews.llvm.org/D130635
      fe07161a
    • Sam Estep's avatar
      [clang][dataflow] Handle multiple context-sensitive calls to the same function · a6ddc684
      Sam Estep authored
      This patch enables context-sensitive analysis of multiple different calls to the same function (see the `ContextSensitiveSetBothTrueAndFalse` example in the `TransferTest` suite) by replacing the `Environment` copy-assignment with a call to the new `popCall` method, which  `std::move`s some fields but specifically does not move `DeclToLoc` and `ExprToLoc` from the callee back to the caller.
      
      To enable this, the `StorageLocation` for a given parameter needs to be stable across different calls to the same function, so this patch also improves the modeling of parameter initialization, using `ReferenceValue` when necessary (for arguments passed by reference).
      
      This approach explicitly does not work for recursive calls, because we currently only plan to use this context-sensitive machinery to support specialized analysis models we write, not analysis of arbitrary callees.
      
      Reviewed By: ymandel, xazax.hun
      
      Differential Revision: https://reviews.llvm.org/D130726
      a6ddc684
    • skc7's avatar
      Revert "Revert "[Clang][Attribute] Introduce maybe_undef attribute for... · 09c41211
      skc7 authored
      Revert "Revert "[Clang][Attribute] Introduce maybe_undef attribute for function arguments which accepts undef values""
      
      This reverts commit 4e1fe968.
      
      Reverting this commit and fix the tests that caused failures due to
      a35c64ce.
      09c41211
    • Dimitry Andric's avatar
      [compiler-rt] [builtins] Detect _Float16 support at compile time · ce6d40f5
      Dimitry Andric authored
      Instead of detecting `_Float16` support at CMake configuration time,
      detect it at compile time by checking for the predefined (by the
      compiler) macro `__FLT16_MAX__` instead.
      
      This solves the issue where compiler-rt is built simultaneously for both
      x86_64 and i386 targets, and the CMake configuration uses x86_64
      compilation to detect `_Float16` support, while it may not be supported
      by the i386 target (if it does not have SSE2).
      
      While here, rename `COMPILERT_RT_HAS_FLOAT16` to `CRT_HAS_FLOAT16`, to
      conform more to the naming style used in `int_lib.h` and `int_types.h`.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D130718
      ce6d40f5
    • Amy Kwan's avatar
      Revert "[Clang][Attribute] Introduce maybe_undef attribute for function... · 4e1fe968
      Amy Kwan authored
      Revert "[Clang][Attribute] Introduce maybe_undef attribute for function arguments which accepts undef values"
      
      This reverts commit a35c64ce.
      
      Reverting this commit as it causes various failures on LE and BE PPC bots.
      4e1fe968
    • Blue Gaston's avatar
      [TSan][Darwin] Additional TSAN test requiring weak symbol for dyld64 · cea1b790
      Blue Gaston authored
      Tests require a weak symbol for dyld weak-def coalescing.
      
      Differential Revision: https://reviews.llvm.org/D130732
      
      Adding additional weak attribute
      cea1b790
    • Austin Kerbow's avatar
      [AMDGPU] Omit unnecessary waitcnt before barriers · 2c82a126
      Austin Kerbow authored
      It is not necessary to wait for all outstanding memory operations before
      barriers on hardware that can back off of the barrier in the event of an
      exception when traps are enabled. Add a new subtarget feature which
      tracks which HW has this ability.
      
      Reviewed By: #amdgpu, rampitec
      
      Differential Revision: https://reviews.llvm.org/D130722
      2c82a126
    • Nico Weber's avatar
      [gn build] (manually) port 507125af more · 2063b5ed
      Nico Weber authored
      2063b5ed
    • Nico Weber's avatar
      [gn build] (manually) port 507125af · 72d0db59
      Nico Weber authored
      72d0db59
    • Fangrui Song's avatar
    • Louis Dionne's avatar
      [libc++] Rename __libcpp_assertion_handler to __libcpp_verbose_abort · 507125af
      Louis Dionne authored
      With the goal of reusing that handler to do other things besides
      handling assertions (such as terminating when an exception is thrown
      under -fno-exceptions), the name `__libcpp_assertion_handler` doesn't
      really make sense anymore.
      
      Furthermore, I didn't want to use the name `__libcpp_abort_handler`,
      since that would give the impression that the handler is called
      whenever `std::abort()` is called, which is not the case at all.
      
      Differential Revision: https://reviews.llvm.org/D130562
      507125af
    • Sunho Kim's avatar
      [clang-repl] Disable execution unittests on unsupported platforms. · 4191d661
      Sunho Kim authored
      After the intoduction of global destructor support, there is a possiblity to run invalid instructions in the destructor of Interpreter class. Completely disable tests in platforms with failing test cases.
      
      Differential Revision: https://reviews.llvm.org/D130786
      4191d661
    • Aaron Ballman's avatar
      Diagnose use of _Noreturn on a struct/union field · d8352abd
      Aaron Ballman authored
      C99 6.7.4p2 clarifies that a function specifier can only be used in the
      declaration of a function. _Noreturn is a function specifier, so it is
      a constraint violation to write it on a structure or union field, but
      we missed that case.
      
      Fixes #56800
      d8352abd
    • Tom Stellard's avatar
      workflows: Pass phab token to github-automation.py when creating a pull request · b9a66291
      Tom Stellard authored
      The script needs this in order to automatically assign a reviewer.
      b9a66291
    • Nico Weber's avatar
      [lld/mac] Comment changes requested on https://reviews.llvm.org/D130725 · 2681c9e0
      Nico Weber authored
      No behavior change.
      2681c9e0
    • Markus Böck's avatar
      [mlir][LLVM] Rework the API of GEPOp · 37da2a14
      Markus Böck authored
      The implementation and API of GEP Op has gotten a bit convoluted over the time. Issues with it are:
      * Misleading naming: `indices` actually only contains the dynamic indices, not all of them. To get the amount of indices you need to query the size of `structIndices`
      * Very difficult to iterate over all indices properly: One had to iterate over `structIndices`, check whether it contains the magic constant `kDynamicIndex`, if it does, access the next value in `index` etc.
      * Inconvenient to build: One either has create lots of constant ops for every index or have an odd split of passing both a `ValueRange` as well as a `ArrayRef<int32_t>` filled with `kDynamicIndex` at the correct places.
      * Implementation doing verification in the build method
      and more.
      
      This patch attempts to address all these issues via convenience classes and reworking the way GEP Op works:
      * Adds `GEPArg` class which is a sum type of a `int32_t` and `Value` and is used to have a single convenient easy to use `ArrayRef<GEPArg>` in the builders instead of the previous `ValueRange` + `ArrayRef<int32_t>` builders.
      * Adds `GEPIndicesAdapter` which is a class used for easy random access and iteration over the indices of a GEP. It is generic and flexible enough to also instead return eg. a corresponding `Attribute` for an operand inside of `fold`.
      *  Rename `structIndices` to `rawConstantIndices` and `indices` to `dynamicIndices`: `rawConstantIndices` signifies one shouldn't access it directly as it is encoded, and `dynamicIndices` is more accurate and also frees up the `indices` name.
      * Add `getIndices` returning a `GEPIndicesAdapter` to easily iterate over the GEP Ops indices.
      * Move the verification/asserts out of the build method and into the `verify` method emitting op error messages.
      * Add convenient builder methods making use of `GEPArg`.
      * Add canonicalizer turning dynamic indices with constant values into constant indices to have a canonical representation.
      
      The only breaking change is for any users building GEPOps that have so far used the old `ValueRange` + `ArrayRef<int32_t>` builder as well as those using the generic syntax.
      
      Another follow up patch then goes through upstream and makes use of the new `ArrayRef<GEPArg>` builder to remove a lot of code building constants for GEP indices.
      
      Differential Revision: https://reviews.llvm.org/D130730
      37da2a14
    • Alex Brachet's avatar
      [ELF] Strip directories for -Map when emitting reproducer rsp · 7baf1db3
      Alex Brachet authored
      Similarly to -o output directories will not be created so -Map being
      copied verbatim will likely cause ld.lld @response.txt to fail.
      
      Differential Revision: https://reviews.llvm.org/D130681
      7baf1db3
    • lewuathe's avatar
      [mlir][complex] Canonicalize complex.add zero · 730cb822
      lewuathe authored
      Adding complex value with 0 for real and imaginary part can be ignored.
      
      NOTE: This type of canonicalization can be written in an easy and tidy format using `complex.number` after constant op supports custom attribute.
      
      Differential Revision: https://reviews.llvm.org/D130748
      730cb822
    • Sanjay Patel's avatar
      [InstCombine] canonicalize zext-and-of-bool compare to narrow and · b5a9361c
      Sanjay Patel authored
      https://alive2.llvm.org/ce/z/3jYbEH
      
      We should choose one of these forms, and the option that uses
      the narrow type allows the motivating example from issue #56294
      to reduce. In the best case (no 'not' needed and 'trunc' remains),
      this does remove an instruction.
      
      Note that there is what looks like a regression because there
      is an existing canonicalization that turns trunc into and+icmp.
      That is a long-standing transform, and I'm not sure what effect
      reversing it would have.
      b5a9361c
    • Alex Zinenko's avatar
      [mlir][NFC] accept plain OpBuidler in folded construction helpers · 26821f75
      Alex Zinenko authored
      A group of functions in the Affine dialect provides a mechanism for
      buliding folded-by-construction operations. These functions used to
      accept a `RewriterBase` reference because they may need to erase the
      operations that were folded and notify the rewriter when called from
      rewrite patterns. Adopt a different approach: postpone the builder
      notification of the op creation until we are certain that the op will
      not be folded away. This removes the need to notify the rewriter about
      op deletion following op construction in case of successful folding, and
      removes a bunch of one-off `IRRewriter` instances in transform code that
      may mess up insertion points.
      
      Reviewed By: springerm, mravishankar
      
      Differential Revision: https://reviews.llvm.org/D130616
      26821f75
  2. Jul 29, 2022