Skip to content
  1. Jul 19, 2015
  2. Jul 18, 2015
  3. Jul 17, 2015
  4. Jul 16, 2015
    • Peter Collingbourne's avatar
      Internalize: internalize comdat members as a group, and drop comdat on such members. · 9b0fe610
      Peter Collingbourne authored
      Internalizing an individual comdat group member without also internalizing
      the other members of the comdat can break comdat semantics. For example,
      if a module contains a reference to an internalized comdat member, and the
      linker chooses a comdat group from a different object file, this will break
      the reference to the internalized member.
      
      This change causes the internalizer to only internalize comdat members if all
      other members of the comdat are not externally visible. Once a comdat group
      has been fully internalized, there is no need to apply comdat rules to its
      members; later optimization passes (e.g. globaldce) can legally drop individual
      members of the comdat. So we drop the comdat attribute from all comdat members.
      
      Differential Revision: http://reviews.llvm.org/D10679
      
      llvm-svn: 242423
      9b0fe610
    • Tobias Grosser's avatar
      Add PM extension point EP_VectorizerStart · 39a7bd18
      Tobias Grosser authored
      This extension point allows passes to be executed right before the vectorizer
      and other highly target specific optimizations are run.
      
      llvm-svn: 242389
      39a7bd18
  5. Jul 15, 2015
    • JF Bastien's avatar
      Fix mergefunc infinite loop · 7289f73b
      JF Bastien authored
      Self-referential constants containing references to a merged function
      no longer cause the MergeFunctions pass to infinite loop. Also adds a
      reproduction IR which would otherwise fail, which was isolated from a similar
      issue in Chromium.
      
      Author: jrkoenig
      Reviewers: nlewycky, jfb
      Subscribers: llvm-commits, nlewycky, jfb
      
      Differential Revision: http://reviews.llvm.org/D11208
      
      llvm-svn: 242337
      7289f73b
  6. Jul 13, 2015
  7. Jul 11, 2015
    • Chandler Carruth's avatar
      [PM/AA] Completely remove the AliasAnalysis::copyValue interface. · 00ebdbcc
      Chandler Carruth authored
      No in-tree alias analysis used this facility, and it was not called in
      any particularly rigorous way, so it seems unlikely to be correct.
      
      Note that one of the only stateful AA implementations in-tree,
      GlobalsModRef is completely broken currently (and any AA passes like it
      are equally broken) because Module AA passes are not effectively
      invalidated when a function pass that fails to update the AA stack runs.
      
      Ultimately, it doesn't seem like we know how we want to build stateful
      AA, and until then trying to support and maintain correctness for an
      untested API is essentially impossible. To that end, I'm planning to rip
      out all of the update API. It can return if and when we need it and know
      how to build it on top of the new pass manager and as part of *tested*
      stateful AA implementations in the tree.
      
      Differential Revision: http://reviews.llvm.org/D10889
      
      llvm-svn: 241975
      00ebdbcc
  8. Jul 10, 2015
  9. Jul 06, 2015
    • Reid Kleckner's avatar
      [llvm-extract] Drop comdats from declarations · fc0f9383
      Reid Kleckner authored
      The verifier rejects comdats on declarations.
      
      llvm-svn: 241483
      fc0f9383
    • Teresa Johnson's avatar
      Resubmit "Add new EliminateAvailableExternally module pass" (r239480) · d3a33a16
      Teresa Johnson authored
      This change includes a fix for https://code.google.com/p/chromium/issues/detail?id=499508#c3,
      which required updating the visibility for symbols with eliminated definitions.
      
      --Original Commit Message--
      
      Add new EliminateAvailableExternally module pass, which is performed in
      O2 compiles just before GlobalDCE, unless we are preparing for LTO.
      
      This pass eliminates available externally globals (turning them into
      declarations), regardless of whether they are dead/unreferenced, since
      we are guaranteed to have a copy available elsewhere at link time.
      This enables additional opportunities for GlobalDCE.
      
      If we are preparing for LTO (e.g. a -flto -c compile), the pass is not
      included as we want to preserve available externally functions for possible
      link time inlining. The FE indicates whether we are doing an -flto compile
      via the new PrepareForLTO flag on the PassManagerBuilder.
      
      llvm-svn: 241466
      d3a33a16
  10. Jul 05, 2015
    • Peter Collingbourne's avatar
      IR: Do not consider available_externally linkage to be linker-weak. · 6a9d1774
      Peter Collingbourne authored
      From the linker's perspective, an available_externally global is equivalent
      to an external declaration (per isDeclarationForLinker()), so it is incorrect
      to consider it to be a weak definition.
      
      Also clean up some logic in the dead argument elimination pass and clarify
      its comments to better explain how its behavior depends on linkage,
      introduce GlobalValue::isStrongDefinitionForLinker() and start using
      it throughout the optimizers and backend.
      
      Differential Revision: http://reviews.llvm.org/D10941
      
      llvm-svn: 241413
      6a9d1774
  11. Jul 02, 2015
  12. Jun 27, 2015
    • David Majnemer's avatar
      [PruneEH] A naked, noinline function can return via InlineAsm · 5185c3c2
      David Majnemer authored
      The PruneEH pass tries to annotate functions as 'noreturn' if it doesn't
      see a ReturnInst.  However, a naked function containing inline assembly
      can contain control flow leaving the function.
      
      This fixes PR23971.
      
      llvm-svn: 240876
      5185c3c2
    • Peter Collingbourne's avatar
      LowerBitSets: Ignore bitset entries that do not directly refer to a global. · ba4c8b50
      Peter Collingbourne authored
      It is possible for a global to be substituted with another global of a
      different type or a different kind (i.e. an alias) at IR link time. One
      example of this scenario is when a Microsoft ABI vtable is substituted with
      an alias referring to a larger vtable containing an RTTI reference.
      
      This will cause the global to be RAUW'd with a possibly bitcasted reference
      to the other global. This will of course also affect any references to the
      global in bitset metadata.
      
      The right way to handle such metadata is simply to ignore it. This is sound
      because the linked module should contain another copy of the bitset entries as
      applied to the new global.
      
      llvm-svn: 240866
      ba4c8b50
  13. Jun 25, 2015
  14. Jun 23, 2015
  15. Jun 20, 2015
  16. Jun 19, 2015
  17. Jun 17, 2015
  18. Jun 15, 2015
    • Peter Collingbourne's avatar
      Protection against stack-based memory corruption errors using SafeStack · 82437bf7
      Peter Collingbourne authored
      This patch adds the safe stack instrumentation pass to LLVM, which separates
      the program stack into a safe stack, which stores return addresses, register
      spills, and local variables that are statically verified to be accessed
      in a safe way, and the unsafe stack, which stores everything else. Such
      separation makes it much harder for an attacker to corrupt objects on the
      safe stack, including function pointers stored in spilled registers and
      return addresses. You can find more information about the safe stack, as
      well as other parts of or control-flow hijack protection technique in our
      OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf)
      and our project website (http://levee.epfl.ch).
      
      The overhead of our implementation of the safe stack is very close to zero
      (0.01% on the Phoronix benchmarks). This is lower than the overhead of
      stack cookies, which are supported by LLVM and are commonly used today,
      yet the security guarantees of the safe stack are strictly stronger than
      stack cookies. In some cases, the safe stack improves performance due to
      better cache locality.
      
      Our current implementation of the safe stack is stable and robust, we
      used it to recompile multiple projects on Linux including Chromium, and
      we also recompiled the entire FreeBSD user-space system and more than 100
      packages. We ran unit tests on the FreeBSD system and many of the packages
      and observed no errors caused by the safe stack. The safe stack is also fully
      binary compatible with non-instrumented code and can be applied to parts of
      a program selectively.
      
      This patch is our implementation of the safe stack on top of LLVM. The
      patches make the following changes:
      
      - Add the safestack function attribute, similar to the ssp, sspstrong and
        sspreq attributes.
      
      - Add the SafeStack instrumentation pass that applies the safe stack to all
        functions that have the safestack attribute. This pass moves all unsafe local
        variables to the unsafe stack with a separate stack pointer, whereas all
        safe variables remain on the regular stack that is managed by LLVM as usual.
      
      - Invoke the pass as the last stage before code generation (at the same time
        the existing cookie-based stack protector pass is invoked).
      
      - Add unit tests for the safe stack.
      
      Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
      Lab at EPFL; updates and upstreaming by myself.
      
      Differential Revision: http://reviews.llvm.org/D6094
      
      llvm-svn: 239761
      82437bf7
  19. Jun 12, 2015
  20. Jun 10, 2015
    • Peter Collingbourne's avatar
      ArgumentPromotion: Drop sret attribute on functions that are only called directly. · 115fe376
      Peter Collingbourne authored
      If the first argument to a function is a 'this' argument and the second
      has the sret attribute, the ArgumentPromotion pass may promote the 'this'
      argument to more than one argument, violating the IR constraint that 'sret'
      may only be applied to the first or second argument.
      
      Although this IR constraint is arguably unnecessary, it highlighted the fact
      that ArgPromotion does not need to preserve this attribute. Dropping the
      attribute reduces register pressure in the backend by avoiding the register
      copy required by sret. Because sret implies noalias, we also replace the
      former with the latter.
      
      Differential Revision: http://reviews.llvm.org/D10353
      
      llvm-svn: 239488
      115fe376
    • Teresa Johnson's avatar
      Add new EliminateAvailableExternally module pass, which is performed in · 232fa9af
      Teresa Johnson authored
      O2 compiles just before GlobalDCE, unless we are preparing for LTO.
      
      This pass eliminates available externally globals (turning them into
      declarations), regardless of whether they are dead/unreferenced, since
      we are guaranteed to have a copy available elsewhere at link time.
      This enables additional opportunities for GlobalDCE.
      
      If we are preparing for LTO (e.g. a -flto -c compile), the pass is not
      included as we want to preserve available externally functions for possible
      link time inlining. The FE indicates whether we are doing an -flto compile
      via the new PrepareForLTO flag on the PassManagerBuilder.
      
      llvm-svn: 239480
      232fa9af
  21. Jun 09, 2015
  22. Jun 04, 2015
    • Chandler Carruth's avatar
      [PM/AA] Start refactoring AliasAnalysis to remove the analysis group and · 70c61c1a
      Chandler Carruth authored
      port it to the new pass manager.
      
      All this does is extract the inner "location" class used by AA into its
      own full fledged type. This seems *much* cleaner as MemoryDependence and
      soon MemorySSA also use this heavily, and it doesn't make much sense
      being inside the AA infrastructure.
      
      This will also make it much easier to break apart the AA infrastructure
      into something that stands on its own rather than using the analysis
      group design.
      
      There are a few places where this makes APIs not make sense -- they were
      taking an AliasAnalysis pointer just to build locations. I'll try to
      clean those up in follow-up commits.
      
      Differential Revision: http://reviews.llvm.org/D10228
      
      llvm-svn: 239003
      70c61c1a
  23. May 29, 2015
    • Benjamin Kramer's avatar
      Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types · f5e2fc47
      Benjamin Kramer authored
      If the type isn't trivially moveable emplace can skip a potentially
      expensive move. It also saves a couple of characters.
      
      
      Call sites were found with the ASTMatcher + some semi-automated cleanup.
      
      memberCallExpr(
          argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
          on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
          hasArgument(0, bindTemporaryExpr(
                             hasType(recordDecl(hasNonTrivialDestructor())),
                             has(constructExpr()))),
          unless(isInTemplateInstantiation()))
      
      No functional change intended.
      
      llvm-svn: 238602
      f5e2fc47
  24. May 28, 2015
  25. May 25, 2015
Loading