1. Sep 27, 2020
  2. Sep 26, 2020
    • Jacques Pienaar's avatar
      93628ea9
    • Simon Pilgrim's avatar
      [X86] Cleanup check-prefixes for vector-mul.ll tests · 010c445f
      Simon Pilgrim authored
      Many x86/x64 SSE tests codegen are the same so avoid duplication
      010c445f
    • Simon Pilgrim's avatar
      [DAG] Fold vector mul(x,0)/mul(x,1) to a clearing mask · a61272a9
      Simon Pilgrim authored
      If we're multiplying all elements of a vector by '0' or '1' then we can more efficiently perform this as a clearing mask (that is likely to further simplify to a shuffle blend).
      
      This was noticed when reviewing D87502 but seems to help idiv/irem by constant cases even more as '0'/'1' values are often used for 'passthrough' cases.
      
      Differential Revision: https://reviews.llvm.org/D88225
      a61272a9
    • Simon Pilgrim's avatar
    • Serge Pavlov's avatar
      Run test on particular target only · f91b9c0f
      Serge Pavlov authored
      The test `AST/const-fpfeatures-diag.c` requires setting strict FP
      semantics, so it fails on targets where support of such semantic
      is limited.
      f91b9c0f
    • Paul C. Anagnostopoulos's avatar
    • Florian Hahn's avatar
      [DSE] Unify & fix mem terminator location checks. · 8f0466ed
      Florian Hahn authored
      When looking for memory defs killed by memory terminators the code
      currently incorrectly ignores the size argument of llvm.lifetime.end.
      
      This patch updates the code to use isMemTerminator and updates
      isMemTerminator to use isOverwrite() to make sure locations that are
      outside the range marked as dead by llvm.lifetime.end are not
      considered. Note that isOverwrite is only used for llvm.lifetime.end,
      because free-like functions make the whole underlying object dead.
      8f0466ed
    • Florian Hahn's avatar
      [DSE] Add tests with lifetime.end that only mark parts of the obj as dead. · b2c0193a
      Florian Hahn authored
      llvm.lifetime.end accepts a size parameters to limit the size of the
      location marked as dead. Add a few tests with stores to locations after
      the part that has been marked as dead.
      b2c0193a
    • Serge Pavlov's avatar
      [FPEnv] Evaluate constant expressions under non-default rounding modes · 6314f412
      Serge Pavlov authored
      The change implements evaluation of constant floating point expressions
      under non-default rounding modes. The main objective was to support
      evaluation of global variable initializers, where constant rounding mode
      may be specified by `#pragma STDC FENV_ROUND`.
      
      Differential Revision: https://reviews.llvm.org/D87822
      6314f412
    • Tyker's avatar
      [LoopDelete][Assume] Allow deleting loops with assumes · 8d5b289a
      Tyker authored
      This pervent very poor optimization caused by a signle assume like https://godbolt.org/z/EK3oMh
      
      baseline flags: -O3
      patched flags: -O3 -mllvm --enable-knowledge-retention
      
      Before the patch
      ```
      Metric: compile_time
      Program                                                      baseline patched diff
                   test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test  20.72    29.74  43.5%
                           test-suite :: CTMark/Bullet/bullet.test  24.39    24.91   2.2%
                     test-suite :: CTMark/7zip/7zip-benchmark.test  37.39    38.06   1.8%
                            test-suite :: CTMark/kimwitu++/kc.test  11.76    11.94   1.5%
                         test-suite :: CTMark/sqlite3/sqlite3.test  12.94    12.91  -0.3%
                             test-suite :: CTMark/SPASS/SPASS.test  11.72    11.70  -0.2%
                           test-suite :: CTMark/lencod/lencod.test  16.12    16.10  -0.1%
                         test-suite :: CTMark/ClamAV/clamscan.test  13.31    13.30  -0.1%
                    test-suite :: CTMark/mafft/pairlocalalign.test   9.12     9.12  -0.1%
       test-suite :: CTMark/consumer-typeset/consumer-typeset.test   9.34     9.34  -0.1%
                                                Geomean difference                   4.2%
      
      Metric: compiler_Kinst_count
      Program                                                      baseline     patched      diff
                   test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 107576069.87 172886418.90 60.7%
                           test-suite :: CTMark/Bullet/bullet.test 123291865.66 125457117.96  1.8%
                            test-suite :: CTMark/kimwitu++/kc.test  56347884.64  57298544.14  1.7%
                     test-suite :: CTMark/7zip/7zip-benchmark.test 180637699.58 183341656.57  1.5%
                         test-suite :: CTMark/sqlite3/sqlite3.test  66723788.85  66664692.80 -0.1%
                         test-suite :: CTMark/ClamAV/clamscan.test  69581500.56  69597863.92  0.0%
                           test-suite :: CTMark/lencod/lencod.test  94236501.48  94216545.32 -0.0%
                             test-suite :: CTMark/SPASS/SPASS.test  58516756.95  58505089.07 -0.0%
       test-suite :: CTMark/consumer-typeset/consumer-typeset.test  48832815.53  48841989.39  0.0%
                    test-suite :: CTMark/mafft/pairlocalalign.test  49682720.53  49686324.34  0.0%
                                                Geomean difference                            5.4%
      ```
      
      After the patch
      ```
      Metric: compile_time
      Program                                                      baseline patched diff
                   test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test  20.70    22.40   8.2%
                     test-suite :: CTMark/7zip/7zip-benchmark.test  37.13    38.05   2.5%
                           test-suite :: CTMark/Bullet/bullet.test  24.25    24.83   2.4%
                            test-suite :: CTMark/kimwitu++/kc.test  11.69    11.94   2.2%
                         test-suite :: CTMark/ClamAV/clamscan.test  13.19    13.36   1.3%
                           test-suite :: CTMark/lencod/lencod.test  16.02    16.19   1.1%
       test-suite :: CTMark/consumer-typeset/consumer-typeset.test   9.29     9.36   0.7%
                             test-suite :: CTMark/SPASS/SPASS.test  11.64    11.73   0.7%
                    test-suite :: CTMark/mafft/pairlocalalign.test   9.10     9.15   0.5%
                         test-suite :: CTMark/sqlite3/sqlite3.test  12.95    12.96   0.0%
                                                Geomean difference                   1.9%
      
      Metric: compiler_Kinst_count
      Program                                                      baseline     patched      diff
                   test-suite :: CTMark/tramp3d-v4/tramp3d-v4.test 107590933.61 114044834.72  6.0%
                            test-suite :: CTMark/kimwitu++/kc.test  56344526.77  57235806.29  1.6%
                           test-suite :: CTMark/Bullet/bullet.test 123291285.10 125128334.97  1.5%
                     test-suite :: CTMark/7zip/7zip-benchmark.test 180641540.10 183155706.39  1.4%
                         test-suite :: CTMark/sqlite3/sqlite3.test  66725619.22  66668713.92 -0.1%
                             test-suite :: CTMark/SPASS/SPASS.test  58509029.85  58478704.75 -0.1%
       test-suite :: CTMark/consumer-typeset/consumer-typeset.test  48843711.23  48826894.68 -0.0%
                           test-suite :: CTMark/lencod/lencod.test  94233305.79  94207544.23 -0.0%
                         test-suite :: CTMark/ClamAV/clamscan.test  69587887.66  69603549.90  0.0%
                    test-suite :: CTMark/mafft/pairlocalalign.test  49686968.65  49689291.04  0.0%
                                                Geomean difference                            1.0%
      ```
      
      Reviewed By: jdoerfert, efriedma
      
      Differential Revision: https://reviews.llvm.org/D86816
      8d5b289a
    • Simon Atanasyan's avatar
      [CodeGen] Do not call `emitGlobalConstantLargeInt` for constant requires 8 bytes to store · c6c5629f
      Simon Atanasyan authored
      This is a fix for PR47630. The regression is caused by the D78011. After
      this change the code starts to call the `emitGlobalConstantLargeInt` even
      for constants which requires eight bytes to store.
      
      Differential revision: https://reviews.llvm.org/D88261
      c6c5629f
    • Qiu Chaofan's avatar
      [SelectionDAG] Add guard to automatically insert flags · c0f8e4c0
      Qiu Chaofan authored
      This is like FastMathFlagGuard in IR. Since we use SDAG instance to get
      values, it's with SelectionDAG. By creating a FlagInserter in current
      scope, all values created by getNode will get the flags if no Flags
      argument provided.
      
      In this patch, I applied it to floating point operations folding part in
      DAG combiner, and removed Flags passing to getNode to show its effect.
      Other places in DAG combiner and other helper methods similar to getNode
      also need this. They can be done in follow-up patches.
      
      Reviewed By: spatel
      
      Differential Revision: https://reviews.llvm.org/D87361
      c0f8e4c0
    • Dmitry Antipov's avatar
    • Dmitry Antipov's avatar
      96318f64
    • Fangrui Song's avatar
      63c58c2b
    • John Demme's avatar
      Common code preparation for tblgen-types patch · 76419525
      John Demme authored
      Cleanup and add methods which https://reviews.llvm.org/D86904 requires. Breaking up to lower review load.
      
      Reviewed By: mehdi_amini
      
      Differential Revision: https://reviews.llvm.org/D88267
      76419525
    • Shilei Tian's avatar
      [Clang][OpenMP] Added support for nowait target in CodeGen via regular task · ebb1092a
      Shilei Tian authored
      Previously for nowait target, CG emitted a function call to `__tgt_target_nowait`, etc. However, in OpenMP RTL, these functions just directly call the no-nowait version, which means nowait is not working as expected.
      
      OpenMP specification says a target is acutally a target task, which is an untied and detachable task. It is natural to go to the direction that generates a task for a nowait target. However, OpenMP task has a problem that it must be within to a parallel region; otherwise the task will be executed immediately. As a result, if we directly wrap to a regular task, the `target nowait` outside of a parallel region is still a synchronous version.
      
      In D77609, I added the support for unshackled task in OpenMP RTL. Basically, unshackled task is a task that is not bound to any parallel region. So all nowait target will be tranformed into an unshackled task. In order to distinguish from regular task, a new flag bit is set for unshackled task. This flag will be used by RTL for later process.
      
      Since all target tasks are allocated via `__kmpc_omp_target_task_alloc`, and in current `libomptarget`, `__kmpc_omp_target_task_alloc` just calls `__kmpc_omp_task_alloc`. Therefore, we can modify the flag in `__kmpc_omp_target_task_alloc` so that we don't need to modify the FE too much. If users choose to opt out the feature, they just need to use a RTL w/o support of unshackled threads.
      
      As a result, in this patch, the `target nowait` region is simply wrapped into a regular task. Later once we have RTL support for unshackled tasks, the wrapped tasks can be executed by unshackled threads w/o changes in the FE.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D78075
      ebb1092a
    • Amara Emerson's avatar
      [AArch64][GlobalISel] If a G_BUILD_VECTOR operands are all G_CONSTANT then assign to gpr bank. · 546e460a
      Amara Emerson authored
      Even if the type is s8/s16, assigning to gpr is preferable with constants because
      worst case we can select via a constant pool load, and without cross-bank copies
      to the FPR bank more patterns can be imported later.
      546e460a
    • Arthur Eubanks's avatar
      [LowerTypeTests][NewPM] Add constructor that uses command line flags · 83e3ea2c
      Arthur Eubanks authored
      This matches the legacy PM pass by having one constructor use command
      line flags, and the other use parameters to the pass.
      
      This fixes all tests under Transforms/LowerTypeTests using NPM.
      
      Reviewed By: ychen, pcc
      
      Differential Revision: https://reviews.llvm.org/D87845
      83e3ea2c
    • Amara Emerson's avatar
    • Fangrui Song's avatar
      [lldb/bindings] Fix -Wformat after D88123 · 67782a0f
      Fangrui Song authored
      67782a0f
    • Evandro Menezes's avatar
      [RISCV] Update driver tests · a000580a
      Evandro Menezes authored
      Add the RISC-V Bullet core to the driver tests.
      a000580a
    • Michael Collison's avatar
      [RISCV] Scheduler description for Bullet · 764c1b7a
      Michael Collison authored
      
      
      Add the pipeline model for the RISC-V Bullet micro architecture.
      
      Co-authored-by: default avatarEvandro Menezes <evandro.menezes@sifive.com>
      764c1b7a
    • Alexander Shaposhnikov's avatar
      [Object][MachO] Refine the interface of Slice · 97702c3d
      Alexander Shaposhnikov authored
      This patch performs a minor cleanup of the class Slice:
      static methods and constructors which take a pointer but assume that
      it's not null now take the argument by reference.
      NFC.
      
      Test plan: make check-all
      
      Differential revision: https://reviews.llvm.org/D88320
      97702c3d
    • Craig Topper's avatar
      [IR] Improve the description for Constant::isNormalFP to list all things that... · b5f46534
      Craig Topper authored
      [IR] Improve the description for Constant::isNormalFP to list all things that are not normal instead of just denormal. NFC
      b5f46534
    • Evandro Menezes's avatar
      [RISCV] Fix formatting (NFC) · 0291c471
      Evandro Menezes authored
      0291c471
    • Juneyoung Lee's avatar
      [LangRef] Clarify the behavior of memory access instructions when... · 8bd205bf
      Juneyoung Lee authored
      [LangRef] Clarify the behavior of memory access instructions when pointers/sizes aren't well-defined
      
      This is a patch to LangRef that clarifies the behavior of load/store/memset/memcpy/memmove when the pointers or sizes are not well-defined
      as well.
      
      MSan detects a case when e.g., only lower bits of address are garbage when `-msan-check-access-address` is enabled, and it does not directly conflict with this patch because a C program should not use a pointer with undef bits and reasonable optimizations do not convert a well-defined pointer into a pointer with undef bits.
      
      This patch contains a definition of a well-defined value as well.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D87994
      8bd205bf
    • Craig Disselkoen's avatar
      C API: functions to get mask of a ShuffleVector · 51cad041
      Craig Disselkoen authored
      This commit fixes a regression (from LLVM 10 to LLVM 11 RC3) in the LLVM
      C API.
      
      Previously, commit 1ee6ec2b removed the mask operand from the
      ShuffleVector instruction, storing the mask data separately in the
      instruction instead; this reduced the number of operands of
      ShuffleVector from 3 to 2. AFAICT, this change unintentionally caused
      a regression in the LLVM C API. Specifically, it is no longer possible
      to get the mask of a ShuffleVector instruction through the C API. This
      patch introduces new functions which together allow a C API user to get
      the mask of a ShuffleVector instruction, restoring the functionality
      which was previously available through LLVMGetOperand().
      
      This patch also adds tests for this change to the llvm-c-test
      executable, which involved adding support for InsertElement,
      ExtractElement, and ShuffleVector itself (as well as constant vectors)
      to echo.cpp. Previously, vector operations weren't tested at all in
      echo.ll.
      
      I also fixed some typos in comments and help-text nearby these changes,
      which I happened to spot while developing this patch. Since the typo
      fixes are technically unrelated other than being in the same files, I'm
      happy to take them out if you'd rather they not be included in the patch.
      
      Differential Revision: https://reviews.llvm.org/D88190
      51cad041
    • Layton Kifer's avatar
      [TRE][NFC] Refactor Basic Block Processing · 48961ba0
      Layton Kifer authored
      Simplify and improve readability.
      
      Differential Revision: https://reviews.llvm.org/D82269
      48961ba0
    • Eli Friedman's avatar
      [AArch64][SVE] Drop "argmemonly" from gather/scatter with vector base. · 4600e210
      Eli Friedman authored
      The intrinsics don't have any pointer arguments, so "argmemonly" makes
      optimizations think they don't write to memory at all.
      
      Differential Revision: https://reviews.llvm.org/D88186
      4600e210