Skip to content
  1. May 18, 2017
    • Sam Kolton's avatar
      [AMDGPU] SDWA operands should not intersect with potential MIs · ebfdaf73
      Sam Kolton authored
      Summary:
      There should be no intesection between SDWA operands and potential MIs. E.g.:
      ```
      v_and_b32 v0, 0xff, v1 -> src:v1 sel:BYTE_0
      v_and_b32 v2, 0xff, v0 -> src:v0 sel:BYTE_0
      v_add_u32 v3, v4, v2
      ```
      In that example it is possible that we would fold 2nd instruction into 3rd (v_add_u32_sdwa) and then try to fold 1st instruction into 2nd (that was already destroyed). So if SDWAOperand is also a potential MI then do not apply it.
      
      Reviewers: vpykhtin, arsenm
      
      Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye
      
      Differential Revision: https://reviews.llvm.org/D32804
      
      llvm-svn: 303347
      ebfdaf73
    • Guy Blank's avatar
      [MVT] add v1i1 MVT · d19632fa
      Guy Blank authored
      Adds the v1i1 MVT as a preparation for another commit (https://reviews.llvm.org/D32273)
      
      Differential Revision: https://reviews.llvm.org/D32540
      
      llvm-svn: 303346
      d19632fa
    • Igor Breger's avatar
      [GlobalISel][X86] G_ADD/G_SUB vector legalizer/selector support. · 842b5b36
      Igor Breger authored
      Summary: G_ADD/G_SUB vector legalizer/selector support.
      
      Reviewers: zvi, guyblank
      
      Reviewed By: guyblank
      
      Subscribers: rovka, llvm-commits, kristof.beyls
      
      Differential Revision: https://reviews.llvm.org/D33232
      
      llvm-svn: 303345
      842b5b36
    • Simon Pilgrim's avatar
      8d81c221
    • Alex Lorenz's avatar
    • Simon Pilgrim's avatar
      [X86][AVX512] Add 512-bit vector ctpop costs + tests · 6bba6068
      Simon Pilgrim authored
      llvm-svn: 303342
      6bba6068
    • Daniel Sanders's avatar
      Re-commit: [globalisel][tablegen] Import rules containing intrinsic_wo_chain. · 89e93086
      Daniel Sanders authored
      Summary:
      As of this patch, 1018 out of 3938 rules are currently imported.
      
      Depends on D32275
      
      Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar
      
      Reviewed By: qcolombet
      
      Subscribers: dberris, igorb, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D32278
      
      The previous commit failed on test-suite/Bitcode/simd_ops/AArch64_halide_runtime.bc
      because isImmOperandEqual() assumed MO was a register operand and that's not
      always true.
      
      llvm-svn: 303341
      89e93086
    • Zvi Rackover's avatar
      [X86] Add explicit triple to test invocation · d17d13d2
      Zvi Rackover authored
      llvm-svn: 303340
      d17d13d2
    • Daniel Jasper's avatar
      Revert r302781 and subsequent attempts to disable part of it. · f97310fb
      Daniel Jasper authored
      The Msan unit tests are still broken and by this point, I think we
      should start over.
      
      llvm-svn: 303339
      f97310fb
    • Diana Picus's avatar
      Fixup r303324 - temporary disable stndup interceptor, due to r302781 being buggy · 44514860
      Diana Picus authored
      r303324 missed one of the tests added by r302781. This commit applies
      the same fix as r303324 to the missed test (strndup.cc).
      
      llvm-svn: 303338
      44514860
    • Peter Smith's avatar
      [ELF] Support R_ARM_SBREL32 Relocation · d54f368e
      Peter Smith authored
      This change adds support for the R_ARM_SBREL32 relocation. The relocation
      is a base relative relocation that is produced by clang/llvm when -frwpi
      is used. The use case for the -frwpi option is position independent data
      for embedded systems that do not have a GOT. With -frwpi all data is
      accessed via an offset from a base register (usually r9), where r9 is set
      at run time to where the data has been loaded. The base of the data is
      known as the static base.
      
      The ARM ABI defines the static base as:
      B(S) is the addressing origin of the output segment defining the symbol S.
      The origin is not required to be the base address of the segment. For
      simplicity we choose to use the base address of the segment.
      
      The ARM procedure call standard only defines a read write variant using
      R_ARM_SBREL32 relocations. The read-only data is accessed via pc-relative
      offsets from the code, this is implemented in clang as -fropi.
      
      Fixes PR32924
      
      Differential Revision: https://reviews.llvm.org/D33280
      
      llvm-svn: 303337
      d54f368e
    • Max Kazantsev's avatar
      [SCEV][NFC] Remove duplication of isLoopInvariant code · 627ad0fe
      Max Kazantsev authored
      Replace two places that duplicate the code of isLoopInvariant method with
      the invocation of this method.
      
      Differential Revision: https://reviews.llvm.org/D33313
      
      llvm-svn: 303336
      627ad0fe
    • George Rimar's avatar
      [DWARF] - Simplify RelocVisitor implementation. · 47f84b1a
      George Rimar authored
      We do not need to store relocation width field.
      Patch removes relative code, that simplifies implementation.
      
      Differential revision: https://reviews.llvm.org/D33274
      
      llvm-svn: 303335
      47f84b1a
    • George Rimar's avatar
      [lib/Object] - Fix build bot after r303331 "[lib/Object] - Minor API update... · d2aaf5bd
      George Rimar authored
      [lib/Object] - Fix build bot after r303331 "[lib/Object] - Minor API update for llvm::Decompressor".
      
      Error was:
      Decompressor.h:33:28: error: extra qualification ‘llvm::object::Decompressor::’ on member ‘resizeAndDecompress’ [-fpermissive]
         template <class T> Error Decompressor::resizeAndDecompress(T &Out) {
      
      llvm-svn: 303334
      d2aaf5bd
    • Lama Saba's avatar
      [X86] Replace slow LEA instructions in X86 · 2ea271b5
      Lama Saba authored
       
        According to Intel's Optimization Reference Manual for SNB+:
        " For LEA instructions with three source operands and some specific situations, instruction latency has increased to 3 cycles, and must
          dispatch via port 1:
        - LEA that has all three source operands: base, index, and offset
        - LEA that uses base and index registers where the base is EBP, RBP,or R13
        - LEA that uses RIP relative addressing mode
        - LEA that uses 16-bit addressing mode "
        This patch currently handles the first 2 cases only.
       
      Differential Revision: https://reviews.llvm.org/D32277
      
      llvm-svn: 303333
      2ea271b5
    • Krasimir Georgiev's avatar
      [clang-format] Make NoLineBreakFormatter respect MustBreakBefore · 994b6c9b
      Krasimir Georgiev authored
      Summary:
      This patch makes NoLineBreakFormatter to insert a break before tokens where
      MustBreakBefore is true.
      
      Reviewers: djasper
      
      Reviewed By: djasper
      
      Subscribers: cfe-commits, klimek
      
      Differential Revision: https://reviews.llvm.org/D33238
      
      llvm-svn: 303332
      994b6c9b
    • George Rimar's avatar
      [lib/Object] - Minor API update for llvm::Decompressor. · f98b9ac5
      George Rimar authored
      I revisited Decompressor API (issue with it was triggered during D32865 review)
      and found it is probably provides more then we really need.
      
      Issue was about next method's signature:
      
      Error decompress(SmallString<32> &Out);
      It is too strict. At first I wanted to change it to decompress(SmallVectorImpl<char> &Out),
      but then found it is still not flexible because sticks to SmallVector.
      
      During reviews was suggested to use templating to simplify code. Patch do that.
      
      Differential revision: https://reviews.llvm.org/D33200
      
      llvm-svn: 303331
      f98b9ac5
    • Krasimir Georgiev's avatar
      clang-format: fix prefix for doxygen comments after member · ba6b315e
      Krasimir Georgiev authored
      Summary:
      Doxygen supports putting documentation blocks after member, by adding
      an additional < marker in the comment block. This patch makes sure
      this marker is used in lines which are introduced by breaking the
      comment.
      
        int foo; ///< Some very long comment.
      
      becomes:
      
        int foo; ///< Some very long
                 ///< comment.
      
      Contributed by @Typz!
      
      Reviewers: krasimir
      
      Reviewed By: krasimir
      
      Subscribers: djasper, klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D33282
      
      llvm-svn: 303330
      ba6b315e
    • Serguei Katkov's avatar
      Fix buildbot failure after rL303327: [BPI] Reduce the probability of... · 00211c3f
      Serguei Katkov authored
      Fix buildbot failure after rL303327: [BPI] Reduce the probability of unreachable edge to minimal value greater than 0.
      
      One more test is updated to meet new branch probability for unreachable branches.
      
      llvm-svn: 303329
      00211c3f
    • Zvi Rackover's avatar
      [X86] Adding tests for scalar bitcasts from vsetcc. NFC. · c20c6d07
      Zvi Rackover authored
      llvm-svn: 303328
      c20c6d07
    • Serguei Katkov's avatar
      [BPI] Reduce the probability of unreachable edge to minimal value greater than 0 · ba831f78
      Serguei Katkov authored
      The probability of edge coming to unreachable block should be as low as possible.
      The change reduces the probability to minimal value greater than zero.
      
      The bug https://bugs.llvm.org/show_bug.cgi?id=32214 show the example when
      the probability of edge coming to unreachable block is greater than for edge
      coming to out of the loop and it causes incorrect loop rotation.
      
      Please note that with this change the behavior of unreachable heuristic is a bit different
      than others. Specifically, before this change the sum of probabilities
      coming to unreachable blocks have the same weight for all branches
      (it was just split over all edges of this block coming to unreachable blocks).
      With this change it might be slightly different but not to much due to probability of
      taken branch to unreachable block is really small.
      
      Reviewers: chandlerc, sanjoy, vsk, congh, junbuml, davidxl, dexonsmith
      Reviewed By: chandlerc, dexonsmith
      Subscribers: reames, llvm-commits
      Differential Revision: https://reviews.llvm.org/D30633
      
      llvm-svn: 303327
      ba831f78
    • Akira Hatanaka's avatar
      [ThinLTO] Do not assert when adding a module with a different but · b10bff11
      Akira Hatanaka authored
      compatible target triple
      
      Currently, an assertion fails in ThinLTOCodeGenerator::addModule when
      the target triple of the module being added doesn't match that of the
      one stored in TMBuilder. This patch relaxes the constraint and makes
      changes to allow target triples that only differ in their version
      numbers on Apple platforms, similarly to what r228999 did.
      
      rdar://problem/30133904
      
      Differential Revision: https://reviews.llvm.org/D33291
      
      llvm-svn: 303326
      b10bff11
    • Alexander Kornienko's avatar
      Fix an assertion failure in FormatASTNodeDiagnosticArgument. · fd3e3984
      Alexander Kornienko authored
      Summary:
      The test being added in this patch used to cause an assertion failure:
      
      /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
      --
      Exit Code: 134
      
      Command Output (stderr):
      --
      clang: /src/tools/clang/lib/AST/ASTDiagnostic.cpp:424: void clang::FormatASTNodeDiagnosticArgument(DiagnosticsEngine::ArgumentKind, intptr_t, llvm::StringRef, llvm::StringRef, ArrayRef<DiagnosticsEngine::ArgumentValue>, SmallVectorImpl<char> &, void *, ArrayRef<intptr_t>): Assertion `isa<NamedDecl>(DC) && "Expected a NamedDecl"' failed.
      #0 0x0000000001c7a1b4 PrintStackTraceSignalHandler(void*) (/build/./bin/clang+0x1c7a1b4)
      #1 0x0000000001c7a4e6 SignalHandler(int) (/build/./bin/clang+0x1c7a4e6)
      #2 0x00007f30880078d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
      #3 0x00007f3087054067 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35067)
      #4 0x00007f3087055448 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36448)
      #5 0x00007f308704d266 (/lib/x86_64-linux-gnu/libc.so.6+0x2e266)
      #6 0x00007f308704d312 (/lib/x86_64-linux-gnu/libc.so.6+0x2e312)
      #7 0x00000000035b7f22 clang::FormatASTNodeDiagnosticArgument(clang::DiagnosticsEngine::ArgumentKind, long, llvm::StringRef, llvm::StringRef, llvm::ArrayRef<std::pair<clang::DiagnosticsEngine::ArgumentKind, long> >, llvm::SmallVectorImpl<char>&, void*, llvm::ArrayRef<long>) (/build/
      ./bin/clang+0x35b7f22)
      #8 0x0000000001ddbae4 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/build/./bin/clang+0x1ddbae4)
      #9 0x0000000001ddb323 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/build/./bin/clang+0x1ddb323)
      #10 0x00000000022878a4 clang::TextDiagnosticBuffer::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) (/build/./bin/clang+0x22878a4)
      #11 0x0000000001ddf387 clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const (/build/./bin/clang+0x1ddf387)
      #12 0x0000000001dd9dea clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) (/build/./bin/clang+0x1dd9dea)
      #13 0x0000000002cad00c clang::Sema::EmitCurrentDiagnostic(unsigned int) (/build/./bin/clang+0x2cad00c)
      #14 0x0000000002d91cd2 clang::Sema::CheckShadow(clang::NamedDecl*, clang::NamedDecl*, clang::LookupResult const&) (/build/./bin/clang+0x2d91cd2)
      
      Stack dump:
      0.      Program arguments: /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
      1.      /src/tools/clang/test/SemaCXX/warn-shadow.cpp:214:23: current parser token ';'
      2.      /src/tools/clang/test/SemaCXX/warn-shadow.cpp:213:26: parsing function body 'handleLinkageSpec'
      3.      /src/tools/clang/test/SemaCXX/warn-shadow.cpp:213:26: in compound statement ('{}')
      /build/tools/clang/test/SemaCXX/Output/warn-shadow.cpp.script: line 1: 15595 Aborted                 (core dumped) /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
      
      Reviewers: rsmith
      
      Reviewed By: rsmith
      
      Subscribers: krytarowski, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D33207
      
      llvm-svn: 303325
      fd3e3984
    • Kostya Serebryany's avatar
      temporary disable stndup interceptor, due to r302781 being buggy · 9aa8ef85
      Kostya Serebryany authored
      llvm-svn: 303324
      9aa8ef85
    • Davide Italiano's avatar
      [Target/X86] Remove unneeded return. NFCI. · 9ae69a75
      Davide Italiano authored
      llvm-svn: 303323
      9ae69a75
    • Richard Smith's avatar
      [modules] Switch from inferring owning modules based on source location to · 54f0440c
      Richard Smith authored
      inferring based on the current module at the point of creation.
      
      This should result in no functional change except when building a preprocessed
      module (or more generally when using #pragma clang module begin/end to switch
      module in the middle of a file), in which case it allows us to correctly track
      the owning module for declarations. We can't map from FileID to module in the
      preprocessed module case, since all modules would have the same FileID.
      
      There are still a couple of remaining places that try to infer a module from a
      source location; I'll clean those up in follow-up changes.
      
      llvm-svn: 303322
      54f0440c
    • Alexander Kornienko's avatar
      [clang-tidy] Optimize GlobList::contains · 6180337f
      Alexander Kornienko authored
      With large lists of checks and large number of warnings GlobList::contains
      starts being ridiculously CPU hungry, since it runs regexp match per glob.
      Caching results of glob matching in a StringMap significantly speeds up check
      filtering even for small GlobLists.
      
      /tmp/q.cc:
      
      void f() {
        int I;
        {int I;}
        {int I;}
        {int I;}
        ... // 200k times
      }
      
      Before the patch:
      
      GlobList with 2 entries:
        $ time clang-tidy-old -checks=-*,modernize-use-override /tmp/q.cc -- -Wshadow
        200000 warnings generated.
        Suppressed 200000 warnings (200000 with check filters).
      
        real    0m3.826s
        user    0m3.176s
        sys     0m0.504s
      
      GlobList with 28 entries:
        $ time clang-tidy-old -checks=-*,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,modernize-use-override /tmp/q.cc -- -Wshadow
        200000 warnings generated.
        Suppressed 200000 warnings (200000 with check filters).
      
        real    0m5.000s
        user    0m4.744s
        sys     0m0.060s
      
      GlobList with 158 entries:
        $ time clang-tidy-old -checks=-*,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,modernize-use-override /tmp/q.cc -- -Wshadow
        200000 warnings generated.
        Suppressed 200000 warnings (200000 with check filters).
      
        real    0m13.920s
        user    0m13.636s
        sys     0m0.104s
      
      With the patch runtime is practically independent from the length of the GlobList:
        $ time clang-tidy-new -checks=-*,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,modernize-use-override /tmp/q.cc -- -Wshadow
        200000 warnings generated.
        Suppressed 200000 warnings (200000 with check filters).
      
        real    0m2.300s
        user    0m2.104s
        sys     0m0.044s
      
      llvm-svn: 303321
      6180337f
    • Craig Topper's avatar
    • Justin Bogner's avatar
      Update three tests I missed in r302979 and r302990 · be42c4ae
      Justin Bogner authored
      llvm-svn: 303319
      be42c4ae
    • Craig Topper's avatar
      [Statistics] Add a method to atomically update a statistic that contains a maximum · 8a950275
      Craig Topper authored
      Summary:
      There are several places in the codebase that try to calculate a maximum value in a Statistic object. We currently do this in one of two ways:
      
        MaxNumFoo = std::max(MaxNumFoo, NumFoo);
      
      or
      
        MaxNumFoo = (MaxNumFoo > NumFoo) ? MaxNumFoo : NumFoo;
      
      The first version reads from MaxNumFoo one time and uncontionally rwrites to it. The second version possibly reads it twice depending on the result of the first compare.  But we have no way of knowing if the value was changed by another thread between the reads and the writes.
      
      This patch adds a method to the Statistic object that can ensure that we only store if our value is the max and the previous max didn't change after we read it. If it changed we'll recheck if our value should still be the max or not and try again.
      
      This spawned from an audit I'm trying to do of all places we uses the implicit conversion to unsigned on the Statistics objects. See my previous thread on llvm-dev https://groups.google.com/forum/#!topic/llvm-dev/yfvxiorKrDQ
      
      Reviewers: dberlin, chandlerc, hfinkel, dblaikie
      
      Reviewed By: chandlerc
      
      Subscribers: llvm-commits, sanjoy
      
      Differential Revision: https://reviews.llvm.org/D33301
      
      llvm-svn: 303318
      8a950275
    • Nick Lewycky's avatar
      The constant expression evaluator should examine function arguments for... · 9add1594
      Nick Lewycky authored
      The constant expression evaluator should examine function arguments for non-constexpr function calls unless the EvalInfo says to stop.
      
      llvm-svn: 303317
      9add1594
    • Kyle Butt's avatar
      CodeGen: BlockPlacement: Add Message strings to asserts. NFC · 0cf5b2f8
      Kyle Butt authored
      Add message strings to all the unlabeled asserts in the file.
      
      Differential Revision: https://reviews.llvm.org/D33078
      
      llvm-svn: 303316
      0cf5b2f8
    • Sanjay Patel's avatar
      [InstCombine] add test for xor-of-icmps; NFC · 7f4687f1
      Sanjay Patel authored
      This is another form of the problem discussed in D32143.
      
      llvm-svn: 303315
      7f4687f1
    • Craig Topper's avatar
      [Statistics] Use Statistic::operator+= instead of adding and assigning separately. · 48187cff
      Craig Topper authored
      I believe this technically fixes a multithreaded race condition in this code. But my primary concern was as part of looking at removing the ability to treat Statistics like a plain unsigned. There are many weird operations on Statistics in the codebase.
      
      llvm-svn: 303314
      48187cff
    • Quentin Colombet's avatar
    • Sanjay Patel's avatar
      [InstCombine] handle icmp i1 X, C early to avoid creating an unknown pattern · ba212c24
      Sanjay Patel authored
      The missing optimization for xor-of-icmps still needs to be added, but by
      being more efficient (not generating unnecessary logic ops with constants)
      we avoid the bug.
      
      See discussion in post-commit comments:
      https://reviews.llvm.org/D32143
      
      llvm-svn: 303312
      ba212c24
    • Reid Kleckner's avatar
      Attempt to pacify ASan and UBSan reports in CrashRecovery tests · cde4b3f4
      Reid Kleckner authored
      llvm-svn: 303311
      cde4b3f4
    • Sanjay Patel's avatar
      [InstCombine] add test for missing icmp bool fold; NFC · 3cd38a8d
      Sanjay Patel authored
      llvm-svn: 303310
      3cd38a8d
    • Sanjay Patel's avatar
      [InstCombine] move icmp bool canonicalizations to helper; NFC · e5747e3c
      Sanjay Patel authored
      As noted in the post-commit comments in D32143, we should be
      catching the constant operand cases sooner to be more efficient
      and less likely to expose a missing fold.
      
      llvm-svn: 303309
      e5747e3c
  2. May 17, 2017
Loading