1. Jul 30, 2020
    • Tatyana Krasnukha's avatar
      [lldb] Make process plugins check whether a hardware breakpoint is required · b352e62f
      Tatyana Krasnukha authored
      Remove @skipIfWindows as process should report the error correctly on Windows now.
      
      Differential Revision: https://reviews.llvm.org/D84255
      b352e62f
    • Tatyana Krasnukha's avatar
      [lldb] Skip overlapping hardware and external breakpoints when writing memory · f7ec3e3b
      Tatyana Krasnukha authored
      This fixes the assertion `assert(intersects);` in the Process::WriteMemory function.
      
      Differential Revision: https://reviews.llvm.org/D84254
      f7ec3e3b
    • Matt Arsenault's avatar
      59fac51f
    • Julian Lettner's avatar
      [compiler-rt][Darwin] Disable EXC_GUARD exceptions · 7e946d0c
      Julian Lettner authored
      ASan/TSan use mmap in a way that creates “deallocation gaps” which
      triggers EXC_GUARD exceptions on macOS 10.15+ (XNU 19.0+).  Let's
      suppress those.
      7e946d0c
    • Tatyana Krasnukha's avatar
      [lldb/test] Put hardware breakpoint tests together, NFC · c114352e
      Tatyana Krasnukha authored
      Create a common base class for them to re-use supports_hw_breakpoints function in decorators.
      
      Differential Revision: https://reviews.llvm.org/D84311
      c114352e
    • Florian Hahn's avatar
      Revert "[SCEVExpander] Add option to preserve LCSSA directly." · dc286757
      Florian Hahn authored
      This reverts commit 99166fd4, because it
      breaks the polly builders.
      
      polly/test/Isl/CodeGen/invariant_load_escaping_second_scop.ll fails
      because a apparently unnecessary LCSSA phi node is introduced.
      
      Make the bots green again, while I take a closer look.
      dc286757
    • Louis Dionne's avatar
      [libc++] Remove c++98 from the possible Standards of the test suite · 82b6dec0
      Louis Dionne authored
      Clang treats C++98 and C++03 as the same anyway, so it's no use having
      two different settings for the same standard.
      82b6dec0
    • Louis Dionne's avatar
      [libc++][pstl] Remove c++98 from UNSUPPORTED annotations · b5e896c0
      Louis Dionne authored
      c++98 isn't used by the test suite anymore, only c++03 is.
      b5e896c0
    • Matt Arsenault's avatar
      GlobalISel: Implement lower for G_EXTRACT_VECTOR_ELT · 0b7de796
      Matt Arsenault authored
      Use the basic store to stack and reload.
      0b7de796
    • Kostya Serebryany's avatar
      Add more debug code for https://github.com/google/sanitizers/issues/1193... · 58743040
      Kostya Serebryany authored
      Add more debug code for https://github.com/google/sanitizers/issues/1193 (getting desperate, not being able to reproduce it for a few months, but the users are seeing it)
      
      mode debug code
      
      Reviewed By: vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D84819
      58743040
    • Jessica Paquette's avatar
      [AArch64][GlobalISel] Select XRO addressing mode with wide immediates · 7ff95755
      Jessica Paquette authored
      Port the wide immediate case from AArch64DAGToDAGISel::SelectAddrModeXRO.
      
      If we have a wide immediate which can't be represented in an add, we can end up
      with code like this:
      
      ```
      mov  x0, imm
      add x1, base, x0
      ldr  x2, [x1, 0]
      ```
      
      If we use the [base, xN] addressing mode instead, we can produce this:
      
      ```
      mov  x0, imm
      ldr  x2, [base, x0]
      ```
      
      This saves 0.4% code size on 7zip at -O3, and gives a geomean code size
      improvement of 0.1% on CTMark.
      
      Differential Revision: https://reviews.llvm.org/D84784
      7ff95755
    • Matt Arsenault's avatar
      AMDGPU: Relax restriction on folding immediates into physregs · 766cb615
      Matt Arsenault authored
      I never completed the work on the patches referenced by
      f8bf7d7f, but this was intended to
      avoid folding immediate writes into m0 which the coalescer doesn't
      understand very well. Relax this to allow simple SGPR immediates to
      fold directly into VGPR copies. This pattern shows up routinely in
      current GlobalISel code since nothing is smart enough to emit VGPR
      constants yet.
      766cb615
    • Tres Popp's avatar
      [MLIR][NFC] Move Shape::WitnessType Declaration. · f05308a2
      Tres Popp authored
      This moves it from ShapeOps.td to ShapeBase.td
      
      Differential Revision: https://reviews.llvm.org/D84845
      f05308a2
    • Matt Arsenault's avatar
      GloblaISel: Remove unreachable condition · 90b76dac
      Matt Arsenault authored
      Fixes bug 46882
      90b76dac
    • LLVM GN Syncbot's avatar
      [gn build] Port 276f9e8c · 0c4ea275
      LLVM GN Syncbot authored
      0c4ea275
    • Heejin Ahn's avatar
      [WebAssembly] Fix getBottom for loops · 276f9e8c
      Heejin Ahn authored
      When it was first created, CFGSort only made sure BBs in each
      `MachineLoop` are sorted together. After we added exception support,
      CFGSort now also sorts BBs in each `WebAssemblyException`, which
      represents a `catch` block, together, and
      `Region` class was introduced to be a thin wrapper for both
      `MachineLoop` and `WebAssemblyException`.
      
      But how we compute those loops and exceptions is different.
      `MachineLoopInfo` is constructed using the standard loop computation
      algorithm in LLVM; the definition of loop is "a set of BBs that are
      dominated by a loop header and have a path back to the loop header". So
      even if some BBs are semantically contained by a loop in the original
      program, or in other words dominated by a loop header, if they don't
      have a path back to the loop header, they are not considered a part of
      the loop. For example, if a BB is dominated by a loop header but
      contains `call abort()` or `rethrow`, it wouldn't have a path back to
      the header, so it is not included in the loop.
      
      But `WebAssemblyException` is wasm-specific data structure, and its
      algorithm is simple: a `WebAssemblyException` consists of an EH pad and
      all BBs dominated by the EH pad. So this scenario is possible: (This is
      also the situation in the newly added test in cfg-stackify-eh.ll)
      
      ```
      Loop L: header, A, ehpad, latch
      Exception E: ehpad, latch, B
      ```
      (B contains `abort()`, so it does not have a path back to the loop
      header, so it is not included in L.)
      
      And it is sorted in this order:
      ```
      header
      A
      ehpad
      latch
      B
      ```
      
      And when CFGStackify places `end_loop` or `end_try` markers, it
      previously used `WebAssembly::getBottom()`, which returns the latest BB
      in the sorted order, and placed the marker there. So in this case the
      marker placements will be like this:
      ```
      loop
        header
        try
          A
        catch
          ehpad
          latch
      end_loop         <-- misplaced!
          B
        end_try
      ```
      in which nesting between the loop and the exception is not correct.
      `end_loop` marker has to be placed after `B`, and also after `end_try`.
      
      Maybe the fundamental way to solve this problem is to come up with our
      own algorithm for computing loop region too, in which we include all BBs
      dominated by a loop header in a loop. But this takes a lot more effort.
      The only thing we need to fix is actually, `getBottom()`. If we make it
      return the right BB, which means in case of a loop, the latest BB of the
      loop itself and all exceptions contained in there, we are good.
      
      This renames `Region` and `RegionInfo` to `SortRegion` and
      `SortRegionInfo` and extracts them into their own file. And add
      `getBottom` to `SortRegionInfo` class, from which it can access
      `WebAssemblyExceptionInfo`, so that it can compute a correct bottom
      block for loops.
      
      Reviewed By: dschuff
      
      Differential Revision: https://reviews.llvm.org/D84724
      276f9e8c
    • Jonas Devlieghere's avatar
      [lldb] Improve platform handling in CreateTargetInternal · 4add8536
      Jonas Devlieghere authored
      Currently, `target create` has no --platform option. However,
      TargetList::CreateTargetInternal which is called under the hood, will
      return an error when either no platform or multiple matching platforms
      are found, saying that a platform should be specified with --platform.
      
      This patch adds the platform option, but that doesn't solve either of
      these errors.
      
       - If more than one platform matches, specifying the platform isn't
         going to fix that. The current code will only look at the
         architecture instead. I've updated the error message to ask the user
         to specify an architecture.
      
       - If no architecture is found, specifying a new one via platform isn't
         going to change that either because we already try to find one that
         matches the given architecture.
      
      Differential revision: https://reviews.llvm.org/D84809
      4add8536
    • Arthur Eubanks's avatar
      [Scudo][CMake] Add -fno-lto to Scudo libraries · e7196bdf
      Arthur Eubanks authored
      -fno-lto is in SANITIZER_COMMON_CFLAGS but not here.
      Don't use SANITIZER_COMMON_CFLAGS because of performance issues.
      See https://bugs.llvm.org/show_bug.cgi?id=46838.
      
      Fixes
      $ ninja TScudoCUnitTest-i386-Test
      on an LLVM build with -DLLVM_ENABLE_LTO=Thin.
      check-scudo now passes.
      
      Reviewed By: cryptoad
      
      Differential Revision: https://reviews.llvm.org/D84805
      e7196bdf
    • Hiroshi Yamauchi's avatar
      [PGO] Remove insignificant function hash values from some tests. · cd890944
      Hiroshi Yamauchi authored
      This is to avoid the need to update a bunch of test files when the PGO
      instrumentation function hashing changes.
      
      Split off of D84782.
      
      Differential Revision: https://reviews.llvm.org/D84865
      cd890944
    • Craig Topper's avatar
      [X86] Add custom lowering for llvm.roundeven with sse4.1. · c4823b24
      Craig Topper authored
      We can use the roundss/sd/ps/pd instructions like we do for
      ceil/floor/trunc/rint/nearbyint.
      
      Differential Revision: https://reviews.llvm.org/D84592
      c4823b24
    • Craig Topper's avatar
      [LV] Add abs/smin/smax/umin/umax intrinsics to isTriviallyVectorizable · 3efc978b
      Craig Topper authored
      This patch adds support for vectorizing these intrinsics.
      
      Differential Revision: https://reviews.llvm.org/D84796
      3efc978b
    • Arthur Eubanks's avatar
      [DFSan][NewPM] Port DataFlowSanitizer to NewPM · 71d0a2b8
      Arthur Eubanks authored
      Reviewed By: ychen, morehouse
      
      Differential Revision: https://reviews.llvm.org/D84707
      71d0a2b8
    • Sanjay Patel's avatar
      [InstSimplify] try constant folding intrinsics before general simplifications · ee9617e9
      Sanjay Patel authored
      This matches the behavior of simplify calls for regular opcodes -
      rely on ConstantFolding before spending time on folds with variables.
      
      I am not aware of any diffs from this re-ordering currently, but there was
      potential for unintended behavior from the min/max intrinsics because that
      code is implicitly assuming that only 1 of the input operands is constant.
      ee9617e9
    • Simon Pilgrim's avatar
      [DAG][AMDGPU][X86] Add SimplifyMultipleUseDemandedBits handling for... · fdc90277
      Simon Pilgrim authored
      [DAG][AMDGPU][X86] Add SimplifyMultipleUseDemandedBits handling for SIGN/ZERO_EXTEND + SIGN/ZERO_EXTEND_VECTOR_INREG
      
      Peek through multiple use ops like we already do for ANY_EXTEND/ANY_EXTEND_VECTOR_INREG
      
      Differential Revision: https://reviews.llvm.org/D84863
      fdc90277
    • Roman Lebedev's avatar
      [SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by... · 1d51dc38
      Roman Lebedev authored
      [SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by default, enable late in pipeline
      
      I've been looking at missed vectorizations in one codebase.
      One particular thing that stands out is that some of the loops
      reach vectorizer in a rather mangled form, with weird PHI's,
      and some of the loops aren't even in a rotated form.
      
      After taking a more detailed look, that happened because
      the loop's headers were too big by then. It is evident that
      SimplifyCFG's common code hoisting transform is at fault there,
      because the pattern it handles is precisely the unrotated
      loop basic block structure.
      
      Surprizingly, `SimplifyCFGOpt::HoistThenElseCodeToIf()` is enabled
      by default, and is always run, unlike it's friend, common code sinking
      transform, `SinkCommonCodeFromPredecessors()`, which is not enabled
      by default and is only run once very late in the pipeline.
      
      I'm proposing to harmonize this, and disable common code hoisting
      until //late// in pipeline. Definition of //late// may vary,
      here currently i've picked the same one as for code sinking,
      but i suppose we could enable it as soon as right after
      loop rotation happens.
      
      Experimentation shows that this does indeed unsurprizingly help,
      more loops got rotated, although other issues remain elsewhere.
      
      Now, this undoubtedly seriously shakes phase ordering.
      This will undoubtedly be a mixed bag in terms of both compile- and
      run- time performance, codesize. Since we no longer aggressively
      hoist+deduplicate common code, we don't pay the price of said hoisting
      (which wasn't big). That may allow more loops to be rotated,
      so we pay that price. That, in turn, that may enable all the transforms
      that require canonical (rotated) loop form, including but not limited to
      vectorization, so we pay that too. And in general, no deduplication means
      more [duplicate] instructions going through the optimizations. But there's still
      late hoisting, some of them will be caught late.
      
      As per benchmarks i've run {F12360204}, this is mostly within the noise,
      there are some small improvements, some small regressions.
      One big regression i saw i fixed in rG8d487668, but i'm sure
      this will expose many more pre-existing missed optimizations, as usual :S
      
      llvm-compile-time-tracker.com thoughts on this:
      http://llvm-compile-time-tracker.com/compare.php?from=e40315d2b4ed1e38962a8f33ff151693ed4ada63&to=c8289c0ecbf235da9fb0e3bc052e3c0d6bff5cf9&stat=instructions
      * this does regress compile-time by +0.5% geomean (unsurprizingly)
      * size impact varies; for ThinLTO it's actually an improvement
      
      The largest fallout appears to be in GVN's load partial redundancy
      elimination, it spends *much* more time in
      `MemoryDependenceResults::getNonLocalPointerDependency()`.
      Non-local `MemoryDependenceResults` is widely-known to be, uh, costly.
      There does not appear to be a proper solution to this issue,
      other than silencing the compile-time performance regression
      by tuning cut-off thresholds in `MemoryDependenceResults`,
      at the cost of potentially regressing run-time performance.
      D84609 attempts to move in that direction, but the path is unclear
      and is going to take some time.
      
      If we look at stats before/after diffs, some excerpts:
      * RawSpeed (the target) {F12360200}
        * -14 (-73.68%) loops not rotated due to the header size (yay)
        * -272 (-0.67%) `"Number of live out of a loop variables"` - good for vectorizer
        * -3937 (-64.19%) common instructions hoisted
        * +561 (+0.06%) x86 asm instructions
        * -2 basic blocks
        * +2418 (+0.11%) IR instructions
      * vanilla test-suite + RawSpeed + darktable  {F12360201}
        * -36396 (-65.29%) common instructions hoisted
        * +1676 (+0.02%) x86 asm instructions
        * +662 (+0.06%) basic blocks
        * +4395 (+0.04%) IR instructions
      
      It is likely to be sub-optimal for when optimizing for code size,
      so one might want to change tune pipeline by enabling sinking/hoisting
      when optimizing for size.
      
      Reviewed By: mkazantsev
      
      Differential Revision: https://reviews.llvm.org/D84108
      1d51dc38
    • Kang Zhang's avatar
      [PowerPC] Set v1i128 to expand for SETCC to avoid crash · 802c0430
      Kang Zhang authored
      Summary:
      PPC only supports the instruction selection for v16i8, v8i16, v4i32,
      v2i64, v4f32 and v2f64 for ISD::SETCC, don't support the v1i128, so
      v1i128 for ISD::SETCC will crash.
      
      This patch is to set v1i128 to expand to avoid crash.
      
      Reviewed By: steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D84238
      802c0430
    • Philip Reames's avatar
      [Statepoint] When using the tied def lowering, unconditionally use vregs [almost NFC] · 31342eb6
      Philip Reames authored
      This builds on 3da1a963 on the path towards supporting invokes and cross block relocations. The actual change attempts to be NFC, but does fail in one corner-case explained below.
      
      The change itself is fairly mechanical. Rather than remember SDValues - which are inherently block local - immediately produce a virtual register copy and remember that.
      
      Once this lands, we'll update the FunctionLoweringInfo::StatepointSpillMap map to allow register based lowerings, delete VirtRegs from StatepointLowering, and drop the restriction against cross block relocations. I deliberately separate the semantic part into it's own change for easy of understanding and fault isolation.
      
      The corner-case which isn't quite NFC is that the old implementation implicitly CSEd gc.relocates of the same SDValue regardless of type. The new implementation still only relocates once, but it produces distinct vregs for the bitcast and it's source, whereas SelectionDAG's generic CSE was able to remove the bitcast in the old implementation. Note that the final assembly doesn't change (at least in the test), as our MI level optimizations catch the duplication.
      
      I assert that this is an uninteresting corner-case. It's functionally correct, and if we find a case where this influences performance, we should really be canonicalizing types to i8* at the IR level.
      
      Differential Revision: https://reviews.llvm.org/D84692
      31342eb6
    • Joel E. Denny's avatar
      [OpenMP] Implement TR8 `present` motion modifier in runtime (2/2) · cee52dd0
      Joel E. Denny authored
      This patch implements OpenMP runtime support for the OpenMP TR8
      `present` motion modifier for `omp target update` directives.  The
      previous patch in this series implements Clang front end support.
      
      Reviewed By: grokos
      
      Differential Revision: https://reviews.llvm.org/D84712
      cee52dd0
    • Joel E. Denny's avatar
      [OpenMP] Implement TR8 `present` motion modifier in Clang (1/2) · 9f2f3b9d
      Joel E. Denny authored
      This patch implements Clang front end support for the OpenMP TR8
      `present` motion modifier for `omp target update` directives.  The
      next patch in this series implements OpenMP runtime support.
      
      Reviewed By: ABataev
      
      Differential Revision: https://reviews.llvm.org/D84711
      9f2f3b9d
    • Arthur Eubanks's avatar
      [NewPM][Attributor] Pin tests with -attributor to legacy PM · 4a10029d
      Arthur Eubanks authored
      All these tests already explicitly test against both legacy PM and NPM.
      
      $ sed -i 's/ -attributor / -attributor -enable-new-pm=0 /g' $(rg --path-separator // -l -- -passes=)
      $ sed -i 's/ -attributor-cgscc / -attributor-cgscc -enable-new-pm=0 /g' $(rg --path-separator // -l -- -passes=)
      
      Now all tests in Transforms/Attributor/ pass under NPM.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D84813
      4a10029d
  2. Jul 29, 2020