Skip to content
  1. Aug 30, 2018
    • Artem Dergachev's avatar
      [analyzer] InnerPointerChecker: Fix a segfault when checking symbolic strings. · 73b38668
      Artem Dergachev authored
      Return value of dyn_cast_or_null should be checked before use.
      Otherwise we may put a null pointer into the map as a key and eventually
      crash in checkDeadSymbols.
      
      Differential Revision: https://reviews.llvm.org/D51385
      
      llvm-svn: 341092
      73b38668
    • Andrew Kaylor's avatar
      Reverting r340807. · d9b6b81d
      Andrew Kaylor authored
      This patch restores the old behavior of getAllocationDataForFunction in MemoryBuiltins.cpp.
      
      llvm-svn: 341091
      d9b6b81d
    • David Carlier's avatar
      [Xray] Darwin fix variable typo · bdab89b2
      David Carlier authored
      llvm-svn: 341090
      bdab89b2
    • Raphael Isemann's avatar
      Move Predicate.h from Host to Utility · 7fae4932
      Raphael Isemann authored
      Summary:
      This class was initially in Host because its implementation used to be
      very OS-specific. However, with C++11, it has become a very simple
      std::condition_variable wrapper, with no host-specific code.
      
      It is also a general purpose utility class, so it makes sense for it to
      live in a place where it can be used by everyone.
      
      This has no effect on the layering right now, but it enables me to later
      move the Listener+Broadcaster+Event combo to a lower layer, which is
      important, as these are used in a lot of places (notably for launching a
      process in Host code).
      
      Reviewers: jingham, zturner, teemperor
      
      Reviewed By: zturner
      
      Subscribers: xiaobai, mgorny, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D50384
      
      llvm-svn: 341089
      7fae4932
    • Craig Topper's avatar
      [X86] Add kshift test cases for D51401. NFC · b7e14332
      Craig Topper authored
      llvm-svn: 341088
      b7e14332
    • Vladimir Stefanovic's avatar
      Allow inconsistent offsets for 'noreturn' basic blocks when '-verify-cfiinstrs' · 7e58ebf6
      Vladimir Stefanovic authored
      With r295105, some 'noreturn' blocks (those that don't return and have no
      successors) may be merged.
      If such blocks' predecessors have different outgoing offset or register, don't
      report an error in CFIInstrInserter verify().
      
      Thanks to Vlad Tsyrklevich for reporting the issue.
      
      Differential Revision: https://reviews.llvm.org/D51161
      
      llvm-svn: 341087
      7e58ebf6
    • Raphael Isemann's avatar
      Added initial code completion support for the `expr` command · 74829734
      Raphael Isemann authored
      Summary:
      This patch adds initial code completion support for the `expr` command.
      
      We now have a completion handler in the expression CommandObject that
      essentially just attempts to parse the given user expression with Clang with
      an attached code completion consumer. We filter and prepare the
      code completions provided by Clang and send them back to the completion
      API.
      
      The current completion is limited to variables that are in the current scope.
      This includes local variables and all types used by local variables. We however
      don't do any completion of symbols that are not used in the local scope (or
      in some other way already in the ASTContext).
      
      This is partly because there is not yet any code that manually searches for additiona
      information in the debug information. Another cause is that for some reason the existing
      code for loading these additional symbols when requested by Clang doesn't seem to work.
      This will be fixed in a future patch.
      
      Reviewers: jingham, teemperor
      
      Reviewed By: teemperor
      
      Subscribers: labath, aprantl, JDevlieghere, friss, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D48465
      
      llvm-svn: 341086
      74829734
    • Robert Widmann's avatar
      [LLVM-C] Add Bindings For Named Metadata · 0a35b766
      Robert Widmann authored
      Summary: Add a new type for named metadata nodes.  Use this to implement iterators and accessors for NamedMDNodes and extend the echo test to use them to copy module-level debug information.
      
      Reviewers: whitequark, deadalnix, aprantl, dexonsmith
      
      Reviewed By: whitequark
      
      Subscribers: Wallbraker, JDevlieghere, llvm-commits, harlanhaskins
      
      Differential Revision: https://reviews.llvm.org/D47179
      
      llvm-svn: 341085
      0a35b766
    • Sanjay Patel's avatar
      [IR] fix declaration of shuffle mask · 8d39ed89
      Sanjay Patel authored
      An address sanitizer bot flagged this as a potential bug.
      
      llvm-svn: 341084
      8d39ed89
    • Sterling Augustine's avatar
    • Matt Morehouse's avatar
      [libFuzzer] Port to Windows · 7e042bb1
      Matt Morehouse authored
      Summary:
      Port libFuzzer to windows-msvc.
      This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
      It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
      It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.
      
      Patch By: metzman
      
      Reviewers: morehouse, rnk
      
      Reviewed By: morehouse, rnk
      
      Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman
      
      Differential Revision: https://reviews.llvm.org/D51022
      
      llvm-svn: 341082
      7e042bb1
    • Wouter van Oortmerssen's avatar
      [WebAssembly] Made disassembler only use stack instructions. · a733d08d
      Wouter van Oortmerssen authored
      Summary:
      Now uses the StackBased bit from the tablegen defs to identify
      stack instructions (and ignore register based or non-wasm instructions).
      
      Also changed how we store operands, since we now have up to 16 of them
      per instruction. To not cause static data bloat, these are compressed
      into a tiny table.
      
      + a few other cleanups.
      
      Tested:
      - MCTest
      - llvm-lit -v `find test -name WebAssembly`
      
      Reviewers: dschuff, jgravelle-google, sunfish, tlively
      
      Subscribers: sbc100, aheejin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51320
      
      llvm-svn: 341081
      a733d08d
    • Adrian Prantl's avatar
      Remove redundant initialization · 2305c049
      Adrian Prantl authored
      llvm-svn: 341080
      2305c049
    • Nicolai Haehnle's avatar
      Move test/Analysis/DivergenceAnalysis/AMDGPU/loads.ll · 65c02625
      Nicolai Haehnle authored
      Should fix failures of buildbots that don't build the AMDGPU backend.
      
      Change-Id: I01cb84b4b47803b10c5b21ea0353546239860a51
      llvm-svn: 341079
      65c02625
    • Adrian Prantl's avatar
      Support setting a breakpoint by FileSpec+Line+Column in the SBAPI. · 431b1584
      Adrian Prantl authored
      This patch extends the SBAPI to allow for setting a breakpoint not
      only at a specific line, but also at a specific (minimum) column. When
      a column is specified, it will try to find an exact match or the
      closest match on the same line that comes after the specified
      location.
      
      Differential Revision: https://reviews.llvm.org/D51461
      
      llvm-svn: 341078
      431b1584
    • Yaxun Liu's avatar
      [HIP] Add -fvisibility hidden option to clang · 5e98c2b6
      Yaxun Liu authored
      AMDGPU target need -fvisibility hidden option for clang to
      work around a limitation of no PLT support, otherwise there is compilation
      error at -O0.
      
      Differential Revision: https://reviews.llvm.org/D51434
      
      llvm-svn: 341077
      5e98c2b6
    • Sam McCall's avatar
      [clangd] Run SignatureHelp using an up-to-date preamble, waiting if needed. · e6ce8da0
      Sam McCall authored
      Summary:
      After code completion inserts a header, running signature help using the old
      preamble will usually fail. So we add support for consistent preamble reads.
      
      Reviewers: ilya-biryukov
      
      Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51438
      
      llvm-svn: 341076
      e6ce8da0
    • Sanjay Patel's avatar
      [IR] add shuffle queries for identity extend/extract · ac619a09
      Sanjay Patel authored
      This was one of the potential follow-ups suggested in D48236, 
      and these will be used to make matching the patterns in PR38691 cleaner:
      https://bugs.llvm.org/show_bug.cgi?id=38691
      
      About the vocabulary: in the DAG, these would be concat_vector with an 
      undef operand or extract_subvector. Alternate names are discussed in the
      review, but I think these are familiar/good enough to proceed. Once we
      have uses of them in code, we might adjust if there are better options.
      
      https://reviews.llvm.org/D51392
      
      llvm-svn: 341075
      ac619a09
    • Jan Korous's avatar
      [Sema][NFC] Trivial cleanup in ActOnCallExpr · ba3334a2
      Jan Korous authored
      Use logical or operator instead of a bool variable and if/else.
      
      Differential Revision: https://reviews.llvm.org/D51485
      
      llvm-svn: 341074
      ba3334a2
    • Alexey Bataev's avatar
      [OPENMP][NVPTX] Add options -f[no-]openmp-cuda-force-full-runtime. · 80a9a61d
      Alexey Bataev authored
      Added options -f[no-]openmp-cuda-force-full-runtime to [not] force use
      of the full runtime for OpenMP offloading to CUDA devices.
      
      llvm-svn: 341073
      80a9a61d
    • Alexander Ivchenko's avatar
      Make TargetInstrInfo::isCopyInstr return true for regular COPY-instructions · af96112e
      Alexander Ivchenko authored
      ..Move all target-dependent checks into new isCopyInstrImpl method.
      
      This change allows us to treat MoveReg-type instructions and generic
      COPY instruction in the same way
      
      Differential Revision: https://reviews.llvm.org/D49913
      
      llvm-svn: 341072
      af96112e
    • Nicolai Haehnle's avatar
      [NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis · 35617ed4
      Nicolai Haehnle authored
      Summary:
      This is patch 1 of the new DivergenceAnalysis (https://reviews.llvm.org/D50433).
      
      The purpose of this patch is to free up the name DivergenceAnalysis for the new generic
      implementation. The generic implementation class will be shared by specialized
      divergence analysis classes.
      
      Patch by: Simon Moll
      
      Reviewed By: nhaehnle
      
      Subscribers: jvesely, jholewinski, arsenm, nhaehnle, mgorny, jfb, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50434
      
      Change-Id: Ie8146b11be2c50d5312f30e11c7a3036a15b48cb
      llvm-svn: 341071
      35617ed4
    • Alexandre Ganea's avatar
      More build fix for r341064. · 607a7be5
      Alexandre Ganea authored
      llvm-svn: 341070
      607a7be5
    • Daniel Cederman's avatar
      [Sparc] Use ANDN instead of AND if constant can be encoded more efficiently · 8f0bf6c1
      Daniel Cederman authored
      Summary:
      In the case of (and reg, constant) or (or reg, constant), it can be
      beneficial to use a ANDNrr/ORNrr instruction instead of ANDrr/ORrr,
      if the complement of the constant can be encoded using a single SETHI
      instruction instead of a SETHI/ORri pair.
      
      If the constant has more than one use, it is probably better to keep it
      in its original form.
      
      Reviewers: jyknight, venkatra
      
      Reviewed By: jyknight
      
      Subscribers: fedor.sergeev, jrtc27, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50964
      
      llvm-svn: 341069
      8f0bf6c1
    • Alexander Timofeev's avatar
      [AMDGPU] Preliminary patch for divergence driven instruction selection. Operands Folding 1. · 201f892b
      Alexander Timofeev authored
      Reviewers: rampitec
      
      Differential revision: https://reviews/llvm/org/D51316
      
      llvm-svn: 341068
      201f892b
    • Alexandre Ganea's avatar
    • Kirill Bobyrev's avatar
      [clangd] Remove UB introduced in rL341057 · a2f146fd
      Kirill Bobyrev authored
      llvm-svn: 341066
      a2f146fd
    • Ilya Biryukov's avatar
      [clangd] Report position of opening paren in singature help · 43c292c6
      Ilya Biryukov authored
      Summary: Only accessible via the C++ API at the moment.
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51437
      
      llvm-svn: 341065
      43c292c6
    • Alexandre Ganea's avatar
      [Error] Add FileError helper; upgrade StringError behavior · e11f2217
      Alexandre Ganea authored
      FileError is meant to encapsulate both an Error and a file name/path. It should be used in cases where an Error occurs deep down the call chain, and we want to return it to the caller along with the file name.
      
      StringError was updated to display the error messages in different ways. These can be:
      
      1. display the error_code message, and convert to the same error_code (ECError behavior)
      2. display an arbitrary string, and convert to a provided error_code (current StringError behavior)
      3. display both an error_code message and a string, in this order; and convert to the same error_code
      
      These behaviors can be triggered depending on the constructor. The goal is to use StringError as a base class, when a library needs to provide a explicit Error type.
      
      Differential Revision: https://reviews.llvm.org/D50807
      
      llvm-svn: 341064
      e11f2217
    • Ilya Biryukov's avatar
      [CodeComplete] Report location of opening parens for signature help · 2fab2353
      Ilya Biryukov authored
      Summary: Used in clangd.
      
      Reviewers: sammccall
      
      Reviewed By: sammccall
      
      Subscribers: ioeric, kadircet, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51436
      
      llvm-svn: 341063
      2fab2353
    • Ties Stuij's avatar
      [CodeGen] emit inline asm clobber list warnings for reserved (cont) · 9c16d809
      Ties Stuij authored
      Summary:
      This is a continuation of https://reviews.llvm.org/D49727
      Below the original text, current changes in the comments:
      
      Currently, in line with GCC, when specifying reserved registers like sp or pc on an inline asm() clobber list, we don't always preserve the original value across the statement. And in general, overwriting reserved registers can have surprising results.
      
      For example:
      
        extern int bar(int[]);
        
        int foo(int i) {
          int a[i]; // VLA
          asm volatile(
              "mov r7, #1"
            :
            :
            : "r7"
          );
        
          return 1 + bar(a);
        }
      
      Compiled for thumb, this gives:
      
        $ clang --target=arm-arm-none-eabi -march=armv7a -c test.c -o - -S -O1 -mthumb
        ...
        foo:
                .fnstart
        @ %bb.0:                                @ %entry
                .save   {r4, r5, r6, r7, lr}
                push    {r4, r5, r6, r7, lr}
                .setfp  r7, sp, #12
                add     r7, sp, #12
                .pad    #4
                sub     sp, #4
                movs    r1, #7
                add.w   r0, r1, r0, lsl #2
                bic     r0, r0, #7
                sub.w   r0, sp, r0
                mov     sp, r0
                @APP
                mov.w   r7, #1
                @NO_APP
                bl      bar
                adds    r0, #1
                sub.w   r4, r7, #12
                mov     sp, r4
                pop     {r4, r5, r6, r7, pc}
        ...
      
      r7 is used as the frame pointer for thumb targets, and this function needs to restore the SP from the FP because of the variable-length stack allocation a. r7 is clobbered by the inline assembly (and r7 is included in the clobber list), but LLVM does not preserve the value of the frame pointer across the assembly block.
      
      This type of behavior is similar to GCC's and has been discussed on the bugtracker: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11807 . No consensus seemed to have been reached on the way forward. Clang behavior has briefly been discussed on the CFE mailing (starting here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058392.html). I've opted for following Eli Friedman's advice to print warnings when there are reserved registers on the clobber list so as not to diverge from GCC behavior for now.
      
      The patch uses MachineRegisterInfo's target-specific knowledge of reserved registers, just before we convert the inline asm string in the AsmPrinter.
      
      If we find a reserved register, we print a warning:
      
        repro.c:6:7: warning: inline asm clobber list contains reserved registers: R7 [-Winline-asm]
              "mov r7, #1"
              ^
      
      Reviewers: efriedma, olista01, javed.absar
      
      Reviewed By: efriedma
      
      Subscribers: eraman, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51165
      
      llvm-svn: 341062
      9c16d809
    • Kirill Bobyrev's avatar
      [clang-tidy] Use simple string matching instead of Regex · 29925890
      Kirill Bobyrev authored
      Instead of parsing and compiling the `llvm::Regex` each time, it's
      faster to use basic string matching for filename prefix check.
      
      Reviewed by: hokein
      
      Differential Revision: https://reviews.llvm.org/D51360
      
      llvm-svn: 341061
      29925890
    • Kirill Bobyrev's avatar
      [clangd] Fix tests after rL341057 · bf3bc711
      Kirill Bobyrev authored
      Since OR iterator children are not longer sorted by the estimated size,
      string representation should be different.
      
      llvm-svn: 341060
      bf3bc711
    • David Green's avatar
      [AArch64] Optimise load(adr address) to ldr address · 1f203bcd
      David Green authored
      Providing that the load is known to be 4 byte aligned, we can optimise a
      ldr(adr address) to just ldr address.
      
      Differential Revision: https://reviews.llvm.org/D51030
      
      llvm-svn: 341058
      1f203bcd
    • Kirill Bobyrev's avatar
      [clangd] Implement iterator cost · 38bdac5d
      Kirill Bobyrev authored
      This patch introduces iterator cost concept to improve the performance
      of Dex query iterators (mainly, AND iterator). Benchmarks show that the
      queries become ~10% faster.
      
      Before
      
      ```
      -------------------------------------------------------
      Benchmark                Time           CPU Iteration
      -------------------------------------------------------
      DexAdHocQueries    5883074 ns    5883018 ns        117
      DexRealQ         959904457 ns  959898507 ns          1
      ```
      
      After
      
      ```
      -------------------------------------------------------
      Benchmark                Time           CPU Iteration
      -------------------------------------------------------
      DexAdHocQueries    5238403 ns    5238361 ns        130
      DexRealQ         873275207 ns  873269453 ns          1
      ```
      
      Reviewed by: sammccall
      
      Differential Revision: https://reviews.llvm.org/D51310
      
      llvm-svn: 341057
      38bdac5d
    • Andrea Di Biagio's avatar
      [llvm-mca] correctly initialize field 'CycleRetired' in the TimelineView. · 7f2230ff
      Andrea Di Biagio authored
      This fixes a [-Wmissing-field-initializers] warning reported by buildbot
      lld-x86_64-darwin13, build #25152.
      
      llvm-svn: 341056
      7f2230ff
    • Andrea Di Biagio's avatar
      [llvm-mca] Report the number of dispatched micro opcodes in the DispatchStatistics view. · 8b647dcf
      Andrea Di Biagio authored
      This patch introduces the following changes to the DispatchStatistics view:
       * DispatchStatistics now reports the number of dispatched opcodes instead of
         the number of dispatched instructions.
       * The "Dynamic Dispatch Stall Cycles" table now also reports the percentage of
         stall cycles against the total simulated cycles.
      
      This change allows users to easily compare dispatch group sizes with the
      processor DispatchWidth.
      Before this change, it was difficult to correlate the two numbers, since
      DispatchStatistics view reported numbers of instructions (instead of opcodes).
      DispatchWidth defines the maximum size of a dispatch group in terms of number of
      micro opcodes.
      
      The other change introduced by this patch is related to how DispatchStage
      generates "instruction dispatch" events.
      In particular:
       * There can be multiple dispatch events associated with a same instruction
       * Each dispatch event now encapsulates the number of dispatched micro opcodes.
      
      The number of micro opcodes declared by an instruction may exceed the processor
      DispatchWidth. Therefore, we cannot assume that instructions are always fully
      dispatched in a single cycle.
      DispatchStage knows already how to handle instructions declaring a number of
      opcodes bigger that DispatchWidth. However, DispatchStage always emitted a
      single instruction dispatch event (during the first simulated dispatch cycle)
      for instructions dispatched.
      
      With this patch, DispatchStage now correctly notifies multiple dispatch events
      for instructions that cannot be dispatched in a single cycle.
      
      A few views had to be modified. Views can no longer assume that there can only
      be one dispatch event per instruction.
      
      Tests (and docs) have been updated.
      
      Differential Revision: https://reviews.llvm.org/D51430
      
      llvm-svn: 341055
      8b647dcf
    • Max Kazantsev's avatar
      [NFC] Whitespace fix · b167e3ae
      Max Kazantsev authored
      llvm-svn: 341054
      b167e3ae
    • Alex Bradbury's avatar
      [RISCV] Fix r341050 · d4e2c785
      Alex Bradbury authored
      A few stray lines were accidentally committed. Remove these.
      
      llvm-svn: 341053
      d4e2c785
    • Florian Hahn's avatar
      Fix "Q" and "R" inline assembly template modifiers for big-endian Arm · 521dc4dd
      Florian Hahn authored
      Consider the endianness of the target when printing register names.  This is in line with the documentation at http://llvm.org/docs/LangRef.html#asm-template-argument-modifiers
      
      Patch by Jackson Woodruff <jackson.woodruff@arm.com>
      
      Reviewers: t.p.northover, echristo, javed.absar, efriedma
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D49778
      
      llvm-svn: 341052
      521dc4dd
Loading