1. Aug 24, 2016
    • Simon Pilgrim's avatar
      [X86][SSE] Add support for 32-bit element vectors to X86ISD::VZEXT_LOAD · 6392b8d4
      Simon Pilgrim authored
      Consecutive load matching (EltsFromConsecutiveLoads) currently uses VZEXT_LOAD (load scalar into lowest element and zero uppers) for vXi64 / vXf64 vectors only.
      
      For vXi32 / vXf32 vectors it instead creates a scalar load, SCALAR_TO_VECTOR and finally VZEXT_MOVL (zero upper vector elements), relying on tablegen patterns to match this into an equivalent of VZEXT_LOAD.
      
      This patch adds the VZEXT_LOAD patterns for vXi32 / vXf32 vectors directly and updates EltsFromConsecutiveLoads to use this.
      
      This has proven necessary to allow us to easily make VZEXT_MOVL a full member of the target shuffle set - without this change the call to combineShuffle (which is the main caller of EltsFromConsecutiveLoads) tended to recursively recreate VZEXT_MOVL nodes......
      
      Differential Revision: https://reviews.llvm.org/D23673
      
      llvm-svn: 279619
      6392b8d4
    • Chandler Carruth's avatar
      [PM] Introduce basic update capabilities to the new PM's CGSCC pass · 88823468
      Chandler Carruth authored
      manager, including both plumbing and logic to handle function pass
      updates.
      
      There are three fundamentally tied changes here:
      1) Plumbing *some* mechanism for updating the CGSCC pass manager as the
         CG changes while passes are running.
      2) Changing the CGSCC pass manager infrastructure to have support for
         the underlying graph to mutate mid-pass run.
      3) Actually updating the CG after function passes run.
      
      I can separate them if necessary, but I think its really useful to have
      them together as the needs of #3 drove #2, and that in turn drove #1.
      
      The plumbing technique is to extend the "run" method signature with
      extra arguments. We provide the call graph that intrinsically is
      available as it is the basis of the pass manager's IR units, and an
      output parameter that records the results of updating the call graph
      during an SCC passes's run. Note that "...UpdateResult" isn't a *great*
      name here... suggestions very welcome.
      
      I tried a pretty frustrating number of different data structures and such
      for the innards of the update result. Every other one failed for one
      reason or another. Sometimes I just couldn't keep the layers of
      complexity right in my head. The thing that really worked was to just
      directly provide access to the underlying structures used to walk the
      call graph so that their updates could be informed by the *particular*
      nature of the change to the graph.
      
      The technique for how to make the pass management infrastructure cope
      with mutating graphs was also something that took a really, really large
      number of iterations to get to a place where I was happy. Here are some
      of the considerations that drove the design:
      
      - We operate at three levels within the infrastructure: RefSCC, SCC, and
        Node. In each case, we are working bottom up and so we want to
        continue to iterate on the "lowest" node as the graph changes. Look at
        how we iterate over nodes in an SCC running function passes as those
        function passes mutate the CG. We continue to iterate on the "lowest"
        SCC, which is the one that continues to contain the function just
        processed.
      
      - The call graph structure re-uses SCCs (and RefSCCs) during mutation
        events for the *highest* entry in the resulting new subgraph, not the
        lowest. This means that it is necessary to continually update the
        current SCC or RefSCC as it shifts. This is really surprising and
        subtle, and took a long time for me to work out. I actually tried
        changing the call graph to provide the opposite behavior, and it
        breaks *EVERYTHING*. The graph update algorithms are really deeply
        tied to this particualr pattern.
      
      - When SCCs or RefSCCs are split apart and refined and we continually
        re-pin our processing to the bottom one in the subgraph, we need to
        enqueue the newly formed SCCs and RefSCCs for subsequent processing.
        Queuing them presents a few challenges:
        1) SCCs and RefSCCs use wildly different iteration strategies at
           a high level. We end up needing to converge them on worklist
           approaches that can be extended in order to be able to handle the
           mutations.
        2) The order of the enqueuing need to remain bottom-up post-order so
           that we don't get surprising order of visitation for things like
           the inliner.
        3) We need the worklists to have set semantics so we don't duplicate
           things endlessly. We don't need a *persistent* set though because
           we always keep processing the bottom node!!!! This is super, super
           surprising to me and took a long time to convince myself this is
           correct, but I'm pretty sure it is... Once we sink down to the
           bottom node, we can't re-split out the same node in any way, and
           the postorder of the current queue is fixed and unchanging.
        4) We need to make sure that the "current" SCC or RefSCC actually gets
           enqueued here such that we re-visit it because we continue
           processing a *new*, *bottom* SCC/RefSCC.
      
      - We also need the ability to *skip* SCCs and RefSCCs that get merged
        into a larger component. We even need the ability to skip *nodes* from
        an SCC that are no longer part of that SCC.
      
      This led to the design you see in the patch which uses SetVector-based
      worklists. The RefSCC worklist is always empty until an update occurs
      and is just used to handle those RefSCCs created by updates as the
      others don't even exist yet and are formed on-demand during the
      bottom-up walk. The SCC worklist is pre-populated from the RefSCC, and
      we push new SCCs onto it and blacklist existing SCCs on it to get the
      desired processing.
      
      We then *directly* update these when updating the call graph as I was
      never able to find a satisfactory abstraction around the update
      strategy.
      
      Finally, we need to compute the updates for function passes. This is
      mostly used as an initial customer of all the update mechanisms to drive
      their design to at least cover some real set of use cases. There are
      a bunch of interesting things that came out of doing this:
      
      - It is really nice to do this a function at a time because that
        function is likely hot in the cache. This means we want even the
        function pass adaptor to support online updates to the call graph!
      
      - To update the call graph after arbitrary function pass mutations is
        quite hard. We have to build a fairly comprehensive set of
        data structures and then process them. Fortunately, some of this code
        is related to the code for building the cal graph in the first place.
        Unfortunately, very little of it makes any sense to share because the
        nature of what we're doing is so very different. I've factored out the
        one part that made sense at least.
      
      - We need to transfer these updates into the various structures for the
        CGSCC pass manager. Once those were more sanely worked out, this
        became relatively easier. But some of those needs necessitated changes
        to the LazyCallGraph interface to make it significantly easier to
        extract the changed SCCs from an update operation.
      
      - We also need to update the CGSCC analysis manager as the shape of the
        graph changes. When an SCC is merged away we need to clear analyses
        associated with it from the analysis manager which we didn't have
        support for in the analysis manager infrsatructure. New SCCs are easy!
        But then we have the case that the original SCC has its shape changed
        but remains in the call graph. There we need to *invalidate* the
        analyses associated with it.
      
      - We also need to invalidate analyses after we *finish* processing an
        SCC. But the analyses we need to invalidate here are *only those for
        the newly updated SCC*!!! Because we only continue processing the
        bottom SCC, if we split SCCs apart the original one gets invalidated
        once when its shape changes and is not processed farther so its
        analyses will be correct. It is the bottom SCC which continues being
        processed and needs to have the "normal" invalidation done based on
        the preserved analyses set.
      
      All of this is mostly background and context for the changes here.
      
      Many thanks to all the reviewers who helped here. Especially Sanjoy who
      caught several interesting bugs in the graph algorithms, David, Sean,
      and others who all helped with feedback.
      
      Differential Revision: http://reviews.llvm.org/D21464
      
      llvm-svn: 279618
      88823468
    • Peter Smith's avatar
      Canonicalize output section name for .ARM.exidx sections · a52864a7
      Peter Smith authored
          
      The ARM Exception handling ABI requires that all ARM exception index
      table sections have a prefix of .ARM.exidx and are combined into a
      single contiguous block either in their own output section or as part
      of another output section.
          
      In general clang will output a single .ARM.exidx section per object,
      but will use .ARM.exidx.<section name> when -ffunction-sections is used.
          
      This change canonicalizes the names of sections with the .ARM.exidx
      prefix to just .ARM.exidx, which ensures that there is only a single
      output section.
      
      Differential Revision: https://reviews.llvm.org/D23775
      
      llvm-svn: 279617
      a52864a7
    • Akira Hatanaka's avatar
      [asan] Mark asan-symbolize-sanity-test.cc as UNSUPPORTED on x86_64-apple · 1164cae5
      Akira Hatanaka authored
      and x86_64h-apple.
      
      Mark the test as UNSUPPORTED to fix a bot that is failing.
      
      http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check
      
      The bot is failing because asan_symbolize.py cannot tell whether the
      reported address is from an x86_64 slice or an x86_64h slice by the
      length of the address alone, so it ends up passing the wrong arch to
      atos.
      
      rdar://problem/27907889
      
      llvm-svn: 279614
      1164cae5
    • Vedant Kumar's avatar
      [AST] Make InitListExpr::isExplicit const (NFC) · 81899af5
      Vedant Kumar authored
      Patch by Alexander Shaposhnikov!
      
      Differential Revision: https://reviews.llvm.org/D23828
      
      llvm-svn: 279613
      81899af5
    • Mehdi Amini's avatar
      Tentatively fix gold-plugin test: ThinLTO objects start at offset 0 now. · dfa0c538
      Mehdi Amini authored
      Annoyingly, incremental builds don't detect these kind of issue.
      
      llvm-svn: 279612
      dfa0c538
    • Jason Molenda's avatar
      e1cf274b
    • Gor Nishanov's avatar
      [Coroutines] Fix unused var warning in release build · 4570e26e
      Gor Nishanov authored
      llvm-svn: 279610
      4570e26e
    • Gor Nishanov's avatar
      [Coroutines] Part 8: Coroutine Frame Building algorithm · 241b041f
      Gor Nishanov authored
      Summary:
      This patch adds coroutine frame building algorithm. Now, simple coroutines such as ex0.ll and ex1.ll (first examples from docs\Coroutines.rst can be compiled).
      
      Documentation and overview is here: http://llvm.org/docs/Coroutines.html.
      
      Upstreaming sequence (rough plan)
      1.Add documentation. (https://reviews.llvm.org/D22603)
      2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
      ...
      
      7. Split coroutine into subfunctions. (https://reviews.llvm.org/D23461)
      8. Coroutine Frame Building algorithm  <= we are here
      9. Add f.cleanup subfunction.
      10+. The rest of the logic
      
      Reviewers: majnemer
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D23586
      
      llvm-svn: 279609
      241b041f
    • Adam Nemet's avatar
      [Pragma] Clear loop distribution attribute between loops · 9c848590
      Adam Nemet authored
      llvm-svn: 279608
      9c848590
    • Mehdi Amini's avatar
      Remove excessive padding from PTHStatData (NFC) · 2862ba61
      Mehdi Amini authored
      This diff reorders the fields and removes excessive padding.
      This fixes the following warning:
      
      PTHLexer.cpp:629:7: warning: Excessive padding in 'class (anonymous namespace)::PTHStatData' (14 padding bytes, where 6 is optimal). Optimal fields order: Size, ModTime, UniqueID, HasData, IsDirectory, consider reordering the fields or adding explicit padding members.
      
      Patch by: Alexander Shaposhnikov <shal1t712@gmail.com>
      
      Differential Revision: https://reviews.llvm.org/D23826
      
      llvm-svn: 279607
      2862ba61
    • Saleem Abdulrasool's avatar
      libc++: add an option to build against compiler-rt · e81fcb81
      Saleem Abdulrasool authored
      This mirrors the option in libc++abi to build without libgcc.
      
      llvm-svn: 279606
      e81fcb81
    • Chandler Carruth's avatar
      Preserve a pointer to the newly allocated signal stack as well. That too · eb232dc9
      Chandler Carruth authored
      is flagged by LSan at least among leak detectors.
      
      llvm-svn: 279605
      eb232dc9
    • Matthias Braun's avatar
      TargetSchedule: Do not consider subregister definitions as reads. · 3a133159
      Matthias Braun authored
      We should not consider subregister definitions as reads for schedule
      model purposes (they are just modeled as reads of the overal vreg for
      liveness calculation purposes, the CPU instructions are not actually
      reading).
      
      Unfortunately I cannot submit a test for this as it requires a target
      which uses ReadAdvance annotation in the scheduling model and has
      subregister liveness enabled at the same time, which is only the case on
      an out of tree target.
      
      llvm-svn: 279604
      3a133159
    • Douglas Yung's avatar
      Adding an additional test to ensure the frame pointer is emitted · 8702e440
      Douglas Yung authored
      when compiling with optimization when PS4 is the target.
      
      llvm-svn: 279603
      8702e440
    • Matthias Braun's avatar
      CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses · 733fe367
      Matthias Braun authored
      Re-apply this patch, hopefully I will get away without any warnings
      in the constructor now.
      
      This patch removes the MachineFunctionAnalysis. Instead we keep a
      map from IR Function to MachineFunction in the MachineModuleInfo.
      
      This allows the insertion of ModulePasses into the codegen pipeline
      without breaking it because the MachineFunctionAnalysis gets dropped
      before a module pass.
      
      Peak memory should stay unchanged without a ModulePass in the codegen
      pipeline: Previously the MachineFunction was freed at the end of a codegen
      function pipeline because the MachineFunctionAnalysis was dropped; With
      this patch the MachineFunction is freed after the AsmPrinter has
      finished.
      
      Differential Revision: http://reviews.llvm.org/D23736
      
      llvm-svn: 279602
      733fe367
    • Kostya Serebryany's avatar
      [libFuzzer] use __attribute__((target("popcnt"))) only on x86_64 · bceadcf1
      Kostya Serebryany authored
      llvm-svn: 279601
      bceadcf1
    • Matthias Braun's avatar
      MIRParser/MIRPrinter: Compute isSSA instead of printing/parsing it. · 79f85b3b
      Matthias Braun authored
      Specifying isSSA is an extra line at best and results in invalid MI at
      worst. Compute the value instead.
      
      Differential Revision: http://reviews.llvm.org/D22722
      
      llvm-svn: 279600
      79f85b3b
    • Richard Smith's avatar
      Increase the size of the sigaltstack used by LLVM signal handlers. 8KB is not · b3116313
      Richard Smith authored
      sufficient in some cases; increase to 64KB, which should be enough for anyone :)
      
      Patch by github.com/bryant!
      
      llvm-svn: 279599
      b3116313
    • Matthias Braun's avatar
      MachineModuleInfo: Avoid dummy constructor, use INITIALIZE_TM_PASS · c3b2e80b
      Matthias Braun authored
      Change this pass constructor to just accept a const TargetMachine * and
      use INITIALIZE_TM_PASS, that way we can get rid of the dummy
      constructor. The pass will still fail when calling the default
      constructor leading to TM == nullptr, this is no different than before
      but is more in line what other codegen passes are doing and avoids the
      dummy constructor.
      
      llvm-svn: 279598
      c3b2e80b
    • Saleem Abdulrasool's avatar
      Revert "libc++: Perform configuration checks with -nodefaultlibs" · 7fe0681e
      Saleem Abdulrasool authored
      This reverts SVN r279584 which broke the buildbots.  Will re-apply once the
      issue has been root-caused and fixed.
      
      llvm-svn: 279596
      7fe0681e
    • Kostya Serebryany's avatar
      [sanitizer] trying to fix the PPC bots · 865a98d2
      Kostya Serebryany authored
      llvm-svn: 279595
      865a98d2
    • David Callahan's avatar
      [ADCE] Add control dependence computation · 012d1c07
      David Callahan authored
      Summary:
      This is part of a serious of patches to evolve ADCE.cpp to support
      removing of unnecessary control flow.
      
      This patch adds the ability to compute control dependences using
      the iterated dominance frontier. We extend the liveness propagation
      to alternate between data and control dependences until convergences.
      
      Modify the pass manager intergation to compute the post-dominator tree
      needed for iterator dominance frontier.
      
      We still force all terminators live for now until we add code to
      handlinge removing control flow in a later patch.
      
      No changes to effective behavior with this patch
      
      Previous patches:
      
      D23225 [ADCE] Modify data structures to support removing control flow
      D23065 [ADCE] Refactor anticipating new functionality (NFC)
      D23102 [ADCE] Refactoring for new functionality (NFC)
      
      Reviewers: nadav, majnemer, mehdi_amini
      
      Subscribers: twoh, freik, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D23559
      
      llvm-svn: 279594
      012d1c07
    • Philip Reames's avatar
      [stackmaps] Remove an unneeded member variable [NFC] · d06a1b4c
      Philip Reames authored
      llvm-svn: 279590
      d06a1b4c
    • Kostya Serebryany's avatar
      [libFuzzer] fix link in docs · aafa0b05
      Kostya Serebryany authored
      llvm-svn: 279589
      aafa0b05
    • Kostya Serebryany's avatar
      [libFuzzer] collect 64 states for value profile, not 65 · ac524cfc
      Kostya Serebryany authored
      llvm-svn: 279588
      ac524cfc
    • Kostya Serebryany's avatar
      [libFuzzer] docs on value profile · b5dad1ee
      Kostya Serebryany authored
      llvm-svn: 279587
      b5dad1ee
    • Philip Reames's avatar
      [stackmaps] More extraction of common code [NFCI] · e83c4b30
      Philip Reames authored
      General cleanup before starting to work on the part I want to actually change.
      
      llvm-svn: 279586
      e83c4b30
    • Michael Zolotukhin's avatar
      [LoopUnroll] By default disable unrolling when optimizing for size. · bd63d436
      Michael Zolotukhin authored
      Summary:
      In clang commit r268509 we started to invoke loop-unroll pass from the
      driver even under -Os. However, we happen to not initialize optsize
      thresholds properly, which si fixed with this change.
      
      r268509 led to some big compile time regressions, because we started to
      unroll some loops that we didn't unroll before. With this change I hope
      to recover most of the regressions. We still are slightly slower than
      before, because we do some checks here and there in loop-unrolling
      before we bail out, but at least the slowdown is not that huge now.
      
      Reviewers: hfinkel, chandlerc
      
      Subscribers: mzolotukhin, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D23388
      
      llvm-svn: 279585
      bd63d436
    • Saleem Abdulrasool's avatar
      libc++: Perform configuration checks with -nodefaultlibs · 12a0b1f4
      Saleem Abdulrasool authored
      We're compiling libc++ with -nodefaultlibs, so we should also pass this option
      during the configuration checks to ensure those checks are consistent with the
      actual build.
      
      The primary motivation here is to ease cross-compilation against a non-standard
      set of C++ libraries. Previously, the configuration checks would attempt to link
      against the standard C++ libraries, which would cause link failures when
      cross-compiling, even though the actual library link would go through correctly
      (because of the use of -nodefaultlibs and explicitly specifying any needed
      libraries). This is more correct even ignoring the motivation, however.
      
      Patch by Shoaib Meenai!
      
      llvm-svn: 279584
      12a0b1f4
    • Richard Smith's avatar
      Don't use "return {...}" to initialize a std::tuple. This has only been valid · 84c4cc47
      Richard Smith authored
      since 2015 (n4387), though it's allowed by a library DR so new implementations
      accept it in their C++11 modes...
      
      This should unbreak the build with libstdc++ 4.9.
      
      llvm-svn: 279583
      84c4cc47
    • Richard Smith's avatar
      #ifdef out validation code when asserts are disabled to remove unused variable · 418237be
      Richard Smith authored
      warnings.
      
      llvm-svn: 279582
      418237be
    • Richard Smith's avatar
      Remove unused data member to unbreak -Werror builds. · eae61389
      Richard Smith authored
      llvm-svn: 279581
      eae61389
    • Richard Smith's avatar
      Revert r279564. It introduces undefined behavior (binding a reference to a · 8c3fbdc6
      Richard Smith authored
      dereferenced null pointer) in MachineModuleInfo::MachineModuleInfo that causes
      -Werror builds (including several buildbots) to fail.
      
      llvm-svn: 279580
      8c3fbdc6
    • Tim Northover's avatar
      GlobalISel: add some G_TRUNCs to make icmp test valid MIR. · d0cfb734
      Tim Northover authored
      llvm-svn: 279579
      d0cfb734
    • Sanjay Patel's avatar
      [InstCombine] use local variables for repeated values; NFCI · d64e9887
      Sanjay Patel authored
      llvm-svn: 279578
      d64e9887
    • Petr Hosek's avatar
      [MC] Support .dc directives in assembler parser · 731bb9cf
      Petr Hosek authored
      While these directives are mostly aliases for the existing integer
      and float value directives, some of them like .dc.a have no direct
      equivalents and are sometimes being used for convenience.
      
      Differential Revision: https://reviews.llvm.org/D23810
      
      llvm-svn: 279577
      731bb9cf
    • Mehdi Amini's avatar
      [ThinLTO] Add caching to the new LTO API · adc0e26b
      Mehdi Amini authored
      Add the ability to plug a cache on the LTO API.
      I tried to write such that a linker implementation can
      control the cache backend. This is intrusive and I'm
      not totally happy with it, but I can't figure out a
      better design right now.
      
      Differential Revision: https://reviews.llvm.org/D23599
      
      llvm-svn: 279576
      adc0e26b
    • Sanjay Patel's avatar
      [InstCombine] move foldICmpShrConstConst() contents to foldICmpShrConst(); NFCI · dcac0dfc
      Sanjay Patel authored
      There will only be 3 lines of code in foldICmpShrConst() when the cleanup is done,
      so it doesn't make much sense to have a separate function for a single fold.
      
      llvm-svn: 279575
      dcac0dfc
    • Philip Reames's avatar
      [stackmaps] Extract out magic constants [NFCI] · 570dd009
      Philip Reames authored
      This is a first step towards clarifying the exact MI semantics of stackmap's "live values".  
      
      llvm-svn: 279574
      570dd009