1. Sep 20, 2018
    • Sven van Haastregt's avatar
      [OpenCL] Diagnose redundant address space conversion · 1076cc2f
      Sven van Haastregt authored
      Add a warning if a parameter with a named address space is passed
      to a to_addr builtin.
      
      For example:
      
        int i;
        to_private(&i); // generate warning as conversion from private to private is redundant.
      
      Patch by Alistair Davies.
      
      Differential Revision: https://reviews.llvm.org/D51411
      
      llvm-svn: 342638
      1076cc2f
    • Benjamin Kramer's avatar
      [ADT] Try again to use the same version of llvm::Optional on all compilers · 1724c348
      Benjamin Kramer authored
      The miscompile doesn't reproduce for me anymore with GCC 7.3. I'll watch
      the buildbots closely.
      
      Having different versions of Optional is an ABI violation when linking
      GCC- and clang-built code together.
      
      llvm-svn: 342637
      1724c348
    • Hans Wennborg's avatar
      FileCheckify test/Driver/Xarch.c · 66db8af3
      Hans Wennborg authored
      llvm-svn: 342636
      66db8af3
    • George Rimar's avatar
      [DWARF] - Emit the correct value for DW_AT_addr_base. · 425f7517
      George Rimar authored
      Currently, we emit DW_AT_addr_base that points to the beginning of
      the .debug_addr section. That is not correct for the DWARF5 case because address
      table contains the header and the attribute should point to the first entry
      following the header.
      
      This is currently the reason why LLDB does not work with such executables correctly.
      Patch fixes the issue.
      
      Differential revision: https://reviews.llvm.org/D52168
      
      llvm-svn: 342635
      425f7517
    • Jonas Devlieghere's avatar
      [target] Change target create's behavior wrt loading dependent files. · 26ba9282
      Jonas Devlieghere authored
      When creating a target, lldb loads all dependent files (i.e. libs in
      LC_LOAD_DYLIB for Mach-O). This can be confusing, especially when two
      versions of the same library end up in the shared cache. It's possible
      to change this behavior, by specifying  target create -d <target> these
      dependents are not loaded.
      
      This patch changes the default behavior to only load dependent files
      only when the target is an executable. When creating a target for a
      library, it is now no longer necessary to pass -d. The user can still
      override this behavior by specifying the -d option to change this
      behavior.
      
      rdar://problem/43721382
      
      Differential revision: https://reviews.llvm.org/D51934
      
      llvm-svn: 342634
      26ba9282
    • Jonas Devlieghere's avatar
      [NFC] Turn "load dependent files" boolean into an enum · f9a07e9f
      Jonas Devlieghere authored
      This is an NFC commit to refactor the "load dependent files" parameter
      from a boolean to an enum value. We want to be able to specify a
      default, in which case we decide whether or not to load the dependent
      files based on whether the target is an executable or not (i.e. a
      dylib).
      
      This is a dependency for D51934.
      
      Differential revision: https://reviews.llvm.org/D51859
      
      llvm-svn: 342633
      f9a07e9f
    • Bjorn Pettersson's avatar
      [IPSCCP] Fix a problem with removing labels in a switch with undef condition · cd53b7f5
      Bjorn Pettersson authored
      Summary:
      Before removing basic blocks that ipsccp has considered as dead
      all uses of the basic block label must be removed. That is done
      by calling ConstantFoldTerminator on the users. An exception
      is when the branch condition is an undef value. In such
      scenarios ipsccp is using some internal assumptions regarding
      which edge in the control flow that should remain, while
      ConstantFoldTerminator don't know how to fold the terminator.
      
      The problem addressed here is related to ConstantFoldTerminator's
      ability to rewrite a 'switch' into a conditional 'br'. In such
      situations ConstantFoldTerminator returns true indicating that
      the terminator has been rewritten. However, ipsccp treated the
      true value as if the edge to the dead basic block had been
      removed. So the code for resolving an undef branch condition
      did not trigger, and we ended up with assertion that there were
      uses remaining when deleting the basic block.
      
      The solution is to resolve indeterminate branches before the
      call to ConstantFoldTerminator.
      
      Reviewers: efriedma, fhahn, davide
      
      Reviewed By: fhahn
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52232
      
      llvm-svn: 342632
      cd53b7f5
    • Calixte Denizet's avatar
      [IR] Add a boolean field in DILocation to know if a line must covered or not · eb7f6020
      Calixte Denizet authored
      Summary:
      Some lines have a hit counter where they should not have one.
      For example, in C++, some cleanup is adding at the end of a scope represented by a '}'.
      So such a line has a hit counter where a user expects to not have one.
      The goal of the patch is to add this information in DILocation which is used to get the covered lines in GCOVProfiling.cpp.
      A following patch in clang will add this information when generating IR (https://reviews.llvm.org/D49916).
      
      Reviewers: marco-c, davidxl, vsk, javed.absar, rnk
      
      Reviewed By: rnk
      
      Subscribers: eraman, xur, danielcdh, aprantl, rnk, dblaikie, #debug-info, vsk, llvm-commits, sylvestre.ledru
      
      Tags: #debug-info
      
      Differential Revision: https://reviews.llvm.org/D49915
      
      llvm-svn: 342631
      eb7f6020
    • Alex Bradbury's avatar
      [RISCV][MC] Improve parsing of jal/j operands · 226f3ef5
      Alex Bradbury authored
      Examples such as `jal a3`, `j a3` and `jal a3, a3` are accepted by gas 
      but rejected by LLVM MC. This patch rectifies this. I introduce 
      RISCVAsmParser::parseJALOffset to ensure that symbol names that coincide with 
      register names can safely be parsed. This is made a somewhat fiddly due to the 
      single-operand alias form (see the comment in parseJALOffset for more info).
      
      Differential Revision: https://reviews.llvm.org/D52029
      
      llvm-svn: 342629
      226f3ef5
    • Sylvestre Ledru's avatar
      fix some typos in the doc · 6616b4c9
      Sylvestre Ledru authored
      llvm-svn: 342628
      6616b4c9
    • Sylvestre Ledru's avatar
      add a quick link to libc++ · 12981433
      Sylvestre Ledru authored
      llvm-svn: 342627
      12981433
    • Sylvestre Ledru's avatar
      add a quick link to libc++abi · 8e5a0b1f
      Sylvestre Ledru authored
      llvm-svn: 342625
      8e5a0b1f
    • Sylvestre Ledru's avatar
      refresh the libc++ homepage · 0296eea4
      Sylvestre Ledru authored
      llvm-svn: 342624
      0296eea4
    • Roman Lebedev's avatar
      [NFC][x86][AArch64] Add BEXTR-like test patterns. · 38c25ace
      Roman Lebedev authored
      Summary: Also, adjust the check prefixes so that we actually get to check the BMI1-only-case.
      
      Reviewers: craig.topper, RKSimon, spatel, javed.absar
      
      Reviewed By: RKSimon
      
      Subscribers: kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D48490
      
      llvm-svn: 342623
      38c25ace
    • Sylvestre Ledru's avatar
      Improve the doc about the initial commit email sent to the ML · 439c29f5
      Sylvestre Ledru authored
      llvm-svn: 342622
      439c29f5
    • Bjorn Pettersson's avatar
      [MachineVerifier] Relax checkLivenessAtDef regarding dead subreg defs · b2154af2
      Bjorn Pettersson authored
      Summary:
      Consider an instruction that has multiple defs of the same
      vreg, but defining different subregs:
        %7.sub1:rc, dead %7.sub2:rc = inst
      
      Calling checkLivenessAtDef for the live interval associated
      with %7 incorrectly reported "live range continues after a
      dead def". The live range for %7 has a dead def at the slot
      index for "inst" even if the live range continues (given that
      there are later uses of %7.sub1).
      
      This patch adjusts MachineVerifier::checkLivenessAtDef
      to allow dead subregister definitions, unless we are checking
      a subrange (when tracking subregister liveness).
      
      A limitation is that we do not detect the situation when the
      live range continues past an instruction that defines the
      full virtual register by multiple dead subreg defines.
      
      I also removed some dead code related to physical register
      in checkLivenessAtDef. Wwe only call that method for virtual
      registers, so I added an assertion instead.
      
      Reviewers: kparzysz
      
      Reviewed By: kparzysz
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52237
      
      llvm-svn: 342618
      b2154af2
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] FDRLogWriter Abstraction · 1f602079
      Dean Michael Berris authored
      Summary:
      This change introduces an `FDRLogWriter` type which is responsible for
      serialising metadata and function records to character buffers. This is
      the first step in a refactoring of the implementation of the FDR runtime
      to allow for more granular testing of the individual components of the
      implementation.
      
      The main contribution of this change is a means of hiding the details of
      how specific records are written to a buffer, and for managing the
      extents of these buffers. We make use of C++ features (templates and
      some metaprogramming) to reduce repetition in the act of writing out
      specific kinds of records to the buffer.
      
      In this process, we make a number of changes across both LLVM and
      compiler-rt to allow us to use the `Trace` abstraction defined in the
      LLVM project in the testing of the runtime implementation. This gives us
      a closer end-to-end test which version-locks the runtime implementation
      with the loading implementation in LLVM.
      
      We also allow using gmock in compiler-rt unit tests, by adding the
      requisite definitions in the `AddCompilerRT.cmake` module. We also add
      the terminfo library detection along with inclusion of the appropriate
      compiler flags for header include lookup.
      
      Finally, we've gone ahead and updated the FDR logging implementation to
      use the FDRLogWriter for the lowest-level record-writing details.
      
      Following patches will isolate the state machine transitions which
      manage the set-up and tear-down of the buffers we're using in multiple
      threads.
      
      Reviewers: mboerger, eizan
      
      Subscribers: mgorny, jfb, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52220
      
      llvm-svn: 342617
      1f602079
    • Eric Christopher's avatar
      Temporarily Revert "[New PM] Introducing PassInstrumentation framework" · 01988937
      Eric Christopher authored
      as it was causing failures in the asan buildbot.
      
      This reverts commit r342597.
      
      llvm-svn: 342616
      01988937
    • Maya Madhavan's avatar
      Fix for bug 34002 - label generated before it block is finalized. Differential... · ec1efe4e
      Maya Madhavan authored
      Fix for bug 34002 - label generated before it block is finalized. Differential Revision: https://reviews.llvm.org/D52258
      
      llvm-svn: 342615
      ec1efe4e
    • QingShan Zhang's avatar
      [PowerPC] [Clang] Add vector int128 pack/unpack builtins · accb65b9
      QingShan Zhang authored
      unsigned long long builtin_unpack_vector_int128 (vector int128_t, int);
      vector int128_t builtin_pack_vector_int128 (unsigned long long, unsigned long long);
      
      Builtins should behave the same way as in GCC.
      
      Patch By: wuzish (Zixuan Wu)
      Differential Revision: https://reviews.llvm.org/D52074
      
      llvm-svn: 342614
      accb65b9
    • Dean Michael Berris's avatar
      [unittests] Do not use llvm::sort in googlemock · b569e7e8
      Dean Michael Berris authored
      Summary:
      This reverts r329475 which applied to googlemock. This change makes the
      googlemock implementation in LLVM dependent on LLVM unnecessarily.
      
      Reviewers: echristo, mgrang
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52287
      
      llvm-svn: 342612
      b569e7e8
    • QingShan Zhang's avatar
      [PowerPC] Fix the assert of combineBVOfConsecutiveLoads when element num is 1 · cae9425a
      QingShan Zhang authored
      Building a vector out of multiple loads can be converted to a load of the vector type if the loads are consecutive.
      But the special condition is that the element number is 1, such as <1 x i128>. So just early exit to fix the assert.
      
      Patch By: wuzish (Zixuan Wu)
      Differential Revision: https://reviews.llvm.org/D52072
      
      llvm-svn: 342611
      cae9425a
    • Thomas Lively's avatar
      [WebAssembly] Renumber SIMD ops · f45de47c
      Thomas Lively authored
      Summary:
      This change leaves holes in the opcode space where missing
      instructions could logically be added later if they were found to be
      useful.
      
      Reviewers: aheejin, dschuff
      
      Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52282
      
      llvm-svn: 342610
      f45de47c
    • Eric Fiselier's avatar
      2d79835c
    • Yi Kong's avatar
      [builtins] Add __emutls_unregister_key function · 0c4cf643
      Yi Kong authored
      This is called by Bionic on dlclose to delete the emutls pthread key.
      
      The return value of pthread_key_delete is unchecked and behaviour of
      multiple calls to the method is dependent on the implementation of
      pthread_key_delete.
      
      Differential Revision: https://reviews.llvm.org/D52251
      
      llvm-svn: 342608
      0c4cf643
    • Aaron Puchert's avatar
      Thread Safety Analysis: warnings for attributes without arguments · 7ba1ab71
      Aaron Puchert authored
      Summary:
      When thread safety annotations are used without capability arguments,
      they are assumed to apply to `this` instead. So we warn when either
      `this` doesn't exist, or the class is not a capability type.
      
      This is based on earlier work by Josh Gao that was committed in r310403,
      but reverted in r310698 because it didn't properly work in template
      classes. See also D36237.
      
      The solution is not to go via the QualType of `this`, which is then a
      template type, hence the attributes are not known because it could be
      specialized. Instead we look directly at the class in which we are
      contained.
      
      Additionally I grouped two of the warnings together. There are two
      issues here: the existence of `this`, which requires us to be a
      non-static member function, and the appropriate annotation on the class
      we are contained in. So we don't distinguish between not being in a
      class and being static, because in both cases we don't have `this`.
      
      Fixes PR38399.
      
      Reviewers: aaron.ballman, delesley, jmgao, rtrieu
      
      Reviewed By: delesley
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D51901
      
      llvm-svn: 342605
      7ba1ab71
    • Sean Fertile's avatar
      [PPC64] Handle ppc64le triple in getBitcodeMachineKind. · 69e09116
      Sean Fertile authored
      Enables lto and thinlto with bitcode targeting ppc64le.
      
      Differential Revision: https://reviews.llvm.org/D52265
      
      llvm-svn: 342604
      69e09116
    • Sean Fertile's avatar
      [PPC64] Helper for offset from a function's global entry to local entry. [NFC] · e0e586b9
      Sean Fertile authored
      The PPC64 elf V2 abi defines 2 entry points for a function. There are a few
      places we need to calculate the offset from the global entry to the local entry
      and how this is done is not straight forward. This patch adds a helper function
      mostly for documentation purposes, explaining how the 2 entry points differ and
      why we choose one over the other, as well as documenting how the offsets are
      encoded into a functions st_other field.
      
      Differential Revision: https://reviews.llvm.org/D52231
      
      llvm-svn: 342603
      e0e586b9
    • Sean Fertile's avatar
      [PPC64] Optimize redundant instructions in global access sequences. · 7f3f05e0
      Sean Fertile authored
      The access sequence for global variables in the medium and large code models use
      2 instructions to add an offset to the toc-pointer. If the offset fits whithin
      16-bits then the instruction that sets the high 16 bits is redundant.
      
      This patch adds the --toc-optimize option, (on by default) and enables rewriting
      of 2 instruction global variable accesses into 1 when the offset from the
      TOC-pointer to the variable (or .got entry) fits in 16 signed bits. eg
      
      addis %r3, %r2, 0           -->     nop
      addi  %r3, %r3, -0x8000     -->     addi %r3, %r2, -0x8000
      
      This rewriting can be disabled with the --no-toc-optimize flag
      
      Differential Revision: https://reviews.llvm.org/D49237
      
      llvm-svn: 342602
      7f3f05e0
    • Eugene Zelenko's avatar
    • Aaron Puchert's avatar
      Thread safety analysis: Handle ObjCIvarRefExpr in SExprBuilder::translate · b081f44e
      Aaron Puchert authored
      Summary:
      This imitates the code for MemberExpr.
      
      Fixes PR38896.
      
      Reviewers: aaron.ballman, delesley, lukasza, rjmccall
      
      Reviewed By: delesley
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D52200
      
      llvm-svn: 342600
      b081f44e
    • Volodymyr Sapsai's avatar
      Revert "Implement LWG 2221 - No formatted output operator for nullptr." · 8d6ac8f6
      Volodymyr Sapsai authored
      This reverts r342566 as it causes on bots linker errors like
      
      > Undefined symbols for architecture i386:
      >   "std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(std::nullptr_t)", referenced from:
      
      llvm-svn: 342599
      8d6ac8f6
    • Michael Berg's avatar
      [WEB] add new flags to a DebugInfo lit test · 120ca61d
      Michael Berg authored
      llvm-svn: 342598
      120ca61d
    • Fedor Sergeev's avatar
      [New PM] Introducing PassInstrumentation framework · a5f279ea
      Fedor Sergeev authored
      Pass Execution Instrumentation interface enables customizable instrumentation
      of pass execution, as per "RFC: Pass Execution Instrumentation interface"
      posted 06/07/2018 on llvm-dev@
      
      The intent is to provide a common machinery to implement all
      the pass-execution-debugging features like print-before/after,
      opt-bisect, time-passes etc.
      
      Here we get a basic implementation consisting of:
      * PassInstrumentationCallbacks class that handles registration of callbacks
        and access to them.
      
      * PassInstrumentation class that handles instrumentation-point interfaces
        that call into PassInstrumentationCallbacks.
      
      * Callbacks accept StringRef which is just a name of the Pass right now.
        There were some ideas to pass an opaque wrapper for the pointer to pass instance,
        however it appears that pointer does not actually identify the instance
        (adaptors and managers might have the same address with the pass they govern).
        Hence it was decided to go simple for now and then later decide on what the proper
        mental model of identifying a "pass in a phase of pipeline" is.
      
      * Callbacks accept llvm::Any serving as a wrapper for const IRUnit*, to remove direct dependencies
        on different IRUnits (e.g. Analyses).
      
      * PassInstrumentationAnalysis analysis is explicitly requested from PassManager through
        usual AnalysisManager::getResult. All pass managers were updated to run that
        to get PassInstrumentation object for instrumentation calls.
      
      * Using tuples/index_sequence getAnalysisResult helper to extract generic AnalysisManager's extra
        args out of a generic PassManager's extra args. This is the only way I was able to explicitly
        run getResult for PassInstrumentationAnalysis out of a generic code like PassManager::run or
        RepeatedPass::run.
        TODO: Upon lengthy discussions we agreed to accept this as an initial implementation
        and then get rid of getAnalysisResult by improving RepeatedPass implementation.
      
      * PassBuilder takes PassInstrumentationCallbacks object to pass it further into
        PassInstrumentationAnalysis. Callbacks registration should be performed directly
        through PassInstrumentationCallbacks.
      
      * new-pm tests updated to account for PassInstrumentationAnalysis being run
      
      * Added PassInstrumentation tests to PassBuilderCallbacks unit tests.
        Other unit tests updated with registration of the now-required PassInstrumentationAnalysis.
      
      Reviewers: chandlerc, philip.pfaffe
      Differential Revision: https://reviews.llvm.org/D47858
      
      llvm-svn: 342597
      a5f279ea
    • Evgeniy Stepanov's avatar
      Revert "[XRay][compiler-rt] FDRLogWriter Abstraction" and 1 more. · 09e7f243
      Evgeniy Stepanov authored
      Revert the following 2 commits to fix standalone compiler-rt build:
      * r342523 [XRay] Detect terminfo library
      * r342518 [XRay][compiler-rt] FDRLogWriter Abstraction
      
      llvm-svn: 342596
      09e7f243
    • Sanjay Patel's avatar
      [x86] add test for 256-bit andn (PR37749); NFC · 0bda9198
      Sanjay Patel authored
      llvm-svn: 342595
      0bda9198
    • Sanjay Patel's avatar
      [SelectionDAG] allow vector types with isBitwiseNot() · fdc0de19
      Sanjay Patel authored
      The test diff in not-and-simplify.ll is from a use in SimplifyDemandedBits,
      and the test diff in add.ll is from a DAGCombiner transform.
      
      llvm-svn: 342594
      fdc0de19
    • Juergen Ributzka's avatar
      Fix the build when LLVM_TARGETS_TO_BUILD is empty. · 67fb2134
      Juergen Ributzka authored
      Using LLVMTestingSupport in the LLVM_LINK_COMPONENTS breaks the build when
      LLVM_TARGETS_TO_BUILD is set to empty.
      
      Libraries that depend on LLVMTestingSupport need to use
      target_link_libraries(<target> PRIVATE LLVMTestingSupport) instead.
      
      This required change was already commited by r341899 to fix another build
      issue.
      
      This fixes rdar://problem/44615064.
      
      llvm-svn: 342593
      67fb2134
    • Sanjay Patel's avatar
      [x86] add test for add+not vector fold; NFC · 567f7f0a
      Sanjay Patel authored
        
      The fold uses 'isBitwiseNot()', but that's not vector-friendly currently.
      
      llvm-svn: 342592
      567f7f0a
    • Matthias Braun's avatar
      AArch64: Add FuseCryptoEOR fusion rules · 28d6a4ac
      Matthias Braun authored
      There's some additional rules available on newer apple CPUs.
      
      rdar://41235346
      
      llvm-svn: 342590
      28d6a4ac