1. Dec 06, 2018
  2. Dec 05, 2018
    • Brian Gesiak's avatar
      Revert "[IR] Add NODISCARD to attribute functions" · f240c4d4
      Brian Gesiak authored
      Revert https://reviews.llvm.org/D55217 due to warnings-turned-into-errors in
      AMGPU targets. I'll fix the warnings first, then re-commit this patch.
      
      llvm-svn: 348375
      f240c4d4
    • Chandler Carruth's avatar
      [SLH] Fix a nasty bug in SLH. · 71c14a36
      Chandler Carruth authored
      Whenever we effectively take the address of a basic block we need to
      manually update that basic block to reflect that fact or later passes
      such as tail duplication and tail merging can break the invariants of
      the code. =/ Sadly, there doesn't appear to be any good way of
      automating this or even writing a reasonable assert to catch it early.
      
      The change seems trivially and obviously correct, but sadly the only
      really good test case I have is 1000s of basic blocks. I've tried
      directly writing a test case that happens to make tail duplication do
      something that crashes later on, but this appears to require an
      *amazingly* complex set of conditions that I've not yet reproduced.
      
      The change is technically covered by the tests because we mark the
      blocks as having their address taken, but that doesn't really count as
      properly testing the functionality.
      
      llvm-svn: 348374
      71c14a36
    • Chandler Carruth's avatar
      [SLH] Regenerate tests with --no_x86_scrub_rip to restore the higher · e3ea1646
      Chandler Carruth authored
      fidelity checking of RIP-based references to basic blocks and other
      labels.
      
      These labels are super important for SLH tests so we should keep them
      readable in the test cases.
      
      llvm-svn: 348373
      e3ea1646
    • Brian Gesiak's avatar
      [IR] Add NODISCARD to attribute functions · df843bdd
      Brian Gesiak authored
      Summary:
      Many functions on `llvm::AttributeList` and `llvm::AttributeSet` are
      documented with "returns a new {list,set} because attribute
      {lists,sets} are immutable." This documentation can be aided by the
      addition of an attribute, `LLVM_NODISCARD`. Adding this prevents
      unsuspecting users of the API from expecting
      `AttributeList::setAttributes` from modifying the underlying list.
      
      At the very least, it would have saved me a few hours of debugging, since I
      had been doing just that! I had a bug in my program where I was calling
      `setAttributes` but then passing in the unmutated `AttributeList`.
      I tried adding LLVM_NODISCARD and confirmed that it would have made my bug
      immediately obvious.
      
      Reviewers: rnk, javed.absar
      
      Reviewed By: rnk
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D55217
      
      llvm-svn: 348372
      df843bdd
    • Valery Pykhtin's avatar
      [AMDGPU]: Turn on the DPP combiner by default · 5b4db77b
      Valery Pykhtin authored
      Differential revision: https://reviews.llvm.org/D55314
      
      llvm-svn: 348371
      5b4db77b
    • Kamil Rytarowski's avatar
      Add a new interceptor for modctl(2) from NetBSD · efadb532
      Kamil Rytarowski authored
      Summary:
      modctl - controls loadable kernel modules.
      
      Skip tests as this call uses privileged operations.
      
      Reviewers: vitalybuka, joerg
      
      Reviewed By: vitalybuka
      
      Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D55025
      
      llvm-svn: 348370
      efadb532
    • Kamil Rytarowski's avatar
      Add a new interceptor for nl_langinfo(3) from NetBSD · fab76435
      Kamil Rytarowski authored
      Summary:
      nl_langinfo - gets locale information.
      
      Add a dedicated test.
      
      Reviewers: vitalybuka, joerg
      
      Reviewed By: vitalybuka
      
      Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D55015
      
      llvm-svn: 348369
      fab76435
    • Kristina Brooks's avatar
      [Haiku] Support __float128 for x86 and x86_64 · 1051bb74
      Kristina Brooks authored
      This patch addresses a compilation error with clang when
      running in Haiku being unable to compile code using
      float128 (throws compilation error such as 'float128 is
      not supported on this target').
      
      Patch by kallisti5 (Alexander von Gluck IV)
      
      Differential Revision: https://reviews.llvm.org/D54901
      
      llvm-svn: 348368
      1051bb74
    • Sanjay Patel's avatar
      [InstCombine] simplify icmps with same operands based on dominating cmp · baffae91
      Sanjay Patel authored
      The tests here are based on the motivating cases from D54827.
      
      More background:
      1. We don't get these cases in general with SimplifyCFG because the root
         of the pattern match is an icmp, not a branch. I'm not sure how often
         we encounter this pattern vs. the seemingly more likely case with 
         branches, but I don't see evidence to leave the minimal pattern
         unoptimized.
      
      2. This has a chance of increasing compile-time because we're using a
         ValueTracking call to handle the match. The motivating cases could be
         handled with a simpler pair of calls to isImpliedTrueByMatchingCmp/
         isImpliedFalseByMatchingCmp, but I saw that we have a more 
         comprehensive wrapper around those, so we might as well use it here
         unless there's evidence that it's significantly slower.
      
      3. Ideally, we'd handle the fold to constants in InstSimplify, but as
         with the existing code here, we could extend this to handle cases
         where the result is not a constant, but a new combined predicate.
         That would mean splitting the logic across the 2 passes and possibly
         duplicating the pattern-matching cost.
      
      4. As mentioned in D54827, this seems like the kind of thing that should
         be handled in Correlated Value Propagation, but that pass is currently
         limited to dealing with instructions with constant operands, so extending
         this bit of InstCombine is the smallest/easiest way to get these patterns 
         optimized.
      
      llvm-svn: 348367
      baffae91
    • Simon Pilgrim's avatar
      [X86][SSE] Begun adding modulo rotate support to LowerRotate · 32483668
      Simon Pilgrim authored
      Prep work for PR38243 - mainly adding comments on where we need to add modulo support (doing so at the moment causes massive codegen regressions).
      
      I've also consistently added support for modulo folding for uniform constants (although at the moment we have no way to trigger this) and removed the old assertions.
      
      llvm-svn: 348366
      32483668
    • Ilya Biryukov's avatar
      Move detection of libc++ include dirs to Driver on MacOS · 44a40046
      Ilya Biryukov authored
      Summary:
      The intention is to make the tools replaying compilations from 'compile_commands.json'
      (clang-tidy, clangd, etc.) find the same standard library as the original compiler
      specified in 'compile_commands.json'.
      
      Previously, the library detection logic was in the frontend (InitHeaderSearch.cpp) and relied
      on the value of resource dir as an approximation of the compiler install dir. The new logic
      uses the actual compiler install dir and is performed in the driver. This is consistent with
      the C++ standard library detection on other platforms and allows to override the resource dir
      in the tools using the compile_commands.json without altering the
      standard library detection mechanism. The tools have to override the resource dir to make sure
      they use a consistent version of the builtin headers.
      
      There is still logic in InitHeaderSearch that attemps to add the absolute includes for the
      the C++ standard library, so we keep passing the -stdlib=libc++ from the driver to the frontend
      via cc1 args to avoid breaking that. In the long run, we should move this logic to the driver too,
      but it could potentially break the library detection on other systems, so we don't tackle it in this
      patch to keep its scope manageable.
      
      This is a second attempt to fix the issue, first one was commited in r346652 and reverted in r346675.
      The original fix relied on an ad-hoc propagation (bypassing the cc1 flags) of the install dir from the
      driver to the frontend's HeaderSearchOptions. Unsurpisingly, the propagation was incomplete, it broke
      the libc++ detection in clang itself, which caused LLDB tests to break.
      
      The LLDB tests pass with new fix.
      
      Reviewers: JDevlieghere, arphaman, EricWF
      
      Reviewed By: arphaman
      
      Subscribers: mclow.lists, ldionne, dexonsmith, ioeric, christof, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D54630
      
      llvm-svn: 348365
      44a40046
    • Renato Golin's avatar
      Revert: Honor -fdebug-prefix-map when creating function names for the debug info. · 5419a3ce
      Renato Golin authored
      This commit reverts r348060 and r348062 due to it breaking the AArch64 Full
      buildbot: https://bugs.llvm.org/show_bug.cgi?id=39892
      
      llvm-svn: 348364
      5419a3ce
    • Martin Storsjo's avatar
      [llvm-rc] Support not expressions. · d0afe724
      Martin Storsjo authored
      Patch by Jacek Caban!
      
      Differential Revision: https://reviews.llvm.org/D55242
      
      llvm-svn: 348363
      d0afe724
    • Simon Pilgrim's avatar
      [TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from... · 8fdaf5c9
      Simon Pilgrim authored
      [TargetLowering] Remove ISD::ANY_EXTEND/ANY_EXTEND_VECTOR_INREG opcodes from SimplifyDemandedVectorElts
      
      These have no test coverage and the KnownZero flags can't be guaranteed unlike SIGN/ZERO_EXTEND cases.
      
      llvm-svn: 348361
      8fdaf5c9
    • Stefan Granitz's avatar
    • Kadir Cetinkaya's avatar
      [clangd] Dont provide locations for non-existent files. · 6f9b2042
      Kadir Cetinkaya authored
      Summary:
      We were getting assertion errors when we had bad file names, instead we
      should skip those.
      
      Reviewers: hokein
      
      Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D55275
      
      llvm-svn: 348359
      6f9b2042
    • Simon Pilgrim's avatar
      [DAG] Add fshl/fshr tblgen opcodes · b97393fa
      Simon Pilgrim authored
      Missed off from https://reviews.llvm.org/D54698
      
      llvm-svn: 348358
      b97393fa
    • Mikael Holmen's avatar
      Fix compilation error when using clang 3.6.0 · 18e800f0
      Mikael Holmen authored
      llvm-svn: 348357
      18e800f0