1. Sep 20, 2018
    • 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
    • Matthias Braun's avatar
      MachineScheduler: Add -misched-print-dags flag · 3136e420
      Matthias Braun authored
      Add a flag to dump the schedule DAG to the debug stream. This will be
      used in upcoming commits to test schedule DAG mutations such as macro
      fusion.
      
      llvm-svn: 342589
      3136e420
    • Chandler Carruth's avatar
      Workaround a limitation of llvm::Any when used with types that have · a4d75ead
      Chandler Carruth authored
      a converting constructor from llvm::Any like gmock matchers. This issue
      has come up elsewhere as well and the workaround here is being
      considered for use in the standard long-term, but we can pretty cheaply
      experiment with it to see if anything ends up going wrong.
      
      llvm-svn: 342588
      a4d75ead
    • Shuai Wang's avatar
      [NFC] Declare instead of define non-void functions in unit tests. · 66908022
      Shuai Wang authored
      llvm-svn: 342586
      66908022
    • Evandro Menezes's avatar
      [ARM] Adjust the feature set for Exynos · 8a6973d6
      Evandro Menezes authored
      Fine tune the cost model for all Exynos processors.
      
      llvm-svn: 342585
      8a6973d6
    • Kostya Kortchinsky's avatar
      [sanitizer][fuchsia] Fix VMAR leak · 851a7c9b
      Kostya Kortchinsky authored
      Summary:
      Destroy and close a range's vmar if all its memory was unmapped.
      
      This addresses some performance regression due to the proliferation of vmars
      when Secondary backed allocations are concerned with Scudo on Fuchsia.
      
      When a Secondary backed allocation was freed, the associated
      `ReservedAddressRange` was going away after unmapping the entirety of the
      mapping, but without getting rid of the associated vmar properly (which
      was created specifically for that mapping). This resulted in an increase of
      defunct vmars, that in turn slowed down further new vmar allocations.
      
      This appears to solve ZX-2560/ZX-2642, at least on QEMU.
      
      Reviewers: flowerhack, mcgrathr, phosek, mseaborn
      
      Reviewed By: mcgrathr
      
      Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52242
      
      llvm-svn: 342584
      851a7c9b
    • Evandro Menezes's avatar
      [ARM] Refactor Exynos feature set (NFC) · c62ab611
      Evandro Menezes authored
      Since all Exynos processors share the same feature set, fold them in the
      implied fatures list for the subtarget.
      
      llvm-svn: 342583
      c62ab611
    • Matt Morehouse's avatar
      [InstCombine] Disable strcmp->memcmp transform for MSan. · e62fc3d0
      Matt Morehouse authored
      Summary:
      The strcmp->memcmp transform can make the resulting memcmp read
      uninitialized data, which MSan doesn't like.
      
      Resolves https://github.com/google/sanitizers/issues/993.
      
      Reviewers: eugenis, xbolva00
      
      Reviewed By: eugenis
      
      Subscribers: hiraditya, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52272
      
      llvm-svn: 342582
      e62fc3d0
    • Saleem Abdulrasool's avatar
      test: actually fix the condition properly · a4526d77
      Saleem Abdulrasool authored
      I had locally changed the test to add an explicit triple to figure out the issue
      with the SCEI buildbots, and that hid the error.  This now works with and
      without the explicit triple.
      
      llvm-svn: 342581
      a4526d77
    • Simon Pilgrim's avatar
      [X86] Handle COPYs of physregs better (regalloc hints) · 2d0f20cc
      Simon Pilgrim authored
      Enable enableMultipleCopyHints() on X86.
      
      Original Patch by @jonpa:
      
      While enabling the mischeduler for SystemZ, it was discovered that for some reason a test needed one extra seemingly needless COPY (test/CodeGen/SystemZ/call-03.ll). The handling for that is resulted in this patch, which improves the register coalescing by providing not just one copy hint, but a sorted list of copy hints. On SystemZ, this gives ~12500 less register moves on SPEC, as well as marginally less spilling.
      
      Instead of improving just the SystemZ backend, the improvement has been implemented in common-code (calculateSpillWeightAndHint(). This gives a lot of test failures, but since this should be a general improvement I hope that the involved targets will help and review the test updates.
      
      Differential Revision: https://reviews.llvm.org/D38128
      
      llvm-svn: 342578
      2d0f20cc
    • Michael Berg's avatar
      Copy utilities updated and added for MI flags · 894c39f7
      Michael Berg authored
      Summary: This patch adds a GlobalIsel copy utility into MI for flags and updates the instruction emitter for the SDAG path.  Some tests show new behavior and I added one for GlobalIsel which mirrors an SDAG test for handling nsw/nuw.
      
      Reviewers: spatel, wristow, arsenm
      
      Reviewed By: arsenm
      
      Subscribers: wdng
      
      Differential Revision: https://reviews.llvm.org/D52006
      
      llvm-svn: 342576
      894c39f7
    • Sanjay Patel's avatar
      [x86] change names of vector splitting helper functions; NFC · 1a1c0ee5
      Sanjay Patel authored
        
      As the code comments suggest, these are about splitting, and they
      are not necessarily limited to lowering, so that misled me.
      
      There's nothing that's actually x86-specific in these either, so 
      they might be better placed in a common header so any target can 
      use them.
      
      llvm-svn: 342575
      1a1c0ee5
    • Vitaly Buka's avatar
      [ThinLTO] Write TYPE_IDs for types used in functions imported by aliases · 84d912b7
      Vitaly Buka authored
      Summary:
      ThinLTO imports alias as a copy of a aliasee, so when we import such functions with type tests we will
      need type ids used by function. However after D49565 we pick types only during processing of
      FunctionSummary which is not happening for such aliesees.
      
      Example:
      Unit U1 with a type, a functions F with the type check, and an alias A to the function.
      Unit U2 with only call to the alias A.
      
      In particular, this happens when we use -mconstructor-aliases, which is default.
      So if c++ unit only creates instance of the class, without calling any other methods it will lack of
      necessary type ids, which will result in false CFI reports.
      
      Reviewers: tejohnson, eugenis
      
      Subscribers: pcc, mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52201
      
      llvm-svn: 342574
      84d912b7
    • Vitaly Buka's avatar
      [ThinLTO] Extract getReferencedTypeIds from [NFC] · 7e880a4f
      Vitaly Buka authored
      Summary: Refactoring before D52201
      
      Reviewers: eugenis, tejohnson
      
      Subscribers: pcc, inglorion, hiraditya, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D52203
      
      llvm-svn: 342573
      7e880a4f
    • Simon Atanasyan's avatar
      [mips][microMIPS] Extending size reduction pass with MOVEP · a9e8765e
      Simon Atanasyan authored
      The patch extends size reduction pass for MicroMIPS. Two MOVE
      instructions are transformed into one MOVEP instrucition.
      
      Patch by Milena Vujosevic Janicic.
      
      Differential revision: https://reviews.llvm.org/D52037
      
      llvm-svn: 342572
      a9e8765e
    • Simon Atanasyan's avatar
      [mips][microMIPS] Fix the definition of MOVEP instruction · 852dd83b
      Simon Atanasyan authored
      The patch fixes definition of MOVEP instruction. Two registers are used
      instead of register pairs. This is necessary as machine verifier cannot
      handle register pairs.
      
      Patch by Milena Vujosevic Janicic.
      
      Differential revision: https://reviews.llvm.org/D52035
      
      llvm-svn: 342571
      852dd83b
    • Saleem Abdulrasool's avatar
      test: improve condition for the check · 241c33bc
      Saleem Abdulrasool authored
      When the type of `wint_t` is `int`, the promotion will allow this to pass.
      Check this explicitly rather than using the size.
      
      llvm-svn: 342569
      241c33bc
    • Sylvestre Ledru's avatar
      redirecting to llvm.org/devmtg · 3461eae4
      Sylvestre Ledru authored
      llvm-svn: 342568
      3461eae4
    • Chris Bieneman's avatar
      [LLJIT] Add API to expose linking layer from LLJIT classes · 1481227d
      Chris Bieneman authored
      Summary: This patch just surfaces the object linking layer from the LLJIT classes so that clients can take advantage of the changes implemented in r341154.
      
      Reviewers: lhames
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D51551
      
      llvm-svn: 342567
      1481227d
    • Marshall Clow's avatar
      Implement LWG 2221 - No formatted output operator for nullptr. Reviewed as... · 4a71f9cf
      Marshall Clow authored
      Implement LWG 2221 - No formatted output operator for nullptr. Reviewed as https://reviews.llvm.org/D44263
      
      llvm-svn: 342566
      4a71f9cf
    • Saleem Abdulrasool's avatar
      Sema: handle `wint_t` more carefully for printf checking · 29bf94d8
      Saleem Abdulrasool authored
      In the case that `win_t` is an `unsigned short` (e.g. on Windows), we would
      previously incorrectly diagnose the conversion because we would immediately
      promote the argument type from `wint_t` (aka `unsigned short`) to `int` before
      checking if the type matched.  This should repair the Windows hosted bots.
      
      llvm-svn: 342565
      29bf94d8