Skip to content
  1. Sep 01, 2016
    • Michael Kuperstein's avatar
      Rename some variables to have meaningful names. NFC. · b4743597
      Michael Kuperstein authored
      llvm-svn: 280391
      b4743597
    • Matthew Simpson's avatar
      [LV] Move VectorParts allocation and mapping into PHI widening (NFC) · 922af076
      Matthew Simpson authored
      This patch moves the allocation of VectorParts for PHI nodes into the actual
      PHI widening code. Previously, we allocated these VectorParts in
      vectorizeBlockInLoop, and passed them by reference to widenPHIInstruction. Upon
      returning, we would then map the VectorParts in VectorLoopValueMap. This
      behavior is problematic for the cases where we only want to generate a scalar
      version of a PHI node. For example, if in the future we only generate a scalar
      version of an induction variable, we would end up inserting an empty vector
      entry into the map once we return to vectorizeBlockInLoop. We now no longer
      need to pass VectorParts to the various PHI widening functions, and we can keep
      VectorParts allocation as close as possible to the point at which they are
      actually mapped in VectorLoopValueMap.
      
      llvm-svn: 280390
      922af076
    • Enrico Granata's avatar
      Change the formula for tagged NSIndexPath data formatting · df43d25f
      Enrico Granata authored
      Fixes rdar://25192935
      
      llvm-svn: 280389
      df43d25f
    • Zachary Turner's avatar
      5c7c2307
    • Reid Kleckner's avatar
      Fix dll_host.cc test after adding div and gep trace coverage points · 507ba209
      Reid Kleckner authored
      llvm-svn: 280387
      507ba209
    • Michael Kuperstein's avatar
      [DAGCombine] Don't fold a trunc if it feeds an anyext · 65bc3c89
      Michael Kuperstein authored
      Legalization tends to create anyext(trunc) patterns. This should always be
      combined - into either a single trunc, a single ext, or nothing if the
      types match exactly. But if we happen to combine the trunc first, we may pull
      the trunc away from the anyext or make it implicit (e.g. the truncate(extract)
      -> extract(bitcast) fold).
      
      To prevent this, we can avoid doing the fold, similarly to how we already handle
      fpround(fpextend).
      
      Differential Revision: https://reviews.llvm.org/D23893
      
      llvm-svn: 280386
      65bc3c89
    • Changpeng Fang's avatar
      AMDGPU/SI: MIMG TD Refactoring. · b28fe030
      Changpeng Fang authored
      Summary:
       Created a new td file MIMGInstructions.td which contains all definitions
      of MIMG related instructions.
      
      Reviewed by:
        kzhuravl, vpykhtin
      
      Differential Revision:
        http://reviews.llvm.org/D24106
      
      llvm-svn: 280385
      b28fe030
    • Jason Henline's avatar
      [SE] Docs use JAVADOC_AUTOBRIEF · a8a7fb95
      Jason Henline authored
      That way we don't have to explicitly annotate each brief description as
      \brief.
      
      llvm-svn: 280384
      a8a7fb95
    • Reid Kleckner's avatar
      [lit] Use multiprocessing by default on Windows · f309bfc5
      Reid Kleckner authored
      Apparently nobody evaluated multiprocessing on Windows since Daniel
      enabled multiprocessing on Unix in r193279. It works so far as I can
      tell.
      
      Today this is worth about an 8x speedup (631.29s to 73.25s) on my 24
      core Windows machine. Hopefully this will improve Windows buildbot cycle
      time, where currently it takes more time to run check-all than it does
      to self-host with assertions enabled:
      http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/20
        build stage 2 ninja all ( 28 mins, 22 secs )
        ninja check 2 stage 2   ( 37 mins, 38 secs )
      
      llvm-svn: 280382
      f309bfc5
    • Chris Bieneman's avatar
      [CMake] Revive LLVM_*_DIRS variables · be765196
      Chris Bieneman authored
      This is a partial revert of r280013. Brad King pointed out these variable names are matching CMake conventions, so we should preserve them.
      
      I've also added a direct mapping of the LLVM_*_DIR variables which we need to make projects support building in and out of tree.
      
      llvm-svn: 280380
      be765196
    • Geoff Berry's avatar
      [EarlyCSE] Change C API pass interface for EarlyCSE w/ MemorySSA · fcb186ca
      Geoff Berry authored
      Previous change broke the C API for creating an EarlyCSE pass w/
      MemorySSA by adding a bool parameter to control whether MemorySSA was
      used or not.  This broke the OCaml bindings.  Instead, change the old C
      API entry point back and add a new one to request an EarlyCSE pass with
      MemorySSA.
      
      llvm-svn: 280379
      fcb186ca
    • Saleem Abdulrasool's avatar
      build: profile is not a sanitizer · b939a7fd
      Saleem Abdulrasool authored
      There was an invalid entry in the sanitizer list, remove it.  This has no effect
      on the building, just removes the definition of a cached variable.
      
      llvm-svn: 280378
      b939a7fd
    • Simon Dardis's avatar
      [mips] Include missed file from previous commit · 1fa1fb0f
      Simon Dardis authored
      llvm-svn: 280377
      1fa1fb0f
    • Simon Pilgrim's avatar
      [X86][SSE] Dropped (V)CVTPD2PS intrinsic patterns now that its bound to X86vfpround · ce0e9f0b
      Simon Pilgrim authored
      It now uses X86vfpround patterns directly instead.
      
      Followup to D23797
      
      llvm-svn: 280376
      ce0e9f0b
    • Rafael Espindola's avatar
      Add missing REQUIRES. · d59509ee
      Rafael Espindola authored
      llvm-svn: 280375
      d59509ee
    • Simon Dardis's avatar
      [mips] interAptiv based generic schedule model · bd271547
      Simon Dardis authored
      This scheduler describes a processor which covers all MIPS ISAs based
      around the interAptiv and P5600 timings.
      
      Reviewers: vkalintiris, dsanders
      
      Differential Revision: https://reviews.llvm.org/D23551
      
      llvm-svn: 280374
      bd271547
    • Renato Golin's avatar
      Try to fix another profile test · fbd3de78
      Renato Golin authored
      Another CFG optimisation patch (280364) has broken bad profile tests, and this
      is a similar attempt to fix the test without changing the semantics.
      
      llvm-svn: 280373
      fbd3de78
    • Filipe Cabecinhas's avatar
      Remove extra scariness.Clear() call. · 9512821e
      Filipe Cabecinhas authored
      llvm-svn: 280372
      9512821e
    • Andrey Bokhanko's avatar
      [CMake] Fix LLVM_ENABLE_EH and LLVM_ENABLE_RTTI on MSVC · b7201cce
      Andrey Bokhanko authored
      Patch by Johannes Sebastian Mueller-Roemer.
      
      Differential Revision: https://reviews.llvm.org/D23645
      
      llvm-svn: 280371
      b7201cce
    • Sanjay Patel's avatar
      [InstCombine] remove fold of an icmp pattern that should never happen · dd861964
      Sanjay Patel authored
      While removing a scalar shackle from an icmp fold, I noticed that I couldn't find any tests to trigger
      this code path.
      
      The 'and' shrinking transform should be handled by InstCombiner::foldCastedBitwiseLogic()
      or eliminated with InstSimplify. The icmp narrowing is part of InstCombiner::foldICmpWithCastAndCast().
      
      Differential Revision: https://reviews.llvm.org/D24031 
      
      llvm-svn: 280370
      dd861964
    • Krzysztof Parzyszek's avatar
      [Hexagon] Deal with undefs when extending live intervals · 07d9f53b
      Krzysztof Parzyszek authored
      Reapply r280275, since MSVC accepts r280358.
      
      llvm-svn: 280369
      07d9f53b
    • Elena Demikhovsky's avatar
      Optimized FMA intrinsic + FNEG , like · 4d7738df
      Elena Demikhovsky authored
      -(a*b+c)
      
      and FNEG + FMA, like
      a*b-c or (-a)*b+c.
      
      The bug description is here :  https://llvm.org/bugs/show_bug.cgi?id=28892
      
      Differential revision: https://reviews.llvm.org/D23313
      
      llvm-svn: 280368
      4d7738df
    • Aleksei Sidorin's avatar
      [analyzer] ExprEngine: remove second call to PreStmt<CastExpr> · 29afb193
      Aleksei Sidorin authored
      This patch also introduces AnalysisOrderChecker which is intended for testing
      of callback call correctness.
      
      Differential Revision: https://reviews.llvm.org/D23804
      
      llvm-svn: 280367
      29afb193
    • Rafael Espindola's avatar
      Sign extend a value before passing it to the Target. · 3a9eef16
      Rafael Espindola authored
      This is what InputSectionBase<ELFT>::relocate does and we need to be
      consistent. The other option would be to be more explicit about which
      relocations are signed and which are not, and sign extend only when
      appropriated. That would require extending the target interface.
      
      llvm-svn: 280366
      3a9eef16
    • Renato Golin's avatar
      Fix profile test assuming dumb compiler · 0f298a26
      Renato Golin authored
      Commit r280364 has introduced some call-graph optmisations making a profiler
      test "fail" due to not expecting the compiler to be "smart", and fold constants
      across functions. This commit works around the issue, leaving the origial
      semantics intact.
      
      llvm-svn: 280365
      0f298a26
    • James Molloy's avatar
      [SimplifyCFG] Handle tail-sinking of more than 2 incoming branches · 88cad7e5
      James Molloy authored
      This was a real restriction in the original version of SinkIfThenCodeToEnd. Now it's been rewritten, the restriction can be lifted.
      
      As part of this, we handle a very common and useful case where one of the incoming branches is actually conditional. Consider:
      
         if (a)
           x(1);
         else if (b)
           x(2);
      
      This produces the following CFG:
      
               [if]
              /    \
            [x(1)] [if]
              |     | \
              |     |  \
              |  [x(2)] |
               \    |  /
                [ end ]
      
      [end] has two unconditional predecessor arcs and one conditional. The conditional refers to the implicit empty 'else' arc. This same pattern can also be caused by an empty default block in a switch.
      
      We can't sink the call to x() down to end because no call to x() happens on the third incoming arc (assume that x() has sideeffects for the sake of argument; if something is safe to speculate we could indeed sink nevertheless but this cannot happen in the general case and causes many extra selects).
      
      We are now able to detect this case and split off the unconditional arcs to a common successor:
      
               [if]
              /    \
            [x(1)] [if]
              |     | \
              |     |  \
              |  [x(2)] |
               \   /    |
           [sink.split] |
                 \     /
                 [ end ]
      
      Now we can sink the call to x() into %sink.split. This can cause significant code simplification in many testcases.
      
      llvm-svn: 280364
      88cad7e5
    • Filipe Cabecinhas's avatar
      Clear scariness score when initializing ErrorDoubleFree · f1fb439d
      Filipe Cabecinhas authored
      llvm-svn: 280363
      f1fb439d
    • Filipe Cabecinhas's avatar
      Copy over most of the scariness_score test to the general tests · 6e903def
      Filipe Cabecinhas authored
      The abort() test wasn't copied over (original case 22). This is because
      it doesn't work on OS X.
      
      If theres no buildbot problem with this test later today, I will
      minimize the Linux version.
      
      llvm-svn: 280361
      6e903def
    • Aleksei Sidorin's avatar
      [analyzer] Add more FileIDs to PlistDiagnostic map to avoid assertion · e1beaf1e
      Aleksei Sidorin authored
      Some FileIDs that may be used by PlistDiagnostics were not added while building
      a list of pieces. This caused assertion violation in GetFID() function.
      This patch adds some missing FileIDs to avoid the assertion. It also contains
      small refactoring of PlistDiagnostics::FlushDiagnosticsImpl().
      
      Patch by Aleksei Sidorin, Ilya Palachev.
      
      Differential Revision: https://reviews.llvm.org/D22090
      
      llvm-svn: 280360
      e1beaf1e
    • Haojian Wu's avatar
      [include-fixer] Fix an undefined variable exception in vim script when there is · 25df3b85
      Haojian Wu authored
      only one candidate header.
      
      llvm-svn: 280359
      25df3b85
    • Krzysztof Parzyszek's avatar
      Add an optional parameter with a list of undefs to extendToIndices · 4f863d75
      Krzysztof Parzyszek authored
      Reapply r280268, hopefully in a version that MSVC likes.
      
      llvm-svn: 280358
      4f863d75
    • Honggyu Kim's avatar
      [IR] Properly handle escape characters in Attribute::getAsString() · 9eb6a102
      Honggyu Kim authored
      If an attribute name has special characters such as '\01', it is not
      properly printed in LLVM assembly language format.  Since the format
      expects the special characters are printed as it is, it has to contain
      escape characters to make it printable.
      
      Before:
        attributes #0 = { ... "counting-function"="^A__gnu_mcount_nc" ...
      
      After:
        attributes #0 = { ... "counting-function"="\01__gnu_mcount_nc" ...
      
      Reviewers: hfinkel, rengolin, rjmccall, compnerd
      
      Subscribers: nemanjai, mcrosier, hans, shenhan, majnemer, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D23792
      
      llvm-svn: 280357
      9eb6a102
    • Dimitar Vlahovski's avatar
      Minidump parsing · 2e50d8ed
      Dimitar Vlahovski authored
      Summary:
      This is a Minidump parsing code.
      There are still some more structures/data streams that need to be added.
      The aim ot this is to be used in the implementation of
      a minidump debugging plugin that works on all platforms/architectures.
      Currently we have a windows-only plugin that uses the WinAPI to parse
      the dump files.
      Also added unittests for the current functionality.
      
      Reviewers: labath, amccarth
      
      Subscribers: tberghammer, danalbert, srhines, lldb-commits, dschuff
      
      Differential Revision: https://reviews.llvm.org/D23545
      
      llvm-svn: 280356
      2e50d8ed
    • Honggyu Kim's avatar
      [Frontend] Fix mcount inlining bug · 2b0e424b
      Honggyu Kim authored
      Since some profiling tools, such as gprof, ftrace, and uftrace, use
      -pg option to generate a mcount function call at the entry of each
      function. Function invocation can be detected by this hook function.
      
      But mcount insertion is done before function inlining phase in clang,
      sometime a function that already has a mcount call can be inlined in the
      middle of another function.
      
      This patch adds an attribute "counting-function" to each function
      rather than emitting the mcount call directly in frontend so that this
      attribute can be processed in backend. Then the mcount calls can be
      properly inserted in backend after all the other optimizations are
      completed.
      
      Link: https://llvm.org/bugs/show_bug.cgi?id=28660
      
      Reviewers: hans, rjmccall, hfinkel, rengolin, compnerd
      
      Subscribers: shenhan, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D22666
      
      llvm-svn: 280355
      2b0e424b
    • Aleksei Sidorin's avatar
      68945765
    • James Molloy's avatar
      [SimplifyCFG] Change the algorithm in SinkThenElseCodeToEnd · eec6df31
      James Molloy authored
      r279460 rewrote this function to be able to handle more than two incoming edges and took pains to ensure this didn't regress anything.
      
      This time we change the logic for determining if an instruction should be sunk. Previously we used a single pass greedy algorithm - sink instructions until one requires more than one PHI node or we run out of instructions to sink.
      
      This had the problem that sinking instructions that had non-identical but trivially the same operands needed extra logic so we sunk them aggressively. For example:
      
          %a = load i32* %b          %d = load i32* %b
          %c = gep i32* %a, i32 0    %e = gep i32* %d, i32 1
      
      Sinking %c and %e would naively require two PHI merges as %a != %d. But the loads are obviously equivalent (and maybe can't be hoisted because there is no common predecessor).
      
      This is why we implemented the fairly complex function areValuesTriviallySame(), to look through trivial differences like this. However it's just not clever enough.
      
      Instead, throw areValuesTriviallySame away, use pointer equality to check equivalence of operands and switch to a two-stage algorithm.
      
      In the "scan" stage, we look at every sinkable instruction in isolation from end of block to front. If it's sinkable, we keep track of all operands that required PHI merging.
      
      In the "sink" stage, we iteratively sink the last non-terminator in the source blocks. But when calculating how many PHIs are actually required to be inserted (to work out if we should stop or not) we remove any values that have already been sunk from the set of PHI-merges required, which allows us to be more aggressive.
      
      This turns an algorithm with potentially recursive lookahead (looking through GEPs, casts, loads and any other instruction potentially not CSE'd) to two linear scans.
      
      llvm-svn: 280351
      eec6df31
    • Hal Finkel's avatar
      Add ISD::EH_DWARF_CFA, simplify @llvm.eh.dwarf.cfa on Mips, fix on PowerPC · 5081ac27
      Hal Finkel authored
      LLVM has an @llvm.eh.dwarf.cfa intrinsic, used to lower the GCC-compatible
      __builtin_dwarf_cfa() builtin. As pointed out in PR26761, this is currently
      broken on PowerPC (and likely on ARM as well). Currently, @llvm.eh.dwarf.cfa is
      lowered using:
      
        ADD(FRAMEADDR, FRAME_TO_ARGS_OFFSET)
      
      where FRAME_TO_ARGS_OFFSET defaults to the constant zero. On x86,
      FRAME_TO_ARGS_OFFSET is lowered to 2*SlotSize. This setup, however, does not
      work for PowerPC. Because of the way that the stack layout works, the canonical
      frame address is not exactly (FRAMEADDR + FRAME_TO_ARGS_OFFSET) on PowerPC
      (there is a lower save-area offset as well), so it is not just a matter of
      implementing FRAME_TO_ARGS_OFFSET for PowerPC (unless we redefine its
      semantics -- We can do that, since it is currently used only for
      @llvm.eh.dwarf.cfa lowering, but the better to directly lower the CFA construct
      itself (since it can be easily represented as a fixed-offset FrameIndex)). Mips
      currently does this, but by using a custom lowering for ADD that specifically
      recognizes the (FRAMEADDR, FRAME_TO_ARGS_OFFSET) pattern.
      
      This change introduces a ISD::EH_DWARF_CFA node, which by default expands using
      the existing logic, but can be directly lowered by the target. Mips is updated
      to use this method (which simplifies its implementation, and I suspect makes it
      more robust), and updates PowerPC to do the same.
      
      Fixes PR26761.
      
      Differential Revision: https://reviews.llvm.org/D24038
      
      llvm-svn: 280350
      5081ac27
    • Valery Pykhtin's avatar
      [AMDGPU] Scalar Memory instructions TD refactoring · 1b13886b
      Valery Pykhtin authored
      Differential revision: https://reviews.llvm.org/D23996
      
      llvm-svn: 280349
      1b13886b
    • Eugene Leviant's avatar
      Eliminate LayoutInputSection class · 97403d15
      Eugene Leviant authored
      Previously we used LayoutInputSection class to correctly assign
      symbols defined in linker script. This patch removes it and uses
      pointer to preceding input section in SymbolAssignment class instead.
      
      Differential revision: https://reviews.llvm.org/D23661
      
      llvm-svn: 280348
      97403d15
    • Hal Finkel's avatar
      Add a counter-function insertion pass · 40d7f5c2
      Hal Finkel authored
      As discussed in https://reviews.llvm.org/D22666, our current mechanism to
      support -pg profiling, where we insert calls to mcount(), or some similar
      function, is fundamentally broken. We insert these calls in the frontend, which
      means they get duplicated when inlining, and so the accumulated execution
      counts for the inlined-into functions are wrong.
      
      Because we don't want the presence of these functions to affect optimizaton,
      they should be inserted in the backend. Here's a pass which would do just that.
      The knowledge of the name of the counting function lives in the frontend, so
      we're passing it here as a function attribute. Clang will be updated to use
      this mechanism.
      
      Differential Revision: https://reviews.llvm.org/D22825
      
      llvm-svn: 280347
      40d7f5c2
Loading