1. Jan 24, 2020
    • Saar Raz's avatar
      [Concepts] Update cxx_status.html with Concepts support status · f394d22f
      Saar Raz authored
      Concepts will be available with Clang 10 - update cxx_status.html to reflect
      the papers that have been implemented.
      f394d22f
    • Michael Spencer's avatar
      [clang][clang-scan-deps] Aggregate the full dependency information. · 356a4b43
      Michael Spencer authored
      Differential Revision: https://reviews.llvm.org/D70268
      
      This is a recommit of f978ea49 with a fix for the PowerPC failure.
      
      The issue was that:
      * `CompilerInstance::ExecuteAction` calls
        `getTarget().adjust(getLangOpts());`.
      * `PPCTargetInfo::adjust` changes `LangOptions::HasAltivec`.
      * This happens after the first few calls to `getModuleHash`.
      
      There’s even a FIXME saying:
      ```
        // FIXME: We shouldn't need to do this, the target should be immutable once
        // created. This complexity should be lifted elsewhere.
      ```
      
      This only showed up on PowerPC because it's one of the few targets that
      almost always changes a hashed langopt.
      
      I looked into addressing the fixme, but that would be a much larger
      change, and it's not the only thing that happens in `ExecuteAction` that
      can change the module context hash. Instead I changed the code to not
      call `getModuleHash` until after it has been modified in `ExecuteAction`.
      356a4b43
    • Changpeng Fang's avatar
      AMDGPU: Implement FDIV optimizations in AMDGPUCodeGenPrepare · 25315359
      Changpeng Fang authored
          Summary:
            RCP has the accuracy limit. If FDIV fpmath require high accuracy rcp may not
          meet the requirement. However, in DAG lowering, fpmath information gets lost,
          and thus we may generate either inaccurate rcp related computation or slow code
          for fdiv.
      
          In patch implements fdiv optimizations in the AMDGPUCodeGenPrepare, which could
          exactly know !fpmath.
      
           FastUnsafeRcpLegal: We determine whether it is legal to use rcp based on
                               unsafe-fp-math, fast math flags, denormals and fpmath
                               accuracy request.
      
           RCP Optimizations:
             1/x -> rcp(x) when fast unsafe rcp is legal or fpmath >= 2.5ULP with
                                                            denormals flushed.
             a/b -> a*rcp(b) when fast unsafe rcp is legal.
      
           Use fdiv.fast:
             a/b -> fdiv.fast(a, b) when RCP optimization is not performed and
                                    fpmath >= 2.5ULP with denormals flushed.
      
             1/x -> fdiv.fast(1,x)  when RCP optimization is not performed and
                                    fpmath >= 2.5ULP with denormals.
      
          Reviewers:
            arsenm
      
          Differential Revision:
            https://reviews.llvm.org/D71293
      25315359
    • Johannes Doerfert's avatar
      [Attributor] Avoid REQUIRED dependences in favor of OPTIONAL ones · 7ad17e00
      Johannes Doerfert authored
      When we use information only to short-cut deduction or improve it, we
      can use OPTIONAL dependences instead of REQUIRED ones to avoid cascading
      pessimistic fixpoints.
      
      We also need to track dependences only when we use assumed information,
      e.g., we act on assumed liveness information.
      7ad17e00
    • Johannes Doerfert's avatar
      [Attributor] Record dependences only when necessary · 214ed3f6
      Johannes Doerfert authored
      If we use assumed information from AAValueSimplify we need to record
      an OPTIONAL dependence, otherwise we do not.
      214ed3f6
    • Johannes Doerfert's avatar
      [Attributor][FIX] Avoid dangling pointers during code deletion · 5429c82d
      Johannes Doerfert authored
      It can happen that we have instructions in the ToBeDeletedInsts set
      which are deleted earlier already. To avoid dangling pointers we use
      weak tracking handles.
      5429c82d
    • Johannes Doerfert's avatar
      [Attributor][FIX] Handle non-pointers when following uses · ff6254dc
      Johannes Doerfert authored
      When we follow uses, e.g., in AAMemoryBehavior or AANoCapture, we need
      to make sure the value is a pointer before we ask for abstract
      attributes only valid for pointers. This happens because we follow
      pointers through calls that do not capture but may return the value.
      ff6254dc
    • Johannes Doerfert's avatar
      [Attributor][NFC] Do not (try to) simplify void values · 9dcf889d
      Johannes Doerfert authored
      We might accidentally ask AAValueSimplify to simplify a void value. That
      can lead to very interesting, and very wrong, results. We now handle
      this case gracefully.
      9dcf889d
    • Jonas Devlieghere's avatar
      [lldb/Util] Use md5 instead of python's hash function. · 47d7a81b
      Jonas Devlieghere authored
      Because of the way the Python hash function works, it's not guaranteed
      to be the same. This was causing a lot of reproducers to be generated
      for the same tests, even though the CWD or arguments didn't change.
      Switching to an MD5 hash should fix that.
      47d7a81b
    • Teresa Johnson's avatar
      Fix bot failure from 59733525 · 19c76989
      Teresa Johnson authored
      Fix bot failure by loosening up the register matching on new test:
      http://lab.llvm.org:8011/builders/clang-x86_64-debian-new-pass-manager-fast/builds/2423
      19c76989
    • Dmitry Polukhin's avatar
      [clang-tidy] Add clang-tidy headers to clang distribution · 301a4372
      Dmitry Polukhin authored
      Summary:
      Clang releases include static libraries for clang-tidy but corresponding
      headers are missing in the tarball so these libraries are almost useless.
      Clang-tidy libraries can be useful for build custom clang-tidy with
      custom checks outside of llvm repo.
      
      List of clang-tidy libraries included in clang 9.0.1 release:
          lib/libclangTidyMPIModule.a
          lib/libclangTidyPlugin.a
          lib/libclangTidyBoostModule.a
          lib/libclangTidyCERTModule.a
          lib/libclangTidyAndroidModule.a
          lib/libclangTidyPortabilityModule.a
          lib/libclangTidyPerformanceModule.a
          lib/libclangTidyOpenMPModule.a
          lib/libclangTidyBugproneModule.a
          lib/libclangTidyZirconModule.a
          lib/libclangTidyCppCoreGuidelinesModule.a
          lib/libclangTidyGoogleModule.a
          lib/libclangTidyUtils.a
          lib/libclangTidyHICPPModule.a
          lib/libclangTidyModernizeModule.a
          lib/libclangTidyLLVMModule.a
          lib/libclangTidyAbseilModule.a
          lib/libclangTidyReadabilityModule.a
          lib/libclangTidyFuchsiaModule.a
          lib/libclangTidyMiscModule.a
          lib/libclangTidy.a
          lib/libclangTidyObjCModule.a
      
      Reviewers: smeenai, jdoerfert, alexfh, hokein, aaron.ballman
      
      Subscribers: mgehre, mgorny, xazax.hun, cfe-commits
      
      Tags: #clang-tools-extra, #clang
      
      Differential Revision: https://reviews.llvm.org/D73236
      301a4372
    • Alina Sbirlea's avatar
      [LoopStrengthReduce] Reuse utility method to clean dead instructions. [NFCI] · 1d091742
      Alina Sbirlea authored
      Create a utility wrapper for the RecursivelyDeleteTriviallyDeadInstructions utility
      method, which sets to nullptr the instructions that are not trivially
      dead. Use the new method in LoopStrengthReduce.
      Alternative: add a bool to the same method; this option adds a marginal
      amount of overhead to the other callers, and the method needs to be
      updated to return a bool status when it removes/doesn't remove
      instructions.
      1d091742
    • Saar Raz's avatar
      [Concepts] Make constraint expressions unevaluated until satisfaction checking · 73eaf624
      Saar Raz authored
      As per P1980R0, constraint expressions are unevaluated operands, and their constituent atomic
      constraints only become constant evaluated during satisfaction checking.
      
      Change the evaluation context during parsing and instantiation of constraints to unevaluated.
      73eaf624
    • Johannes Doerfert's avatar
      [Attributor][FIX][Alignment] Do not report a change if there was none · 30179d7e
      Johannes Doerfert authored
      If alignment was manifested but it is actually only as good as the
      data-layout provided one we should not report it as a change.
      
      For testing purposes we still manifest the information.
      30179d7e
    • Johannes Doerfert's avatar
      [Attributor][NFC] Add an assertion · e273ac4d
      Johannes Doerfert authored
      e273ac4d
    • Johannes Doerfert's avatar
      [Attributor][NFC] Fix spelling · d07b5a55
      Johannes Doerfert authored
      d07b5a55
    • Johannes Doerfert's avatar
      [Attributor] `byval` arguments are always `noalias` · 2baf000e
      Johannes Doerfert authored
      `byval` introduces a local copy of the argument. That copy cannot alias
      anything.
      2baf000e
    • Johannes Doerfert's avatar
      [Attributor][FIX] Store alignment only holds for the pointer value · 30ae859c
      Johannes Doerfert authored
      We accidentally used the store alignment for the value operand as well,
      which is incorrect and crashed the SPASS application in the test suite.
      30ae859c
    • Teresa Johnson's avatar
      [LTO/WPD] Enable aggressive WPD under LTO option · 59733525
      Teresa Johnson authored
      Summary:
      Third part in series to support Safe Whole Program Devirtualization
      Enablement, see RFC here:
      http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html
      
      This patch adds type test metadata under -fwhole-program-vtables,
      even for classes without hidden visibility. It then changes WPD to skip
      devirtualization for a virtual function call when any of the compatible
      vtables has public vcall visibility.
      
      Additionally, internal LLVM options as well as lld and gold-plugin
      options are added which enable upgrading all public vcall visibility
      to linkage unit (hidden) visibility during LTO. This enables the more
      aggressive WPD to kick in based on LTO time knowledge of the visibility
      guarantees.
      
      Support was added to all flavors of LTO WPD (regular, hybrid and
      index-only), and to both the new and old LTO APIs.
      
      Unfortunately it was not simple to split the first and second parts of
      this part of the change (the unconditional emission of type tests and
      the upgrading of the vcall visiblity) as I needed a way to upgrade the
      public visibility on legacy WPD llvm assembly tests that don't include
      linkage unit vcall visibility specifiers, to avoid a lot of test churn.
      
      I also added a mechanism to LowerTypeTests that allows dropping type
      test assume sequences we now aggressively insert when we invoke
      distributed ThinLTO backends with null indexes, which is used in testing
      mode, and which doesn't invoke the normal ThinLTO backend pipeline.
      
      Depends on D71907 and D71911.
      
      Reviewers: pcc, evgeny777, steven_wu, espindola
      
      Subscribers: emaste, Prazek, inglorion, arichardson, hiraditya, MaskRay, dexonsmith, dang, davidxl, cfe-commits, llvm-commits
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71913
      59733525
    • Alina Sbirlea's avatar
      [Utils] Use WeakTrackingVH in vector used as scratch storage. · 9e66c4ec
      Alina Sbirlea authored
      The utility method RecursivelyDeleteTriviallyDeadInstructions receives
      as input a vector of Instructions, where all inputs are valid
      instructions. This same vector is used as a scratch storage (per the
      header comment) to recursively delete instructions. If an instruction is
      added as an operand of multiple other instructions, it may be added twice,
      then deleted once, then the second reference in the vector is invalid.
      Switch to using a Vector<WeakTrackingVH>.
      This change facilitates a clean-up in LoopStrengthReduction.
      9e66c4ec
    • Reid Kleckner's avatar
      [MS] Overhaul how clang passes overaligned args on x86_32 · 2af74e27
      Reid Kleckner authored
      MSVC 2013 would refuse to pass highly aligned things (typically vectors
      and aggregates) by value. Users would receive this error:
        t.cpp(11) : error C2719: 'w': formal parameter with __declspec(align('32')) won't be aligned
        t.cpp(11) : error C2719: 'q': formal parameter with __declspec(align('32')) won't be aligned
      
      However, in MSVC 2015, this behavior was changed, and highly aligned
      things are now passed indirectly. To avoid breaking backwards
      incompatibility, objects that do not have a *required* high alignment
      (i.e. double) are still passed directly, even though they are not
      naturally aligned. This change implements the new behavior of passing
      things indirectly.
      
      The new behavior is:
      - up to three vector parameters can be passed in [XYZ]MM0-2
      - remaining arguments with required alignment greater than 4 bytes are
        passed indirectly
      
      Previously, MSVC never passed things truly indirectly, meaning clang
      would always apply the byval attribute to indirect arguments. We had to
      go to the trouble of adding inalloca so that non-trivially copyable C++
      types could be passed in place without copying the object
      representation. When inalloca was added, we asserted that all arguments
      passed indirectly must use byval. With this change, that assert no
      longer holds, and I had to update inalloca to handle that case. The
      implicit sret pointer parameter was already handled this way, and this
      change generalizes some of that logic to arguments.
      
      There are two cases that this change leaves unfixed:
      1. objects that are non-trivially copyable *and* overaligned
      2. vectorcall + inalloca + vectors
      
      For case 1, I need to touch C++ ABI code in MicrosoftCXXABI.cpp, so I
      want to do it in a follow-up.
      
      For case 2, my fix is one line, but it will require updating IR tests to
      use lots of inreg, so I wanted to separate it out.
      
      Related to D71915 and D72110
      
      Fixes most of PR44395
      
      Reviewed By: rjmccall, craig.topper, erichkeane
      
      Differential Revision: https://reviews.llvm.org/D72114
      2af74e27
    • Amara Emerson's avatar
      [AArch64][GlobalISel] Remove duplicate attribute lookup code that was supposed to be cached. NFC. · 44b49675
      Amara Emerson authored
      When I cached this a long time ago it seems I forgot to remove the locally
      declared variable of the same name in select(), so the caching wasn't having
      any compile time benefit. Doh.
      44b49675
    • aartbik's avatar
      [mlir] [VectorOps] fixed minor typos in vector ops doc · aabc3c59
      aartbik authored
      Summary:
      Rationale:
      Some examples were using "offsets : [0, 2]" syntax which
      should use a "=" instead. The same examples were referring
      to the integer attribute array as k-dimensional, which is
      a bit confusing (it is 1-dimensional, with k elements).
      Changed to "k-sized".
      
      Reviewers: nicolasvasilache, andydavis1, ftynse
      
      Reviewed By: nicolasvasilache
      
      Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73293
      aabc3c59
    • Dominik Adamski's avatar
      [NFC][ScopBuilder] Move RecordedAssumptions vector to ScopBuilder · 71544135
      Dominik Adamski authored
      Scope of changes:
      
      1) Moved RecordedAssumptions vector to ScopBuilder. RecordedAssumptions are used only for Scop constructions.
      2) Moved definition of RecordedAssumptionsTy to ScopHelper. It is required both by ScopBuilder and SCEVAffinator.
      3) Add new function recordAssumption to ScopHelper. One of its argument is a reference to RecordedAssumption vector. This function is used by ScopBuilder and SCEVAffinator.
      4) All RecordedAssumptions are created by ScopBuilder. isl::pw_aff
      objects for corresponding SCEVs are created inside ScopBuilder. Scop
      functions do not record any assumptions. Scop can use isl::pw_aff
      objects which were created by ScopBuilder.
      5) Removed functions for handling RecordedAssumptions from Scop class.
      6) Removed constness from getScopArrayInfo functions.
      7) Replaced SCEVVisitor struct from SCEVAffinator with taylored version, which allow to pass pointer to RecordedAssumptions as function argument.
      
      Differential Revision: https://reviews.llvm.org/D68056
      71544135
    • Hubert Tong's avatar
      [tests] Use host-based XFAIL for test/MC/AMDGPU/hsa-gfx10-v3.s · af3c243e
      Hubert Tong authored
      Summary:
      This patch applies D60551 to an additional file. In particular, the test
      is currently marked XFAIL for a number of big-endian targets; however,
      the failure is actually dependent on the host endianness instead. The
      test actually specifies a specific target triple.
      
      Reviewers: rampitec, xingxue, daltenty
      
      Reviewed By: rampitec
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, fedor.sergeev, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73192
      af3c243e
    • Saar Raz's avatar
      [Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2a · 67c608a9
      Saar Raz authored
      Now with concepts support merged and mostly complete, we do not need -fconcepts-ts
      (which was also misleading as we were not implementing the TS) and can enable
      concepts features under C++2a. A warning will be generated if users still attempt
      to use -fconcepts-ts.
      67c608a9
    • shafik's avatar
      [LLDB] Fix the handling of unnamed bit-fields when parsing DWARF · fcaf5f6c
      shafik authored
      We ran into an assert when debugging clang and performing an expression on a class derived from DeclContext. The assert was indicating we were getting the offsets wrong for RecordDeclBitfields. We were getting both the size and offset of unnamed bit-field members wrong. We could fix this case with a quick change but as I extended the test suite to include more combinations we kept finding more cases that were being handled incorrectly. A fix that handled all the new cases as well as the cases already covered required a refactor of the existing technique.
      
      Differential Revision: https://reviews.llvm.org/D72953
      fcaf5f6c
    • Amara Emerson's avatar
      765b37ab
    • Jonas Devlieghere's avatar
      [lldb/Test] Disallow using substituted binaries in shell test. · 8d508c59
      Jonas Devlieghere authored
      Explicitly disallow using lldb instead of %lldb in the shell tests. This
      is a clever trick that is used by Swift to achieve the same results.
      
      Differential revision: https://reviews.llvm.org/D73289
      8d508c59
    • Mitch Phillips's avatar
      [Clang][IFS][Test] Work around in-process cc1 ASAN issues #2. · e174da44
      Mitch Phillips authored
      Using the same strategy as c38e4252.
      
      D69825 revealed (introduced?) a problem when building with ASan, and
      some memory leaks somewhere. More details are available in the original
      patch.
      
      Looks like we missed one failing tests, this patch adds the workaround
      to this test as well.
      e174da44
    • Jonas Devlieghere's avatar
      [lldb/Test] Disable command-breakpoint-col.test on Windows · d8acf885
      Jonas Devlieghere authored
      I guess PDB doesn't have column information?
      d8acf885
    • aartbik's avatar
      [mlir] [VectorOps] Implement vector tuple get folding · ed8222b2
      aartbik authored
      Summary: Rewrites get-i tup<a1,...,an> into ai
      
      Reviewers: nicolasvasilache, rriddle, andydavis1
      
      Reviewed By: nicolasvasilache, rriddle, andydavis1
      
      Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D73213
      ed8222b2
    • Florian Hahn's avatar
      [IPSCCP] Use ParamState for arguments at call sites. · 4ed7355e
      Florian Hahn authored
      We currently use integer ranges to merge concrete function arguments.
      We use the ParamState range for those, but we only look up concrete
      values in the regular state. For concrete function arguments that are
      themselves arguments of the containing function, we can use the param
      state directly and improve the precision in some cases.
      
      Besides improving the results in some cases, this is also a small step towards
      switching to ValueLatticeElement, by allowing D60582 to be a NFC.
      
      Reviewers: efriedma, davide
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D71836
      4ed7355e
    • Saar Raz's avatar
      [Concepts] Implement P1616R1 - Using unconstrained template template... · d42d5eb8
      Saar Raz authored
      [Concepts] Implement P1616R1 - Using unconstrained template template parameters with constrained templates
      
      Summary: Allow unconstrained template template parameters to accept constrainted templates as arguments.
      
      Reviewers: rsmith
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D73155
      d42d5eb8
    • Matt Arsenault's avatar
      c77bbea9
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Fix RegBanKSelect for llvm.amdgcn.exp.compr · 86e5b56a
      Matt Arsenault authored
      This wasn't updated for the immarg handling change. We really need a
      verifier for this.
      86e5b56a
    • Saar Raz's avatar
      [Concepts] Add ExpressionEvaluationContexts to instantiation of constraints · 4d33a8df
      Saar Raz authored
      Proper ExpressionEvaluationContext were not being entered when instantiating constraint
      expressions, which caused assertion failures in certain cases, including bug #44614.
      4d33a8df
    • Teresa Johnson's avatar
      [ThinLTO] Summarize vcall_visibility metadata · 9c2eb220
      Teresa Johnson authored
      Summary:
      Second patch in series to support Safe Whole Program Devirtualization
      Enablement, see RFC here:
      http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html
      
      Summarize vcall_visibility metadata in ThinLTO global variable summary.
      
      Depends on D71907.
      
      Reviewers: pcc, evgeny777, steven_wu
      
      Subscribers: mehdi_amini, Prazek, inglorion, hiraditya, dexonsmith, arphaman, ostannard, llvm-commits, cfe-commits, davidxl
      
      Tags: #clang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D71911
      9c2eb220
    • Artem Belevich's avatar
      [CUDA] Fix order of memcpy arguments in __shfl_*(<64-bit type>). · cc14de88
      Artem Belevich authored
      Wrong argument order resulted in broken shfl ops for 64-bit types.
      cc14de88
    • Evgenii Stepanov's avatar
      Change internal_start_thread arguments to match pthread_create. · 966b5182
      Evgenii Stepanov authored
      This avoids a CFI-unfriendly function pointer type cast in
      internal_start_thread.
      966b5182