1. Sep 01, 2015
    • 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
    • Hans Wennborg's avatar
      Fix CHECK directives that weren't checking. · 4a61370b
      Hans Wennborg authored
      llvm-svn: 246485
      4a61370b
    • Naomi Musgrave's avatar
      Rollback of commit "Repress sanitization on User dtor." · 21c1bc46
      Naomi Musgrave authored
      This would have suppressed bug 24578, about use-after-
      destroy on User and MDNode. Rolled back suppression for
      the sake of code cleanliness, in preferance for bug
      tracking to keep track of this issue.
      
      This reverts commit 6ff2baabc4625d5b0a8dccf76aa0f72d930ea6c0.
      
      llvm-svn: 246484
      21c1bc46
    • Tobias Grosser's avatar
      Fix another typo in the subloop counting · 40820ca2
      Tobias Grosser authored
      ... as well as the corresponding test cases.
      
      Thank's Johannes for finding this bug.
      
      llvm-svn: 246483
      40820ca2
    • Hal Finkel's avatar
      [DAGCombine] Use getSetCCResultType utility function · 2483f206
      Hal Finkel authored
      DAGCombine has a utility wrapper around TLI's getSetCCResultType; use it in the
      one place in DAGCombine still directly calling the TLI function. NFC.
      
      llvm-svn: 246482
      2483f206
    • Sanjay Patel's avatar
      [x86] enable machine combiner reassociations for scalar 'or' insts · d9a5c225
      Sanjay Patel authored
      llvm-svn: 246481
      d9a5c225
    • Rafael Espindola's avatar
      Don't allocate space for SHT_NOBITS sections. · 058f3432
      Rafael Espindola authored
      llvm-svn: 246480
      058f3432
    • Gabor Horvath's avatar
      Revert r246345 until an assertion is fixed. · 742fd989
      Gabor Horvath authored
      llvm-svn: 246479
      742fd989
    • Reid Kleckner's avatar
      [EH] Handle non-Function personalities like unknown personalities · e00faf8c
      Reid Kleckner authored
      Also delete and simplify a lot of MachineModuleInfo code that used to be
      needed to handle personalities on landingpads.  Now that the personality
      is on the LLVM Function, we no longer need to track it this way on MMI.
      Certainly it should not live on LandingPadInfo.
      
      llvm-svn: 246478
      e00faf8c
    • Johannes Doerfert's avatar
      Do Not Model Unbounded Loops · 5f912d37
      Johannes Doerfert authored
      
      
        Code generation currently does not expect unbounded loops. When
        using ISL to compute the loop trip count, if we find that the
        iteration domain remains unbounded, we invalidate the Scop by
        creating an infeasible context.
      
      Contributed-by: default avatarMatthew Simpson <mssimpso@codeaurora.org>
      
      This fixes PR24634.
      
      Differential Revision: http://reviews.llvm.org/D12493
      
      llvm-svn: 246477
      5f912d37
    • Philip Reames's avatar
      [FunctionAttr] Infer nonnull attributes on returns · a88caeab
      Philip Reames authored
      Teach FunctionAttr to infer the nonnull attribute on return values of functions which never return a potentially null value. This is done both via a conservative local analysis for the function itself and a optimistic per-SCC analysis. If no function in the SCC returns anything which could be null (other than values from other functions in the SCC), we can conclude no function returned a null pointer. Even if some function within the SCC returns a null pointer, we may be able to locally conclude that some don't.
      
      Differential Revision: http://reviews.llvm.org/D9688
      
      llvm-svn: 246476
      a88caeab
    • Davide Italiano's avatar
      [llvm-readobj] Dump MachO Dysymtab command. · 35eebe13
      Davide Italiano authored
      Example output:
      
      File: <stdin>
      Format: Mach-O 64-bit x86-64
      Arch: x86_64
      AddressSize: 64bit
      Dysymtab {
      
      ilocalsym: 0
      nlocalsym: 6
      iextdefsym: 6
      nextdefsym: 2
      iundefsym: 8
      nundefsym: 0
      tocoff: 0
      ntoc: 0
      modtaboff: 0
      nmodtab: 0
      extrefsymoff: 0
      nextrefsyms: 0
      indirectsymoff: 0
      nindirectsyms: 0
      extreloff: 0
      nextrel: 0
      locreloff: 0
      nlocrel: 0
      
      }
      
      Differential Revision:	http://reviews.llvm.org/D12496
      
      llvm-svn: 246474
      35eebe13
    • Rafael Espindola's avatar
      Stop hardcoding GCC paths in crt/ld.so lookup. · c53c5b13
      Rafael Espindola authored
      This patch refactors the code to use the GCC installation detector
      (modified so that it works in Solaris), and uses
      ToolChain::GetFilePath everywhere once it works.
      
      Patch by Xan López <xan@igalia.com>!
      
      llvm-svn: 246473
      c53c5b13
    • Quentin Colombet's avatar
    • Kostya Serebryany's avatar
      [libFuzzer] update the docs to mention llvm-as-fuzzer · b98e327b
      Kostya Serebryany authored
      llvm-svn: 246471
      b98e327b
    • Naomi Musgrave's avatar
      Undo reversion on commit: Revert "Revert "Repress sanitization on User dtor. · 763468ba
      Naomi Musgrave authored
      Modify msan macros for applying attribute""
      
      This reverts commit 020e70a79878c96457e6882bcdfaf6628baf32b7.
      
      llvm-svn: 246470
      763468ba
    • David Majnemer's avatar
      [MS ABI] Correctly mangle classes without names for linkage purposes · 00350527
      David Majnemer authored
      A class without a name for linkage purposes gets a name along the lines
      of <unnamed-type-foo> where foo is either the name of a declarator which
      defined it (like a variable or field) or a
      typedef-name (like a typedef or alias-declaration).
      
      We handled the declarator case correctly but it would fall down during
      template instantiation if the declarator didn't share the tag's type.
      We failed to handle the typedef-name case at all.
      
      Instead, keep track of the association between the two and keep it up to
      date in the face of template instantiation.
      
      llvm-svn: 246469
      00350527
    • Eric Christopher's avatar
      Pull the target attribute parsing out of CGCall and onto TargetInfo. · d40722e2
      Eric Christopher authored
      Also:
        - Add a typedef to make working with the result easier.
        - Update callers to use the new function.
        - Make initFeatureMap out of line.
      
      llvm-svn: 246468
      d40722e2