1. Jul 28, 2017
    • Francois Ferrand's avatar
      clang-format: merge short case labels with trailing comments · a64ba701
      Francois Ferrand authored
      Summary:
      Allow merging short case labels when they actually end with a comment
      (like a comment after the ``break``) and when followed by switch-level
      comments (e.g. aligned with next case):
      
        switch(a) {
        case 0: break; // comment at end of case
        case 1: return value;
        // comment related to next case
        // comment related to next case
        case 2:
        }
      
      Reviewers: krasimir, djasper
      
      Reviewed By: krasimir
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35557
      
      llvm-svn: 309370
      a64ba701
    • Francois Ferrand's avatar
      clang-format: fix block OpeningLineIndex around preprocessor · a98a95cc
      Francois Ferrand authored
      Summary:
      The current code would return an incorrect value when a preprocessor
      directive is present immediately after the opening brace: this causes
      the nanespace end comment fixer to break in some places, for exemple it
      would not add the comment in this case:
      
        namespace a {
        #define FOO
        }
      
      Fixing the computation is simple enough, but it was breaking a feature,
      as it would cause comments to be added also when the namespace
      declaration was dependant on conditional compilation.
      
      To fix this, a hash of the current preprocessor stack/branches is
      computed at the beginning of parseBlock(), so that we explicitely do not
      store the OpeningLineIndex when the beginning and end of the block are
      not in the same preprocessor conditions.
      
      Tthe hash is computed based on the line, but this could propbably be
      improved by using the actual condition, so that clang-format would be
      able to match multiple identical #ifdef blocks.
      
      Reviewers: krasimir, djasper
      
      Reviewed By: krasimir
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D35483
      
      llvm-svn: 309369
      a98a95cc
    • Tobias Grosser's avatar
    • Max Kazantsev's avatar
      [SCEV] Do not visit nodes twice in containsConstantSomewhere · fa496953
      Max Kazantsev authored
      This patch reworks the function that searches constants in Add and Mul SCEV expression
      chains so that now it does not visit a node more than once, and also renames this function
      for better correspondence between its implementation and semantics.
      
      Differential Revision: https://reviews.llvm.org/D35931
      
      llvm-svn: 309367
      fa496953
    • Tobias Grosser's avatar
      [GPGPU] Fix compilation issue with latest CUDA upgrade to i128 · 30caae6d
      Tobias Grosser authored
      llvm-svn: 309366
      30caae6d
    • Jessica Paquette's avatar
      [MachineOutliner] NFC: Comment tidying · 4602c343
      Jessica Paquette authored
      The comment on describing the suffix tree had some pruning
      stuff that was out of date in it.
      
      Also fixed some typos.
      
      llvm-svn: 309365
      4602c343
    • Michal Gorny's avatar
      Revert rL309320 - "[OCaml] Respect CMAKE_C_FLAGS for OCaml C files" · a3ad81d2
      Michal Gorny authored
      This causes buildbot breakage for systems where OCaml files are built
      with a different compiler.
      
      llvm-svn: 309364
      a3ad81d2
    • Saleem Abdulrasool's avatar
      test: require x86 backend · 61d81ec7
      Saleem Abdulrasool authored
      Ensure that the target is registered before using it.  Should fix the
      hexagon Bots.
      
      llvm-svn: 309363
      61d81ec7
    • Petr Hosek's avatar
      Support libc++abi in addition to libstdc++ · a7a9ca4a
      Petr Hosek authored
      This change adds sanitizer support for LLVM's libunwind and libc++abi
      as an alternative to libstdc++. This allows using the in tree version
      of libunwind and libc++abi which is useful when building a toolchain
      for different target.
      
      Differential Revision: https://reviews.llvm.org/D34501
      
      llvm-svn: 309362
      a7a9ca4a
    • Petr Hosek's avatar
      Support compiler-rt builtins · 2bbb6ad2
      Petr Hosek authored
      This change adds support for compiler-rt builtins as an alternative
      compiler runtime to libgcc.
      
      Differential Revision: https://reviews.llvm.org/D35165
      
      llvm-svn: 309361
      2bbb6ad2
    • Saleem Abdulrasool's avatar
      MC: add support for cfi_return_column · a219b3d8
      Saleem Abdulrasool authored
      This adds support for the CFI pseudo-op return_column.  This specifies
      the frame table column which contains the return address.
      
      Addresses PR33953!
      
      llvm-svn: 309360
      a219b3d8
    • Saleem Abdulrasool's avatar
      MC: clang-format enumeration (NFC) · b3c70c09
      Saleem Abdulrasool authored
      This was hard to insert elements into.  clang-format it so that it is
      easier.  NFC.
      
      llvm-svn: 309359
      b3c70c09
    • Jan Vesely's avatar
      add __kernel_exec macros · 09f0a560
      Jan Vesely authored
      
      
      also consolidate macros into one file, and rename to clcmacros.h
      
      Signed-off-by: default avatarJan Vesely <jan.vesely@rutgers.edu>
      Reviewed-by: default avatarAaron Watry <awatry@gmail.com>
      llvm-svn: 309358
      09f0a560
    • Sanjoy Das's avatar
      Revert "[SCEV] Cache results of computeExitLimit" · 843ab574
      Sanjoy Das authored
      This reverts commit r309080.  The patch needs to clear out the
      ScalarEvolution::ExitLimits cache in forgetMemoizedResults.
      
      I've replied on the commit thread for the patch with more details.
      
      llvm-svn: 309357
      843ab574
    • Jessica Paquette's avatar
      [MachineOutliner] NFC: Split up getOutliningBenefit · 809d708b
      Jessica Paquette authored
      This is some more cleanup in preparation for some actual
      functional changes. This splits getOutliningBenefit into
      two cost functions: getOutliningCallOverhead and
      getOutliningFrameOverhead. These functions return the
      number of instructions that would be required to call
      a specific function and the number of instructions
      that would be required to construct a frame for a
      specific funtion. The actual outlining benefit logic
      is moved into the outliner, which calls these functions.
      
      The goal of refactoring getOutliningBenefit is to:
      
      - Get us closer to getting rid of the IsTailCall flag
      
      - Further split up "target-specific" things and
      "general algorithm" things
      
      llvm-svn: 309356
      809d708b
    • Davide Italiano's avatar
      [JumpThreading] Stop falsely preserving LazyValueInfo. · 75a001ba
      Davide Italiano authored
      JumpThreading claims to preserve LVI, but it doesn't preserve
      the analyses which LVI holds a reference to (e.g. the Dominator).
      In the current pass manager infrastructure, after JT runs, the
      PM frees these analyses (including DominatorTree) but preserves
      LVI.
      
      CorrelatedValuePropagation runs immediately after and queries
      a corrupted domtree, causing weird miscompiles.
      
      This commit disables the preservation of LVI for the time being.
      Eventually, we should either move LVI to a proper dependency
      tracking mechanism (i.e. an analyses shouldn't hold references
      to other analyses and compute them on demand if needed), or
      we should teach all the passes preserving LVI to preserve the
      analyses LVI depends on.
      
      The new pass manager has a mechanism to invalidate LVI in case
      one of the analyses it depends on becomes invalid, so this problem
      shouldn't exist (at least not in this immediate form), but handling
      of analyses holding references is still a very delicate subject.
      
      Fixes PR33917 (and rustc).
      
      llvm-svn: 309355
      75a001ba
    • David Blaikie's avatar
      DebugInfo: Consider a CU containing only local imported entities to be 'empty' · 89daf77a
      David Blaikie authored
      This can come up in ThinLTO & wastes space & makes degenerate IR.
      
      As per the added FIXME, ultimately, local imported entities should hang
      off the function and that way the imported entity list on the CU can be
      tested for emptiness like all the other CU lists.
      
      (function-attached local imported entities are probably also the best
      path forward for fixing how imported entities are handled both in
      cross-module use (currently, while ThinLTO preserves the imported
      entities, they would not get used at the imported inlined location -
      only in the abstract origin that appears in the partial CU created by
      the import (which isn't emitted under Fission due to cross-CU
      limitations there)) and to reduce the number of points where imported
      entities are emitted (they're currently emitted into every inlined
      instance, concrete instance, and abstract origin - they should only go
      in teh abstract origin if there is one, otherwise in the concrete
      instance - but this requires lots of delayed handling and wiring up,
      same as abstract variables & subprograms))
      
      llvm-svn: 309354
      89daf77a
    • Davide Italiano's avatar
      [JumpThreading] Add an option to dump LazyValueInfo after the run. · 01cb947a
      Davide Italiano authored
      Differential Revision:  https://reviews.llvm.org/D35973
      
      llvm-svn: 309353
      01cb947a
    • Akira Hatanaka's avatar
      Update comment in test case after r309308. · 7ce6ed49
      Akira Hatanaka authored
      llvm-svn: 309352
      7ce6ed49
    • Kostya Serebryany's avatar
    • Matthias Braun's avatar
      ARMFrameLowering: Only set ExtraCSSpill for actually unused registers. · c618a466
      Matthias Braun authored
      The code assumed that unclobbered/unspilled callee saved registers are
      unused in the function. This is not true for callee saved registers that are
      also used to pass parameters such as swiftself.
      
      rdar://33401922
      
      llvm-svn: 309350
      c618a466
    • Erik Pilkington's avatar
      [demangler] Fix some overzealous -Wreturn-type errors · fe335510
      Erik Pilkington authored
      llvm-svn: 309349
      fe335510
    • Reid Kleckner's avatar
      [lit] Port googletest lit tests to Windows · 4ca8d21e
      Reid Kleckner authored
      Summary:
      The technique of directly calling subprocess.Popen on a python script
      doesn't work on Windows. The executable path of the command must refer
      to a valid win32 executable.
      
      Instead, rename all the python scripts masquerading as gtest executables
      to have .py extensions, so we can easily detect then and call the python
      executable for them. Do this on Linux as well as Windows for
      consistency.
      
      The test suite directory names also come out in lower-case on Windows.
      We can consider removing that in a later patch. This change just updates
      the FileCheck lines to match on Windows.
      
      Fixes PR33933
      
      Reviewers: modocache, mgorny
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35909
      
      llvm-svn: 309347
      4ca8d21e
    • Dehao Chen's avatar
      Changing the default MaxNumPromotions from 2 to 3. · e70a472b
      Dehao Chen authored
      Summary: In performance tuning, we see performance benefits when enlarge the maximum num promotion targets to 3. This is safe as soon as we have total percentage threshold properly setup (https://reviews.llvm.org/D35962)
      
      Reviewers: davidxl, tejohnson
      
      Reviewed By: tejohnson
      
      Subscribers: llvm-commits, sanjoy
      
      Differential Revision: https://reviews.llvm.org/D35966
      
      llvm-svn: 309346
      e70a472b
    • Dehao Chen's avatar
      Separate the ICP total threshold and remaining threshold. · f4240b5b
      Dehao Chen authored
      Summary: In the current implementation, isPromotionProfitable only checks if the call count to a direct target is no less than a certain percentage threshold of the remaining call counts that have not been promoted. This causes code size problems when the target count is small but greater than a large portion of remaining counts. E.g. target1 takes 99.9%, while target2 takes 0.1%. Both targets will be promoted and inlined, makes the function size too large, which potentially prevents it from further inlining into its callers. This patch adds another percentage threshold against the total indirect call count. If the target count needs to be no less than both thresholds in order to be promoted speculatively.
      
      Reviewers: davidxl, tejohnson
      
      Reviewed By: tejohnson
      
      Subscribers: sanjoy, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35962
      
      llvm-svn: 309345
      f4240b5b
    • Dehao Chen's avatar
      Increase the ImportHotMultiplier to 10.0 · 8260d665
      Dehao Chen authored
      Summary: The original 3.0 hot mupltiplier is too small, and would prevent hot callsites from being inline. This patch increases the hot multilier to 10.0
      
      Reviewers: davidxl, tejohnson
      
      Reviewed By: tejohnson
      
      Subscribers: llvm-commits, sanjoy
      
      Differential Revision: https://reviews.llvm.org/D35969
      
      llvm-svn: 309344
      8260d665
    • Reid Kleckner's avatar
      [X86] Fix latent bug in sibcall eligibility logic · 07a5d437
      Reid Kleckner authored
      The X86 tail call eligibility logic was correct when it was written, but
      the addition of inalloca and argument copy elision broke its
      assumptions. It was assuming that fixed stack objects were immutable.
      
      Currently, we aim to emit a tail call if no arguments have to be
      re-arranged in memory. This code would trace the outgoing argument
      values back to check if they are loads from an incoming stack object.
      If the stack argument is immutable, then we won't need to store it back
      to the stack when we tail call.
      
      Fortunately, stack objects track their mutability, so we can just make
      the obvious check to fix the bug.
      
      This was http://crbug.com/749826
      
      llvm-svn: 309343
      07a5d437
    • Erik Pilkington's avatar
      [demangler] Attempt to fix linux bots, include <cstdio> · bdfd1228
      Erik Pilkington authored
      llvm-svn: 309342
      bdfd1228
    • George Karpenkov's avatar
      [sanitizers] Sanitizer tests CMake clean up: try #2 · 50dd3fe9
      George Karpenkov authored
      This patch addresses two issues:
      
      Most of the time, hacks with `if/else` in order to get support for
      multi-configuration builds are superfluous.
      The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it
      expands to `.`  on all single-configuration builds, and to a configuration
      name otherwise.
      The `if/else` hacks for the library name generation should also not be
      done, as CMake has `TARGET_FILE` generator expression precisely for this
      purpose, as it expands to the exact filename of the resulting target.
      
      Differential Revision: https://reviews.llvm.org/D35952
      
      llvm-svn: 309341
      50dd3fe9
    • Erik Pilkington's avatar
      [demangler] Use an AST to represent demangled names · 94d2ac71
      Erik Pilkington authored
      The demangler now demangles by producing an AST, then traverses that
      AST to produce a demangled name. This is done for performance reasons,
      now the demangler doesn't manuiplate std::strings, which hurt
      performance and caused string operations to be inlined into the
      parser, leading to large code size and stack usage.
      
      Differential revision: https://reviews.llvm.org/D35159
      
      llvm-svn: 309340
      94d2ac71
    • Evgeniy Stepanov's avatar
      [sancov] Add missing line breaks in test. NFC. · fea50c28
      Evgeniy Stepanov authored
      llvm-svn: 309339
      fea50c28
    • Kostya Serebryany's avatar
      61457767
    • Kostya Serebryany's avatar
      [sanitizer-coverage] rename sanitizer-coverage-create-pc-table into... · 063b6520
      Kostya Serebryany authored
      [sanitizer-coverage] rename sanitizer-coverage-create-pc-table into sanitizer-coverage-pc-table and add plumbing for a clang flag
      
      llvm-svn: 309337
      063b6520
    • Adrian Prantl's avatar
      Remove unused function from AArch64 backend (NFC) · 8f4b353e
      Adrian Prantl authored
      llvm-svn: 309336
      8f4b353e
    • Kostya Serebryany's avatar
      [sanitizer-coverage] add a feature sanitizer-coverage-create-pc-table=1 (works... · b75d002f
      Kostya Serebryany authored
      [sanitizer-coverage] add a feature sanitizer-coverage-create-pc-table=1 (works with trace-pc-guard and inline-8bit-counters) that adds a static table of instrumented PCs to be used at run-time 
      
      llvm-svn: 309335
      b75d002f
    • Jessica Paquette's avatar
      [MachineOutliner] Cleanup: move findCandidates out of suffix tree · 78681be2
      Jessica Paquette authored
      Doing some cleanup in preparation for some functional changes.
      This commit moves findCandidates out of the suffix tree and into the
      MachineOutliner class. This is much easier to follow, and removes
      the burden of candidate choice from the suffix tree.
      
      It also adds a couple FIXMEs and simplifies building outlined function
      names.
      
      llvm-svn: 309334
      78681be2
    • Evgeniy Stepanov's avatar
      [sancov] Implement __sanitizer_cov_reset. · 59b5e9c0
      Evgeniy Stepanov authored
      Summary: Clears all collected coverage.
      
      Reviewers: kcc
      
      Subscribers: srhines, kubamracek, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D35958
      
      llvm-svn: 309333
      59b5e9c0
    • Reid Kleckner's avatar
      [llvm-pdbutil] Clean up ExitOnError usage to add ": " to our errors · dd853e54
      Reid Kleckner authored
      The banner parameter is supposed to end in a separator, like ": ".
      Otherwise, we get ugly errors like:
      
      Error while reading publics streamNative error: blah blah
      
      llvm-svn: 309332
      dd853e54
    • Reid Kleckner's avatar
      [PDB] Initialize the std::array<ulittle32_t> used for the gsi bitmap · ef443296
      Reid Kleckner authored
      With ASan, we would write about 512 bytes of malloc fill value to the
      PDB, with some random bits ORed in here and there. Dumping the PDB would
      always fail reliably.
      
      llvm-svn: 309331
      ef443296
    • Davide Italiano's avatar
      [ConstantFolder] Don't try to fold gep when the idx is a vector. · 1a26f24f
      Davide Italiano authored
      The code in ConstantFoldGetElementPtr() assumes integers, and
      therefore it crashes trying to get the integer bidwith of a vector
      type (in this case <4 x i32>. I just changed the code to prevent
      the folding in case of vectors and I didn't bother to generalize
      as this doesn't seem to me something that really happens in
      practice, but I'm willing to change the patch if you think
      it's worth it.
      This is hard to trigger from -instsimplify or -instcombine
      only as the second instruction is dead, so the test uses loop-unroll.
      
      Differential Revision:  https://reviews.llvm.org/D35956
      
      llvm-svn: 309330
      1a26f24f