1. Aug 19, 2020
    • Amara Emerson's avatar
      [GlobalISel] Add a combine for sext_inreg(load x), c --> sextload x · 04a6ea5d
      Amara Emerson authored
      This is restricted to single use loads, which if we fold to sextloads we can
      find more optimal addressing modes on AArch64.
      
      This also fixes an overload the MachineFunction::getMachineMemOperand() method
      which was incorrectly using the MF alignment instead of the MMO alignment.
      
      Differential Revision: https://reviews.llvm.org/D85966
      04a6ea5d
    • Amara Emerson's avatar
      [GlobalISel] Add a combine for ashr(shl x, c), c --> sext_inreg x, c' · 40e269ea
      Amara Emerson authored
      By detecting this sign extend pattern early, we can uncover opportunities for
      more optimizations.
      
      Differential Revision: https://reviews.llvm.org/D85965
      40e269ea
    • Rob Suderman's avatar
      Added std.floor operation to match std.ceil · 55565752
      Rob Suderman authored
      There should be an equivalent std.floor op to std.ceil. This includes
      matching lowerings for SPIRV, NVVM, ROCDL, and LLVM.
      
      Reviewed By: ftynse
      
      Differential Revision: https://reviews.llvm.org/D85940
      55565752
    • Arthur Eubanks's avatar
      [gn build] Add support for expensive checks · a1caa302
      Arthur Eubanks authored
      Reviewed By: hans, MaskRay
      
      Differential Revision: https://reviews.llvm.org/D86007
      a1caa302
    • Simon Pilgrim's avatar
      [X86][AVX] lowerShuffleWithVPMOV - add non-VLX support. · 11ff5176
      Simon Pilgrim authored
      We can efficiently handle non-VLX cases now that we have the getAVX512TruncNode helper.
      11ff5176
    • Arthur Eubanks's avatar
      Revert "[TSan][libdispatch] Add interceptors for dispatch_async_and_wait()" · 501a078c
      Arthur Eubanks authored
      This reverts commit d137db80.
      
      Breaks builds on older SDKs.
      501a078c
    • Mauricio Sifontes's avatar
      Create Optimization Pass Wrapper for MLIR Reduce · 8f4859d3
      Mauricio Sifontes authored
      Create a reduction pass that accepts an optimization pass as argument
      and only replaces the golden module in the pipeline if the output of the
      optimization pass is smaller than the input and still exhibits the
      interesting behavior.
      
      Add a -test-pass option to test individual passes in the MLIR Reduce
      tool.
      
      Reviewed By: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D84783
      8f4859d3
    • Fangrui Song's avatar
      [ARM] Fix build after D86087 · c466c5fa
      Fangrui Song authored
      c466c5fa
    • Mott, Jeffrey T's avatar
      Disable use of _ExtInt with '__atomic' builtins · ca77ab49
      Mott, Jeffrey T authored
      We're (temporarily) disabling ExtInt for the '__atomic' builtins so we can better design their behavior later. The idea is until we do an audit/design for the way atomic builtins are supposed to work with _ExtInt, we should leave them restricted so they don't limit our future options, such as by binding us to a sub-optimal implementation via ABI.
      
      Example after this change:
      
          $ cat test.c
      
              void f(_ExtInt(64) *ptr) {
                __atomic_fetch_add(ptr, 1, 0);
              }
      
          $ clang -c test.c
      
              test.c:2:22: error: argument to atomic builtin of type '_ExtInt' is not supported
                __atomic_fetch_add(ptr, 1, 0);
                                   ^
              1 error generated.
      
      Differential Revision: https://reviews.llvm.org/D84049
      ca77ab49
    • David Green's avatar
      [ARM] Allow tail predication of VLDn · 3471520b
      David Green authored
      VLD2/4 instructions cannot be predicated, so we cannot tail predicate
      them from autovec. From intrinsics though, they should be valid as they
      will just end up loading extra values into off vector lanes, not
      effecting the on lanes. The same is true for loads in general where so
      long as we are not using the other vector lanes, an unpredicated load
      can be converted to a predicated one.
      
      This marks VLD2 and VLD4 instructions as validForTailPredication and
      allows any unpredicated load in tail predication loop, which seems to be
      valid given the other checks we have.
      
      Differential Revision: https://reviews.llvm.org/D86022
      3471520b
    • Jan Kratochvil's avatar
      [lldb] [testsuite] Add split-file for check-lldb dependencies · 7baed769
      Jan Kratochvil authored
      D85968 started to use `split-file` and while buildbots run fine while
      doing `make check-lldb` by hand I get:
      
      .../llvm-monorepo-clangassert/tools/lldb/test/SymbolFile/DWARF/Output/DW_AT_declaration-with-children.s.script: line 2: split-file: command not found
      failed:
        lldb-shell :: SymbolFile/DWARF/DW_AT_declaration-with-children.s
      
      Differential Revision: https://reviews.llvm.org/D86144
      7baed769
    • Sam Tebbs's avatar
      [ARM] Use mov operand if the mov cannot be moved while tail predicating · 31f02ac6
      Sam Tebbs authored
      There are some cases where the instruction that sets up the iteration
      count for a tail predicated loop cannot be moved before the dlstp,
      stopping tail predication entirely. This patch checks if the mov operand
      can be used and if so, uses that instead.
      
      Differential Revision: https://reviews.llvm.org/D86087
      31f02ac6
    • George Mitenkov's avatar
      [MLIR][SPIRVToLLVM] Additional conversions for spirv-runner · cc98a0fb
      George Mitenkov authored
      This patch adds more op/type conversion support
      necessary for `spirv-runner`:
      - EntryPoint/ExecutionMode: currently removed since we assume
      having only one kernel function in the kernel module.
      - StorageBuffer storage class is now supported. We are not
      concerned with multithreading so this is fine for now.
      - Type conversion enhanced, now regular offsets and strides
      for structs and arrays are supported (based on
      `VulkanLayoutUtils`).
      - Support of `spc.AccessChain` that is modelled with GEP op
      in LLVM dialect.
      
      Reviewed By: mravishankar
      
      Differential Revision: https://reviews.llvm.org/D86109
      cc98a0fb
    • Dokyung Song's avatar
      [libFuzzer] Fix arguments of InsertPartOf/CopyPartOf calls in CrossOver mutator. · bb54bcf8
      Dokyung Song authored
      The CrossOver mutator is meant to cross over two given buffers (referred to as
      the first/second buffer henceforth). Previously InsertPartOf/CopyPartOf calls
      used in the CrossOver mutator incorrectly inserted/copied part of the second
      buffer into a "scratch buffer" (MutateInPlaceHere of the size
      CurrentMaxMutationLen), rather than the first buffer. This is not intended
      behavior, because the scratch buffer does not always (i) contain the content of
      the first buffer, and (ii) have the same size as the first buffer;
      CurrentMaxMutationLen is typically a lot larger than the size of the first
      buffer. This patch fixes the issue by using the first buffer instead of the
      scratch buffer in InsertPartOf/CopyPartOf calls.
      
      A FuzzBench experiment was run to make sure that this change does not
      inadvertently degrade the performance. The performance is largely the same; more
      details can be found at:
      https://storage.googleapis.com/fuzzer-test-suite-public/fixcrossover-report/index.html
      
      This patch also adds two new tests, namely "cross_over_insert" and
      "cross_over_copy", which specifically target InsertPartOf and CopyPartOf,
      respectively.
      
      - cross_over_insert.test checks if the fuzzer can use InsertPartOf to trigger
        the crash.
      
      - cross_over_copy.test checks if the fuzzer can use CopyPartOf to trigger the
        crash.
      
      These newly added tests were designed to pass with the current patch, but not
      without the it (with 790878f2 these tests do not
      pass). To achieve this, -max_len was intentionally given a high value. Without
      this patch, InsertPartOf/CopyPartOf will generate larger inputs, possibly with
      unpredictable data in it, thereby failing to trigger the crash.
      
      The test pass condition for these new tests is narrowed down by (i) limiting
      mutation depth to 1 (i.e., a single CrossOver mutation should be able to trigger
      the crash) and (ii) checking whether the mutation sequence of "CrossOver-" leads
      to the crash.
      
      Also note that these newly added tests and an existing test (cross_over.test)
      all use "-reduce_inputs=0" flags to prevent reducing inputs; it's easier to
      force the fuzzer to keep original input string this way than tweaking
      cov-instrumented basic blocks in the source code of the fuzzer executable.
      
      Differential Revision: https://reviews.llvm.org/D85554
      bb54bcf8
    • Fangrui Song's avatar
      [llvm-dwarfdump][test] Add a --statistics test for a DW_AT_artificial variable · aa48a480
      Fangrui Song authored
      There is an untested but useful case: `this` (even if not written) is counted as a
      source variable.
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D86044
      aa48a480
    • Jamie Schmeiser's avatar
      [NFC] Add raw_ostream parameter to printIR routines · 645c6856
      Jamie Schmeiser authored
      This is a non-functional-change to generalize the printIR routines so that
      the output can be saved and manipulated rather than being directly output
      to dbgs(). This is a prerequisite change for many upcoming changes that
      allow new ways of examining changes made to the IR in the new pass manager.
      
      Reviewed By: aeubanks (Arthur Eubanks)
      
      Differential Revision: https://reviews.llvm.org/D85999
      645c6856
    • Fangrui Song's avatar
      [ELF] Assign file offsets of non-SHF_ALLOC after SHF_ALLOC and set sh_addr=0 to non-SHF_ALLOC · ec29538a
      Fangrui Song authored
      * GNU ld places non-SHF_ALLOC sections after SHF_ALLOC sections. This has the
        advantage that the file offsets of a non-SHF_ALLOC cannot be contained in
        a PT_LOAD. This patch matches the behavior.
      * For non-SHF_ALLOC non-orphan sections, GNU ld may assign non-zero sh_addr and
        treat them similar to SHT_NOBITS (not advance location counter). This
        is an alternative approach to what we have done in D85100.
        By placing non-SHF_ALLOC sections at the end, we can drop special
        cases in createSection and findOrphanPos added by D85100.
      
        Different from GNU ld, we set sh_addr to 0 for non-SHF_ALLOC sections. 0
        arguably is better because non-SHF_ALLOC sections don't appear in the memory
        image.
      
      ELF spec says:
      
      > sh_addr - If the section will appear in the memory image of a process, this
      > member gives the address at which the section's first byte should
      > reside. Otherwise, the member contains 0.
      
      D85100 appeared to take a detour. If we take a combined view on D85100 and this
      patch, the overall complexity slightly increases (one more 3-line loop) and
      compatibility with GNU ld improves.
      
      The behavior we don't want to match is the special treatment of .symtab
      .shstrtab .strtab: they can be matched in LLD but not in GNU ld.
      
      Reviewed By: jhenderson, psmith
      
      Differential Revision: https://reviews.llvm.org/D85867
      ec29538a
  2. Aug 18, 2020