1. Feb 02, 2020
    • Fangrui Song's avatar
      [DebugInfo] Merge DebugInfoFinder::{processDeclare,processValue} into processVariable · ecd2aaee
      Fangrui Song authored
      The two functions are identical.
      ecd2aaee
    • Jacques Pienaar's avatar
      [mlir] Expand shape functions in ShapeInference doc · c4b4c0c4
      Jacques Pienaar authored
      Summary:
      Start filling in some requirements for the shape function descriptions
      that will be used to derive shape computations. This requiement part may
      later be reworked to be part of the "context" section of shape dialect. Without
      examples this may be a bit too abstract but I hope not (given mappings to
      existing shape functions).
      
      Differential Revision: https://reviews.llvm.org/D73572
      c4b4c0c4
    • Fangrui Song's avatar
      [PatchableFunction] Use an empty DebugLoc · 5932f7b8
      Fangrui Song authored
      The current FirstMI.getDebugLoc() is actually null in almost all cases.
      If it isn't, the generated .loc will be considered initial. The .loc
      will have the prologue_end flag and terminate the prologue prematurely.
      
      Also use an overload of BuildMI that will not prepend
      PATCHABLE_FUNCTION_ENTRY to a MachineInstr bundle.
      5932f7b8
    • Brian Gesiak's avatar
      [ADT] 'PointerUnion::is' returns 'bool' · d82e993c
      Brian Gesiak authored
      Summary:
      The return type of 'PointerUnion::is' has been 'int' since it was first
      added in March 2009, in SVN r67987, or
      https://github.com/llvm/llvm-project/commit/a9c6de15fb3.
      
      The only other change to this member function was a clang-format applied
      in December 2015, in SVN r256513, or
      https://github.com/llvm/llvm-project/commit/548a49aacc0.
      
      However, since the return value is the result of a `==` comparison, an
      implicit cast must be made converting the boolean result to an `int`.
      Change the return type to `bool` to remove the need for such a cast.
      
      Test Plan:
      I ran llvm-project `check-all` under ASAN, no failures were reported
      (other than obviously unrelated tests that were already failing in
      ASAN buildbots).
      
      Reviewers: gribozavr, gribozavr2, rsmith, bkramer, dblaikie
      
      Subscribers: dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73836
      d82e993c
    • Nicolai Hähnle's avatar
      AMDGPU/GFX10: Fix NSA reassign pass when operands are undef · ba811016
      Nicolai Hähnle authored
      Summary:
      Virtual registers that are undef have an empty LiveInterval at this
      point, which means beginIndex() and endIndex() cannot be used. We
      only need those indices to determine the range in which to scan for
      affected other NSA instructions, and undef operands cannot contribute
      to that range.
      
      Reviewers: arsenm, rampitec, mareko
      
      Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73831
      ba811016
    • Michael Liao's avatar
      [clang][driver] Remove an unused parameter. NFC. · 268e57bd
      Michael Liao authored
      - Group relevant code together.
      268e57bd
    • Craig Topper's avatar
      [X86] In X86FastEmitSSESelect, fall back to SelectionDAG if the inputs to the... · a57dd66d
      Craig Topper authored
      [X86] In X86FastEmitSSESelect, fall back to SelectionDAG if the inputs to the compare can't be found in registers.
      
      We were checking that the original Value * for the compare operands
      were null. But that can never happen.
      
      I believe we intended to check for 0 registers here instead.
      
      Fixes PR44749.
      a57dd66d
    • Craig Topper's avatar
      [X86] Don't exit from foldOffsetIntoAddress if the Offset is 0, but AM.Disp is non-zero. · d975910c
      Craig Topper authored
      This is an alternate fix for the issue D73606 was trying to
      solve.
      
      The main issue here is that we bailed out of
      foldOffsetIntoAddress if Offset is 0. But if we just found a
      symbolic displacement and AM.Disp became non-zero
      earlier, we still need to validate that AM.Disp with the symbolic
      displacement.
      
      This is my second attempt at committing this after failing
      build bots previously. One thing I realized about the previous
      attempt is that its possible that AM.Disp is already non-zero
      and the new Offset changes it back to zero. In that case my
      previous attempt failed to update AM.Disp to zero. So this patch
      removes the early out for 0 and appropriately handle the 0 case
      in each check so we still update AM.Disp at the end.
      d975910c
    • Stefan Gränitz's avatar
      Add ThinLtoJIT example · 234f3b16
      Stefan Gränitz authored
      Summary:
      Prototype of a JIT compiler that utilizes ThinLTO summaries to compile modules ahead of time. This is an implementation of the concept I presented in my "ThinLTO Summaries in JIT Compilation" talk at the 2018 Developers' Meeting: http://llvm.org/devmtg/2018-10/talk-abstracts.html#lt8
      
      Upfront the JIT first populates the *combined ThinLTO module index*, which provides fast access to the global call-graph and module paths by function. Next, it loads the main function's module and compiles it. All functions in the module will be emitted with prolog instructions that *fire a discovery flag* once execution reaches them. In parallel, the *discovery thread* is busy-watching the existing flags. Once it detects one has fired, it uses the module index to find all functions that are reachable from it within a given number of calls and submits their defining modules to the compilation pipeline.
      
      While execution continues, more flags are fired and further modules added. Ideally the JIT can be tuned in a way, so that in the majority of cases the code on the execution path can be compiled ahead of time. In cases where it doesn't work, the JIT has a *definition generator* in place that loads modules if missing functions are reached.
      
      Reviewers: lhames, dblaikie, jfb, tejohnson, pree-jackie, AlexDenisov, kavon
      
      Subscribers: mgorny, mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, jfb, merge_guards_bot, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72486
      234f3b16
    • Craig Topper's avatar
      [LegalizeTypes][X86] Add a new strategy for type legalizing f16 type that... · 943b5561
      Craig Topper authored
      [LegalizeTypes][X86] Add a new strategy for type legalizing f16 type that softens it to i16, but promotes to f32 around arithmetic ops.
      
      This is based on this llvm-dev thread http://lists.llvm.org/pipermail/llvm-dev/2019-December/137521.html
      
      The current strategy for f16 is to promote type to float every except where the specific width is required like loads, stores, and bitcasts. This results in rounding occurring in odd places instead of immediately after arithmetic operations. This interacts in weird ways with the __fp16 type in clang which is a storage only type where arithmetic is always promoted to float. InstCombine can remove some fpext/fptruncs around such arithmetic and turn it into arithmetic on half. This wouldn't be so bad if SelectionDAG was able to put those fpext/fpround back in when it promotes.
      
      It is also not obvious how to handle to make the existing strategy work with STRICT fp. We need to use STRICT versions of the conversions which require chain operands. But if the conversions are created for a bitcast, there is no place to get an appropriate chain from.
      
      This patch implements a different strategy where conversions are emitted directly around arithmetic operations. And otherwise its passed around as an i16 including in arguments and return values. This can result in more conversions between arithmetic operations, but is closer to matching the IR the frontend generates for __fp16. And it will allow us to use the chain from constrained arithmetic nodes to link the STRICT_FP_TO_FP16/STRICT_FP16_TO_FP that will need to be added. I've set it up so that each target can opt into the new behavior. Converting all the targets myself was more than I was able to handle.
      
      Differential Revision: https://reviews.llvm.org/D73749
      943b5561
    • Mark de Wever's avatar
      [Sema] Remove a -Wrange warning from -Wall · c03349e4
      Mark de Wever authored
      During the review of D73007 Aaron Puchert mentioned
      `warn_for_range_variable_always_copy` shouldn't be part of -Wall since
      some coding styles require `for(const auto &bar : bars)`. This warning
      would cause false positives for these users. Based on Aaron's proposal
      refactored the warnings:
      
      * -Wrange-loop-construct warns about possibly unintended constructor
        calls. This is part of -Wall. It contains
        * warn_for_range_copy: loop variable A of type B creates a copy from
          type C
        * warn_for_range_const_reference_copy: loop variable A is initialized
          with a value of a different type resulting in a copy
      * -Wrange-loop-bind-reference warns about misleading use of reference
        types. This is not part of -Wall. It contains
        * warn_for_range_variable_always_copy: loop variable A is always a copy
          because the range of type B does not return a reference
      
      Differential Revision: https://reviews.llvm.org/D73434
      c03349e4
    • mydeveloperday's avatar
      [clang-format] Add option for not breaking line before ObjC params · 70c98671
      mydeveloperday authored
      Summary:
      From `clang-format` version 3.7.0 and up, , there is no way to keep following format of ObjectiveC block:
      ```
      - (void)_aMethod
      {
          [self.test1 t:self w:self callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
              u = c;
          }]
      }
      ```
      Regardless of the change in `.clang-format` configuration file, all parameters will be lined up so that colons will be on the same column, like following:
      ```
      - (void)_aMethod
      {
          [self.test1 t:self
                      w:self
               callback:^(typeof(self) self, NSNumber *u, NSNumber *v) {
                   u = c;
               }]
      }
      ```
      
      Considering with ObjectiveC, the first code style is cleaner & more readable for some people, I've added a config option: `ObjCDontBreakBeforeNestedBlockParam` (boolean) so that if it is enable, the first code style will be favored.
      
      Reviewed By: MyDeveloperDay
      
      Patch By: ghvg1313
      
      Tags: #clang, #clang-format
      
      Differential Revision: https://reviews.llvm.org/D70926
      70c98671
    • Jacques Pienaar's avatar
      [mlir] Fix errors in release & no-assert · 1544cf2d
      Jacques Pienaar authored
      Seen on gcc 8, in release mode & assertions off warnings about logger,
      made all statements referencing logger inside LLVM_DEBUG blocks and
      ifdef a few variables only used in debug.
      
      This is mechanical fix to get CI green.
      1544cf2d
  2. Feb 01, 2020