Skip to content
  1. Sep 04, 2018
    • Sanjay Patel's avatar
      [InstCombine] improve xor+and/or tests · 664b2e3b
      Sanjay Patel authored
      The tests attempted to check for commuted variants
      of these folds, but complexity-based canonicalization
      meant we had no coverage for at least 1/2 of the cases.
      
      Also, the folds correctly check hasOneUse(), but there
      was no coverage for that.
      
      llvm-svn: 341394
      664b2e3b
    • Matt Arsenault's avatar
      AMDGPU: Fix DAG divergence not reporting flat loads · 813613c4
      Matt Arsenault authored
      Match behavior in DAG of r340343
      
      llvm-svn: 341393
      813613c4
    • Matt Arsenault's avatar
      DAG: Factor out helper function for odd vector sizes · a6f32f40
      Matt Arsenault authored
      llvm-svn: 341392
      a6f32f40
    • Hiroshi Yamauchi's avatar
      Fix build failures after rL341386. · 72ee6d60
      Hiroshi Yamauchi authored
      Reviewers: davidxl
      
      Reviewed By: davidxl
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51647
      
      llvm-svn: 341391
      72ee6d60
    • Nico Weber's avatar
      clang-cl: Pass /Brepro to linker if it was passed to the compiler · 88f72854
      Nico Weber authored
      Differential Revision: https://reviews.llvm.org/D51635
      
      llvm-svn: 341390
      88f72854
    • Dan Gohman's avatar
      [WebAssembly] Fix operand rewriting in inline asm lowering. · 045a217b
      Dan Gohman authored
      Use MachineOperand::ChangeToImmediate rather than reassigning
      MachineOperands to new values created from MachineOperand::CreateImm,
      so that their parent pointers are preserved.
      
      This fixes "Instruction has operand with wrong parent set" errors
      reported by the MachineVerifier.
      
      llvm-svn: 341389
      045a217b
    • Charles Davis's avatar
      [CMake] Remove variable reference that isn't used. · 7a474b65
      Charles Davis authored
      Summary:
      This variable is never defined, so its value is always empty. Since
      `libunwind` is needed to build the C++ ABI library in the first place,
      it should never be linked to the C++ ABI library anyway.
      
      Reviewers: mstorsjo, rnk
      
      Subscribers: mgorny, christof, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51644
      
      llvm-svn: 341388
      7a474b65
    • David Bolvansky's avatar
      Terminate debugger if an assert was hit · 4d46fde6
      David Bolvansky authored
      Reviewers: JDevlieghere, teemperor, #lldb
      
      Reviewed By: JDevlieghere
      
      Subscribers: clayborg, lemo, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D51604
      
      llvm-svn: 341387
      4d46fde6
    • Hiroshi Yamauchi's avatar
      [PGO] Control Height Reduction · 9775a620
      Hiroshi Yamauchi authored
      Summary:
      Control height reduction merges conditional blocks of code and reduces the
      number of conditional branches in the hot path based on profiles.
      
      if (hot_cond1) { // Likely true.
        do_stg_hot1();
      }
      if (hot_cond2) { // Likely true.
        do_stg_hot2();
      }
      
      ->
      
      if (hot_cond1 && hot_cond2) { // Hot path.
        do_stg_hot1();
        do_stg_hot2();
      } else { // Cold path.
        if (hot_cond1) {
          do_stg_hot1();
        }
        if (hot_cond2) {
          do_stg_hot2();
        }
      }
      
      This speeds up some internal benchmarks up to ~30%.
      
      Reviewers: davidxl
      
      Reviewed By: davidxl
      
      Subscribers: xbolva00, dmgreen, mehdi_amini, llvm-commits, mgorny
      
      Differential Revision: https://reviews.llvm.org/D50591
      
      llvm-svn: 341386
      9775a620
    • Matt Morehouse's avatar
      [libFuzzer] Enable tests on Windows · 24568789
      Matt Morehouse authored
      Summary:
      Enable tests on Windows and make check-fuzzer pass on it.  Make
      check-fuzzer pass on Windows by fixing libFuzzer, fixing tests, and by
      disabling tests on Windows. Most of these are disabled temporarily as
      support for the tests and the features they test will be added
      incrementally.  Other tests will not be enabled since they require
      things that are not on Windows (eg: afl_driver tests).  Every test
      that was explicitly disabled on Windows has a comment explaining why
      (unless obvious like merge-posix.test).
      
      The lit.cfg file was modified to support running tests on windows.
      fuzzer-dirs.test was fixed by making the Windows implementation print
      the same error message as the posix version.
      merge-control-file.test was fixed by making the test binary end with
      the ".exe" extension (on all platforms).
      
      Patch By: metzman
      
      Reviewers: morehouse
      
      Reviewed By: morehouse
      
      Subscribers: srhines, mgorny
      
      Differential Revision: https://reviews.llvm.org/D51549
      
      llvm-svn: 341385
      24568789
    • Matt Morehouse's avatar
      [TSan] Update assembly test again. · facfb70d
      Matt Morehouse authored
      Previous commit incorrectly updated the read1 case.
      
      llvm-svn: 341384
      facfb70d
    • Matt Morehouse's avatar
      [TSan] Update assembly code check. · 876d382c
      Matt Morehouse authored
      The new assembly makes our benchmark faster, so it should be safe to
      update the check.
      
      llvm-svn: 341381
      876d382c
    • Scott Linder's avatar
      [CodeGen] Fix remaining zext() assertions in SelectionDAG · cab029f4
      Scott Linder authored
      Fix remaining cases not committed in https://reviews.llvm.org/D49574
      
      Differential Revision: https://reviews.llvm.org/D50659
      
      llvm-svn: 341380
      cab029f4
    • Francis Visoiu Mistrih's avatar
    • Francis Visoiu Mistrih's avatar
      [MachO] Fix LC_DYSYMTAB validation for external symbols · 7690af4d
      Francis Visoiu Mistrih authored
      We were validating the same index (ilocalsym) twice, while iextdefsym
      was never validated.
      
      llvm-svn: 341378
      7690af4d
    • Jonas Devlieghere's avatar
      [dwarfdump] Improve -diff option by hiding more data. · 88145238
      Jonas Devlieghere authored
      The -diff option makes it easy to diff dwarf by hiding addresses and
      offsets. However not all of them were hidden, which should be fixed by
      this patch.
      
      Differential revision: https://reviews.llvm.org/D51593
      
      llvm-svn: 341377
      88145238
    • Sam McCall's avatar
      [clangd] Load static index asynchronously, add tracing. · 76c4c3af
      Sam McCall authored
      Summary:
      Like D51475 but simplified based on recent patches.
      While here, clarify that loadIndex() takes a filename, not file content.
      
      Reviewers: ioeric
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51638
      
      llvm-svn: 341376
      76c4c3af
    • Sam McCall's avatar
      [clangd] Define a compact binary serialization fomat for symbol slab/index. · 50f36310
      Sam McCall authored
      Summary:
      This is intended to replace the current YAML format for general use.
      It's ~10x more compact than YAML, and ~40% more compact than gzipped YAML:
        llvmidx.riff = 20M, llvmidx.yaml = 272M, llvmidx.yaml.gz = 32M
      It's also simpler/faster to read and write.
      
      The format is a RIFF container (chunks of (type, size, data)) with:
       - a compressed string table
       - simple binary encoding of symbols (with varints for compactness)
      It can be extended to include occurrences, Dex posting lists, etc.
      
      There's no rich backwards-compatibility scheme, but a version number is included
      so we can detect incompatible files and do ad-hoc back-compat.
      
      Alternatives considered:
       - compressed YAML or JSON: bulky and slow to load
       - llvm bitstream: confusing model and libraries are hard to use. My attempt
         produced slightly larger files, and the code was longer and slower.
       - protobuf or similar: would be really nice (esp for back-compat) but the
         dependency is a big hassle
       - ad-hoc binary format without a container: it seems clear we're going
         to add posting lists and occurrences here, and that they will benefit
         from sharing a string table. The container makes it easy to debug
         these pieces in isolation, and make them optional.
      
      Reviewers: ioeric
      
      Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51585
      
      llvm-svn: 341375
      50f36310
    • Kirill Bobyrev's avatar
      [clangd] NFC: Change quality type to float · cc8b507a
      Kirill Bobyrev authored
      Reviewed by: sammccall
      
      Differential Revision: https://reviews.llvm.org/D51636
      
      llvm-svn: 341374
      cc8b507a
    • Christian Bruel's avatar
      Fix the -print-multi-directory flag to print the selected multilib. · ed1d6db9
      Christian Bruel authored
      Summary: Fix -print-multi-directory to print the selected multilib
      
      Reviewers: jroelofs
      
      Reviewed By: jroelofs
      
      Subscribers: srhines, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51354
      
      llvm-svn: 341373
      ed1d6db9
    • Jonas Hahnfeld's avatar
      [libomptarget][CUDA] Use cuDeviceGetAttribute, NFCI. · bb51d398
      Jonas Hahnfeld authored
      cuDeviceGetProperties has apparently been deprecated since CUDA 5.0.
      Nvidia started using annotations only in CUDA 9.2, so nobody noticed
      nor cared before.
      The new function returns the same values, tested with a P100.
      
      Differential Revision: https://reviews.llvm.org/D51624
      
      llvm-svn: 341372
      bb51d398
    • Jonas Hahnfeld's avatar
      [libomptarget] PR38704: Fix erase of ShadowPtrMap · f7f86971
      Jonas Hahnfeld authored
      erase() invalidates the iterator and returns a new one pointing
      to the following element. The code now follows the example at
      https://en.cppreference.com/w/cpp/container/map/erase.
      (The added testcase crashes without this patch.)
      
      Reported by David Binderman (https://llvm.org/PR38704)!
      
      Differential Revision: https://reviews.llvm.org/D51623
      
      llvm-svn: 341371
      f7f86971
    • Jonas Hahnfeld's avatar
      [libomptarget][NVPTX] Drop dead code and data structures, NFCI. · 82d20201
      Jonas Hahnfeld authored
       * cg and HasCancel in WorkDescr were never read and can be removed.
       * This eliminates the last use of priv in ThreadPrivateContext.
       * CounterGroup is unused afterwards.
       * Remove duplicate external declares in omptarget-nvptx.cu that are
         already in the header omptarget-nvptx.h.
      
      Differential Revision: https://reviews.llvm.org/D51622
      
      llvm-svn: 341370
      82d20201
    • Kirill Bobyrev's avatar
      [clangd] Move buildStaticIndex() to SymbolYAML · d5bc6544
      Kirill Bobyrev authored
      `buildStaticIndex()` is used by two other tools that I'm building, now
      it's useful outside of `tool/ClangdMain.cpp`.
      
      Also, slightly refactor the code while moving it to the different source
      file.
      
      Reviewed By: sammccall
      
      Differential Revision: https://reviews.llvm.org/D51626
      
      llvm-svn: 341369
      d5bc6544
    • Sam McCall's avatar
      [clangd] SymbolOccurrences -> Refs and cleanup · b0138317
      Sam McCall authored
      Summary:
      A few things that I noticed while merging the SwapIndex patch:
       - SymbolOccurrences and particularly SymbolOccurrenceSlab are unwieldy names,
         and these names appear *a lot*. Ref, RefSlab, etc seem clear enough
         and read/format much better.
       - The asymmetry between SymbolSlab and RefSlab (build() vs freeze()) is
         confusing and irritating, and doesn't even save much code.
         Avoiding RefSlab::Builder was my idea, but it was a bad one; add it.
       - DenseMap<SymbolID, ArrayRef<Ref>> seems like a reasonable compromise for
         constructing MemIndex - and means many less wasted allocations than the
         current DenseMap<SymbolID, vector<Ref*>> for FileIndex, and none for
         slabs.
       - RefSlab::find() is not actually used for anything, so we can throw
         away the DenseMap and keep the representation much more compact.
       - A few naming/consistency fixes: e.g. Slabs,Refs -> Symbols,Refs.
      
      Reviewers: ioeric
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51605
      
      llvm-svn: 341368
      b0138317
    • Ilya Biryukov's avatar
      Adding HardLink Support to VirtualFileSystem. · d5554c51
      Ilya Biryukov authored
      Summary:
      Added support of creating a hardlink from one file to another file.
      After a hardlink is added between two files, both file will have the same:
        1. UniqueID (inode)
        2. Size
        3. Buffer
      
      This will bring replay of compilation closer to the actual compilation. There are instances where clang checks for the UniqueID of the file/header to be loaded which leads to a different behavior during replay as all files have different UniqueIDs.
      
      Patch by Utkarsh Saxena!
      
      Reviewers: ilya-biryukov
      
      Reviewed By: ilya-biryukov
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51359
      
      llvm-svn: 341366
      d5554c51
    • Chandler Carruth's avatar
      Revert r341269: [Constant Hoisting] Hoisting Constant GEP Expressions · 6cb12444
      Chandler Carruth authored
      One of the tests is failing 50% of the time when expensive checks are
      enabled. Not sure how deep the problem is so just reverting while the
      author can investigate so that the bots stop repeatedly failing and
      blaming things incorrectly. Will respond with details on the original
      commit.
      
      llvm-svn: 341365
      6cb12444
    • Sven van Haastregt's avatar
      Fix some Wundef warnings in Compiler.h · 9a5cd78e
      Sven van Haastregt authored
      Check for definedness of the __cpp_sized_deallocation and
      __cpp_aligned_new feature test macros.  These will not be defined
      when the feature is not available, and that prevents any code that
      includes this header from compiling with -Wundef -Werror.
      
      Differential Revision: https://reviews.llvm.org/D51171
      
      llvm-svn: 341364
      9a5cd78e
    • Chandler Carruth's avatar
      [x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative · 664aa868
      Chandler Carruth authored
      Load Hardening.
      
      Wires up the existing pass to work with a proper IR attribute rather
      than just a hidden/internal flag. The internal flag continues to work
      for now, but I'll likely remove it soon.
      
      Most of the churn here is adding the IR attribute. I talked about this
      Kristof Beyls and he seemed at least initially OK with this direction.
      The idea of using a full attribute here is that we *do* expect at least
      some forms of this for other architectures. There isn't anything
      *inherently* x86-specific about this technique, just that we only have
      an implementation for x86 at the moment.
      
      While we could potentially expose this as a Clang-level attribute as
      well, that seems like a good question to defer for the moment as it
      isn't 100% clear whether that or some other programmer interface (or
      both?) would be best. We'll defer the programmer interface side of this
      for now, but at least get to the point where the feature can be enabled
      without relying on implementation details.
      
      This also allows us to do something that was really hard before: we can
      enable *just* the indirect call retpolines when using SLH. For x86, we
      don't have any other way to mitigate indirect calls. Other architectures
      may take a different approach of course, and none of this is surfaced to
      user-level flags.
      
      Differential Revision: https://reviews.llvm.org/D51157
      
      llvm-svn: 341363
      664aa868
    • Simon Pilgrim's avatar
      Remove lambda default parameter to silence -Wpedantic warning. NFCI. · 9875ae48
      Simon Pilgrim authored
      llvm-svn: 341362
      9875ae48
    • Aaron Ballman's avatar
      Disable -Wnoexcept-type due to false positives with GCC. · 89225ed5
      Aaron Ballman authored
      GCC triggers false positives if a nothrow function is called through a template argument. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80985 for details. The LLVM libraries have no stable C++ API, so the warning is not useful.
      
      llvm-svn: 341361
      89225ed5
    • Chandler Carruth's avatar
      Revert r341342: Dwarf .debug section compression support (zlib, zlib-gnu). · 163222f5
      Chandler Carruth authored
      Also reverts follow-up commits r341343 and r341344.
      
      The primary commit continues to break some build bots even after the
      fixes in r341343 for UBSan issues:
      http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/5823
      
      It is also failing for me locally (linux, x86-64).
      
      llvm-svn: 341360
      163222f5
    • Chandler Carruth's avatar
      [x86/SLH] Teach SLH to harden against the "ret2spec" attack by · 219888d1
      Chandler Carruth authored
      implementing the proposed mitigation technique described in the original
      design document.
      
      The idea is to check after calls that the return address used to arrive
      at that location is in fact the correct address. In the event of
      a mis-predicted return which reaches a *valid* return but not the
      *correct* return, this will detect the mismatch much like it would
      a mispredicted conditional branch.
      
      This is the last published attack vector that I am aware of in the
      Spectre v1 space which is not mitigated by SLH+retpolines. However,
      don't read *too* much into that: this is an area of ongoing research
      where we expect more issues to be discovered in the future, and it also
      makes no attempt to mitigate Spectre v4. Still, this is an important
      completeness bar for SLH.
      
      The change here is of course delightfully simple. It was predicated on
      cutting support for post-instruction symbols into LLVM which was not at
      all simple. Many thanks to Hal Finkel, Reid Kleckner, and Justin Bogner
      who helped me figure out how to do a bunch of the complex changes
      involved there.
      
      Differential Revision: https://reviews.llvm.org/D50837
      
      llvm-svn: 341358
      219888d1
    • Kristina Brooks's avatar
      Do not leak the Mach host port in sys::getHostCPUName() · 51ae9346
      Kristina Brooks authored
      Patch by rsesek (Robert Sesek)
      
      llvm-svn: 341357
      51ae9346
    • Chandler Carruth's avatar
      [x86/SLH] Teach SLH to harden indirect branches and switches without · 8d8489f5
      Chandler Carruth authored
      retpolines.
      
      This implements the core design of tracing the intended target into the
      target, checking it, and using that to update the predicate state. It
      takes advantage of a few interesting aspects of SLH to make it a bit
      easier to implement:
      - We already split critical edges with conditional branches, so we can
      assume those are gone.
      - We already unfolded any memory access in the indirect branch
      instruction itself.
      
      I've left hard errors in place to catch if any of these somewhat subtle
      invariants get violated.
      
      There is some code that I can factor out and share with D50837 when it
      lands, but I didn't want to couple landing the two patches, so I'll do
      that in a follow-up cleanup commit if alright.
      
      Factoring out the code to handle different scenarios of materializing an
      address remains frustratingly hard. In a bunch of cases you want to fold
      one of the cases into an immediate operand of some other instruction,
      and you also have both symbols and basic blocks being used which require
      different methods on the MI builder (and different operand kinds).
      Still, I'll take a stab at sharing at least some of this code in
      a follow-up if I can figure out how.
      
      Differential Revision: https://reviews.llvm.org/D51083
      
      llvm-svn: 341356
      8d8489f5
    • Nicola Zaghen's avatar
      [InstCombine] Fold icmp ugt/ult (add nuw X, C2), C --> icmp ugt/ult X, (C - C2) · 9588ad96
      Nicola Zaghen authored
      Support for sgt/slt was added in rL294898, this adds the same cases also for unsigned compares.
      
      This is the Alive proof: https://rise4fun.com/Alive/nyY
      
      Differential Revision: https://reviews.llvm.org/D50972
      
      llvm-svn: 341353
      9588ad96
    • David Chisnall's avatar
      Revert "Disable the GNUstep v2 ABI on Windows." · ef16ea7f
      David Chisnall authored
      This reverts commit b4547c9cadd2f8adfe3f3182e4c56e466c5256cb.
      
      Apparently git llvm push from the monorepo does not respect branches and
      pushes the current branch to master.
      
      llvm-svn: 341352
      ef16ea7f
    • David Chisnall's avatar
      Disable the GNUstep v2 ABI on Windows. · 6d924ad2
      David Chisnall authored
      The code remains so that we can potentially reenable it in a point
      release, but the driver will reject it.  Several issues were raised
      during testing that made it clear that this was not quite ready for
      general consumption.
      
      Approved by: Hans Wennborg
      
      llvm-svn: 341350
      6d924ad2
    • Fedor Sergeev's avatar
      [NFC] correcting patterns in time-passes test to fix buildbot · 961811f3
      Fedor Sergeev authored
      llvm-svn: 341348
      961811f3
    • Max Kazantsev's avatar
      [NFC] Add assert to detect LCSSA breaches early · f34115c6
      Max Kazantsev authored
      llvm-svn: 341347
      f34115c6
Loading