1. Sep 01, 2015
    • Matt Arsenault's avatar
      AMDGPU: Fix adding redundant implicit operands · 51d2d0f6
      Matt Arsenault authored
      These are already added during the MachineInstr construction,
      so this was adding the implicit registers twice.
      
      llvm-svn: 246525
      51d2d0f6
    • Richard Smith's avatar
      Use a more appropriate way of writing 1. · 86f14e09
      Richard Smith authored
      llvm-svn: 246524
      86f14e09
    • David Majnemer's avatar
      [MS ABI] Cleanup get*ForUnnamedTagDecl · 7f0674d6
      David Majnemer authored
      Use "lookup" instead of operator[], it will not perform unnecessary
      insertions.  No functionality change is intended.
      
      llvm-svn: 246523
      7f0674d6
    • Cong Hou's avatar
      Distribute the weight on the edge from switch to default statement to edges... · 511298b9
      Cong Hou authored
      Distribute the weight on the edge from switch to default statement to edges generated in lowering switch.
      
      Currently, when edge weights are assigned to edges that are created when lowering switch statement, the weight on the edge to default statement (let's call it "default weight" here) is not considered. We need to distribute this weight properly. However, without value profiling, we have no idea how to distribute it. In this patch, I applied the heuristic that this weight is evenly distributed to successors.
      
      For example, given a switch statement with cases 1,2,3,5,10,11,20, and every edge from switch to each successor has weight 10. If there is a binary search tree built to test if n < 10, then its two out-edges will have weight 4x10+10/2 = 45 and 3x10 + 10/2 = 35 respectively (currently they are 40 and 30 without considering the default weight). Each distribution (which is 5 here) will be stored in each SwitchWorkListItem for further distribution.
      
      There are some exceptions:
      
      For a jump table header which doesn't have any edge to default statement, we don't distribute the default weight to it.
      For a bit test header which covers a contiguous range and hence has no edges to default statement, we don't distribute the default weight to it.
      When the branch checks a single value or a contiguous range with no edge to default statement, we don't distribute the default weight to it.
      In other cases, the default weight is evenly distributed to successors.
      
      Differential Revision: http://reviews.llvm.org/D12418
      
      llvm-svn: 246522
      511298b9
    • Richard Smith's avatar
      [modules] Preserve DeclID order when merging lookup tables to give a more · 7fa450c6
      Richard Smith authored
      predictable diagnostic experience. The hash-of-DeclID order we were using
      before gave different results on Win32 due to a different predefined
      declaration of __builtin_va_list.
      
      llvm-svn: 246521
      7fa450c6
    • Yaron Keren's avatar
      Fix path seperator for Windows. · a8dde6c8
      Yaron Keren authored
      llvm-svn: 246520
      a8dde6c8
    • Enrico Granata's avatar
      And of course, typos · d1216d6b
      Enrico Granata authored
      llvm-svn: 246519
      d1216d6b
    • Enrico Granata's avatar
      Attempt at fixing the CMake build · fcc353d9
      Enrico Granata authored
      llvm-svn: 246518
      fcc353d9
    • Rafael Espindola's avatar
      Remember the maximum alignment used to refer to a common symbol. · f31f9617
      Rafael Espindola authored
      llvm-svn: 246517
      f31f9617
    • Eric Fiselier's avatar
      Convert LIBCXXABI_BUILD_32_BITS to LLVM_BUILD_32_BITS. · 388c1a04
      Eric Fiselier authored
      llvm-svn: 246516
      388c1a04
    • Enrico Granata's avatar
      Add support for language plugins to provide data formatters · 2233895a
      Enrico Granata authored
      Historically, data formatters all exist in a global repository (the category map)
      On top of that, some formatters can be "hardcoded" when the conditions under which they apply are not expressible as a typename (or typename regex)
      
      This change paves the way to move formatters into per-language buckets such that the C++ plugin is responsible for ownership of the C++ formatters, and so on
      The advantages of this are:
      a) language formatters only get created when they might apply
      b) formatters for a language are clearly owned by the matching language plugin
      
      The current model is one of static instantiation, that is a language knows the full set of formatters it vends and that is only asked-for once, and then handed off to the FormatManager
      In a future revision it might be interesting to add similar ability to the language runtimes, and monitor for certain shared library events to add even more library-specific formatters
      
      No formatters are moved as part of this change, so practically speaking this is NFC
      
      llvm-svn: 246515
      2233895a
    • Sanjay Patel's avatar
      remove unnecessary/conflicting target info · 989364c1
      Sanjay Patel authored
      llvm-svn: 246514
      989364c1
    • Sanjay Patel's avatar
      fixed test to specify triple rather than arch and CPU · e554d59e
      Sanjay Patel authored
      llvm-svn: 246513
      e554d59e
    • Enrico Granata's avatar
      ad91c7ce
    • Rafael Espindola's avatar
      Sort common symbols by alignment. · b56cb943
      Rafael Espindola authored
      llvm-svn: 246511
      b56cb943
    • Hal Finkel's avatar
      [PowerPC] Support __builtin_ppc_get_timebase · 65e1e4db
      Hal Finkel authored
      GCC 4.8+ has a PowerPC-specific intrinsic, __builtin_ppc_get_timebase, to do
      what Clang's __builtin_readcyclecounter does. For compatibility with code that
      uses GCC's spelling (including glibc), support it as well.
      
      Partially fixes PR23681.
      
      llvm-svn: 246510
      65e1e4db
    • Duncan P. N. Exon Smith's avatar
      LTO: Cleanup parameter names and header docs, NFC · f4967754
      Duncan P. N. Exon Smith authored
      Follow LLVM style for the parameter names (`CamelCase` not `camelCase`),
      and surface the header docs in doxygen.  No functionality change
      intended.
      
      llvm-svn: 246509
      f4967754
    • Eric Christopher's avatar
      Revert "Pull the target attribute parsing out of CGCall and onto TargetInfo." · dec31bef
      Eric Christopher authored
      This reverts commit r246468 while we figure out what to do about Basic and AST.
      
      llvm-svn: 246508
      dec31bef
    • Hal Finkel's avatar
      [DAGCombine] Fixup SETCC legality checking · 1baec532
      Hal Finkel authored
      SETCC is one of those special node types for which operation actions (legality,
      etc.) is keyed off of an operand type, not the node's value type. This makes
      sense because the value type of a legal SETCC node is determined by its
      operands' value type (via the TLI function getSetCCResultType). When the
      SDAGBuilder creates SETCC nodes, it either creates them with an MVT::i1 value
      type, or directly with the value type provided by TLI.getSetCCResultType.
      
      The first problem being fixed here is that DAGCombine had several places
      querying TLI.isOperationLegal on SETCC, but providing the return of
      getSetCCResultType, instead of the operand type directly. This does not mean
      what the author thought, and "luckily", most in-tree targets have SETCC with
      Custom lowering, instead of marking them Legal, so these checks return false
      anyway.
      
      The second problem being fixed here is that two of the DAGCombines could create
      SETCC nodes with arbitrary (integer) value types; specifically, those that
      would simplify:
      
        (setcc a, b, op1) and|or (setcc a, b, op2) -> setcc a, b, op3
           (which is possible for some combinations of (op1, op2))
      
      If the operands of the and|or node are actual setcc nodes, then this is not an
      issue (because the and|or must share the same type), but, the relevant code in
      DAGCombiner::visitANDLike and DAGCombiner::visitORLike actually calls
      DAGCombiner::isSetCCEquivalent on each operand, and that function will
      recognise setcc-like select_cc nodes with other return types. And, thus, when
      creating new SETCC nodes, we need to be careful to respect the value-type
      constraint. This is even true before type legalization, because it is quite
      possible for the SELECT_CC node to have a legal type that does not happen to
      match the corresponding TLI.getSetCCResultType type.
      
      To be explicit, there is nothing that later fixes the value types of SETCC
      nodes (if the type is legal, but does not happen to match
      TLI.getSetCCResultType). Creating SETCCs with an MVT::i1 value type seems to
      work only because, either MVT::i1 is not legal, or it is what
      TLI.getSetCCResultType returns if it is legal. Fixing that is a larger change,
      however. For the time being, restrict the relevant transformations to produce
      only SETCC nodes with a value type matching TLI.getSetCCResultType (or MVT::i1
      prior to type legalization).
      
      Fixes PR24636.
      
      llvm-svn: 246507
      1baec532
    • Sanjay Patel's avatar
      don't set a legal vector type if we know we can't use that type (NFCI) · 719b3e6a
      Sanjay Patel authored
      Added benefit: the 'if' logic now matches the text of the comment that describes it.
      
      llvm-svn: 246506
      719b3e6a
    • Rafael Espindola's avatar
      Set the correct value for the common symbols. · ce8c9c05
      Rafael Espindola authored
      In the relocatable object it is the alignment, but in the linked file it is
      a regular address.
      
      llvm-svn: 246505
      ce8c9c05
    • Richard Smith's avatar
      [modules] Add some missing blockinfo records. · fa715655
      Richard Smith authored
      llvm-svn: 246504
      fa715655
    • Rafael Espindola's avatar
      Assign common symbols to the .bss output section. · 8b09d684
      Rafael Espindola authored
      llvm-svn: 246503
      8b09d684
    • Quentin Colombet's avatar
      [BasicAA] Fix the handling of sext and zext in the analysis of GEPs. · 5989bc6f
      Quentin Colombet authored
      Hopefully this will end the GEPs saga!
      
      This commit reverts r245394, i.e., it reapplies r221876 while incorporating the
      fixes from D11847.
      r221876 was not reapplied alone because it was not safe and D11847 was not
      applied alone because it needs r221876 to produce correct results.
      
      This should fix PR24596.
      
      Original commit message for r221876:
      Let's try this again...
      
      This reverts r219432, plus a bug fix.
      
      Description of the bug in r219432 (by Nick):
      
      The bug was using AllPositive to break out of the loop; if the loop break
      condition i != e is changed to i != e && AllPositive then the
      test_modulo_analysis_with_global test I've added will fail as the Modulo will
      be calculated incorrectly (as the last loop iteration is skipped, so Modulo
      isn't updated with its Scale).
      
      Nick also adds this comment:
      
      ComputeSignBit is safe to use in loops as it takes into account phi nodes, and
      the  == EK_ZeroEx check is safe in loops as, no matter how the variable changes
      between iterations, zero-extensions will always guarantee a zero sign bit. The
      isValueEqualInPotentialCycles check is therefore definitely not needed as all
      the variable analysis holds no matter how the variables change between loop
      iterations.
      
      And this patch also adds another enhancement to GetLinearExpression - basically
      to convert ConstantInts to Offsets (see test_const_eval and
      test_const_eval_scaled for the situations this improves).
      
      Original commit message:
      
      This reverts r218944, which reverted r218714, plus a bug fix.
      
      Description of the bug in r218714 (by Nick):
      
      The original patch forgot to check if the Scale in VariableGEPIndex flipped the
      sign of the variable. The BasicAA pass iterates over the instructions in the
      order they appear in the function, and so BasicAliasAnalysis::aliasGEP is
      called with the variable it first comes across as parameter GEP1. Adding a
      %reorder label puts the definition of %a after %b so aliasGEP is called with %b
      as the first parameter and %a as the second. aliasGEP later calculates that %a
      == %b + 1 - %idxprom where %idxprom >= 0 (if %a was passed as the first
      parameter it would calculate %b == %a - 1 + %idxprom where %idxprom >= 0) -
      ignoring that %idxprom is scaled by -1 here lead the patch to incorrectly
      conclude that %a > %b.
      
      Revised patch by Nick White, thanks! Thanks to Lang to isolating the bug.
      Slightly modified by me to add an early exit from the loop and avoid
      unnecessary, but expensive, function calls.
      
      Original commit message:
      
      Two related things:
      
      1. Fixes a bug when calculating the offset in GetLinearExpression. The code
         previously used zext to extend the offset, so negative offsets were converted
         to large positive ones.
      
      2. Enhance aliasGEP to deduce that, if the difference between two GEP
         allocations is positive and all the variables that govern the offset are also
         positive (i.e. the offset is strictly after the higher base pointer), then
         locations that fit in the gap between the two base pointers are NoAlias.
      
      Patch by Nick White!
      
      Message from D11847:
      Un-revert of r241981 and fix for PR23626. The 'Or' case of GetLinearExpression
      delegates to 'Add' if possible, and if not it returns an Opaque value.
      Unfortunately the Scale and Offsets weren't being set (and so defaulted to 0) -
      and a scale of zero effectively removes the variable from the GEP instruction.
      This meant that BasicAA would return MustAliases when it should have been
      returning PartialAliases (and PR23626 was an example of the GVN pass using an
      incorrect MustAlias to merge loads from what should have been different
      pointers).
      
      Differential Revision: http://reviews.llvm.org/D11847
      Patch by Nick White <n.j.white@gmail.com>!
      
      llvm-svn: 246502
      5989bc6f
    • Chris Bieneman's avatar
      [CMake] Enable building builtins for iOS and iOS simulator. · 9e6af158
      Chris Bieneman authored
      Building iOS does respect COMPILER_RT_ENABLE_IOS.
      
      llvm-svn: 246501
      9e6af158
    • JF Bastien's avatar
      WebAssembly: generate load/store · 73ff6afa
      JF Bastien authored
      Summary: This handles all load/store operations that WebAssembly defines, and handles those necessary for C++ such as i1. I left a FIXME for outstanding features which aren't required for now.
      
      Reviewers: sunfish
      
      Subscribers: jfb, llvm-commits, dschuff
      llvm-svn: 246500
      73ff6afa
    • Chris Bieneman's avatar
      [CMake] Fixing lip output library name on Darwin platforms. · 3b0b43c8
      Chris Bieneman authored
      llvm-svn: 246499
      3b0b43c8
    • Richard Smith's avatar
      Infrastructure changes for Clang r246497. · 57844d72
      Richard Smith authored
      llvm-svn: 246498
      57844d72
    • Richard Smith's avatar
      [modules] Rework serialized DeclContext lookup table management. Instead of · 9ce2b459
      Richard Smith authored
      walking the loaded ModuleFiles looking for lookup tables for the context, store
      them all in one place, and merge them together if we find we have too many
      (currently, more than 4). If we do merge, include the merged form in our
      serialized lookup table, so that downstream readers never need to look at our
      imports' tables.
      
      This gives a huge performance improvement to builds with very large numbers of
      modules (in some cases, more than a 2x speedup was observed).
      
      llvm-svn: 246497
      9ce2b459
    • Rafael Espindola's avatar
      Start allocating space for common symbols. · 0518574a
      Rafael Espindola authored
      llvm-svn: 246496
      0518574a
    • Aaron Ballman's avatar
      Allow the static assert clang-tidy checker to run over C code. · c0dc76c2
      Aaron Ballman authored
      llvm-svn: 246495
      c0dc76c2
    • Aaron Ballman's avatar
      Help the clang-tidy helper script to understand C files better. · f444177d
      Aaron Ballman authored
      llvm-svn: 246494
      f444177d
    • Sanjay Patel's avatar
      generalize helper function of MergeConsecutiveStores to handle vector types (NFCI) · 218cbd5a
      Sanjay Patel authored
      This was part of D7208 (r227242), but that commit was reverted because it exposed
      a bug in AArch64 lowering. I should have that fixed and the rest of the commit
      reinstated soon.
      
      llvm-svn: 246493
      218cbd5a
    • Hans Wennborg's avatar
      Fix CHECK directives that weren't checking. · 2151d12e
      Hans Wennborg authored
      llvm-svn: 246492
      2151d12e
    • Reid Kleckner's avatar
      Revert "[lit] Speculatively fix PR24554 by manually closing the process handle" · 642f6d3f
      Reid Kleckner authored
      This reverts commit r245946. It didn't help the problem:
      http://lab.llvm.org:8011/builders/sanitizer-windows/builds/9179/steps/run%20tests/logs/stdio
      LINK : fatal error LNK1104: cannot open file
      
      llvm-svn: 246491
      642f6d3f
    • Ed Maste's avatar
      Remove expectedFailureFreeBSD for passing pexpect tests · 8bb3d04a
      Ed Maste authored
      These tests work when run locally. They had been occasionally failing
      on the FreeBSD buildbot due to pexpect issues. That buildbot is
      currently down, and I expect the replacement will not have this issue.
      
      llvm.org/pr22784
      
      llvm-svn: 246490
      8bb3d04a
    • Karl Schimpf's avatar
      Fix bug in method LLLexer::FP80HexToIntPair · 4da0e129
      Karl Schimpf authored
      llvm-svn: 246489
      4da0e129
    • Greg Clayton's avatar
    • Chris Bieneman's avatar
      [CMake] Fix building builtins on Linux and Darwin. · b38affa4
      Chris Bieneman authored
      Summary:
      I broke building the builtins with r245967. This fixes them on Linux and builds them properly for Darwin.
      
      The old code could not be made to work on Darwin as a result of the refactoring of add_compiler_rt_runtime, so I had to rework the way they are built for Darwin. This solution is not ideal and will be fixed in subsequent commits. I just want to get this in so everything is working again.
      
      Reviewers: samsonov, chh, compnerd, bogner
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D12500
      
      llvm-svn: 246487
      b38affa4
    • Hans Wennborg's avatar
      Fix Windows build by including raw_ostream.h · 043bf5b2
      Hans Wennborg authored
      llvm-svn: 246486
      043bf5b2