Skip to content
  1. Jun 19, 2015
  2. Jun 18, 2015
  3. Jun 17, 2015
    • David Majnemer's avatar
      Move the personality function from LandingPadInst to Function · 7fddeccb
      David Majnemer authored
      The personality routine currently lives in the LandingPadInst.
      
      This isn't desirable because:
      - All LandingPadInsts in the same function must have the same
        personality routine.  This means that each LandingPadInst beyond the
        first has an operand which produces no additional information.
      
      - There is ongoing work to introduce EH IR constructs other than
        LandingPadInst.  Moving the personality routine off of any one
        particular Instruction and onto the parent function seems a lot better
        than have N different places a personality function can sneak onto an
        exceptional function.
      
      Differential Revision: http://reviews.llvm.org/D10429
      
      llvm-svn: 239940
      7fddeccb
    • Tyler Nowicki's avatar
      Refactor RecurrenceInstDesc · 27b2c39e
      Tyler Nowicki authored
      Moved RecurrenceInstDesc into RecurrenceDescriptor to simplify the namespaces.
      
      llvm-svn: 239862
      27b2c39e
  4. Jun 16, 2015
  5. Jun 11, 2015
    • Alexey Samsonov's avatar
      [LoopUnroll] Use IRBuilder to create branch instructions. · ea20199b
      Alexey Samsonov authored
      Use IRBuilder::Create(Cond)?Br instead of constructing instructions
      manually with BranchInst::Create(). It's consistent with other
      uses of IRBuilder in this pass, and has an additional important
      benefit:
      
      Using IRBuilder will ensure that new branch instruction will get
      the same debug location as original terminator instruction it will
      eventually replace.
      
      For now I'm not adding a testcase, as currently original terminator
      instruction also lack debug location due to missing debug location
      propagation in BasicBlock::splitBasicBlock. That is, the testcase
      will accompany the fix for the latter I'm going to mail soon.
      
      llvm-svn: 239550
      ea20199b
  6. Jun 10, 2015
  7. Jun 05, 2015
  8. Jun 01, 2015
  9. 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
  10. May 23, 2015
    • Philip Reames's avatar
      Extend EarlyCSE to handle basic cases from JumpThreading and CVP · 7c78ef7d
      Philip Reames authored
      This patch extends EarlyCSE to take advantage of the information that a controlling branch gives us about the value of a Value within this and dominated basic blocks. If the current block has a single predecessor with a controlling branch, we can infer what the branch condition must have been to execute this block. The actual change to support this is downright simple because EarlyCSE's existing scoped hash table logic deals with most of the complexity around merging.
      
      The patch actually implements two optimizations.
      1) The first is analogous to JumpThreading in that it enables EarlyCSE's CSE handling to fold branches which are exactly redundant due to a previous branch to branches on constants. (It doesn't actually replace the branch or change the CFG.) This is pretty clearly a win since it enables substantial CFG simplification before we start trying to inline.
      2) The second is analogous to CVP in that it exploits the knowledge gained to replace dominated *uses* of the original value. EarlyCSE does not otherwise reason about specific uses, so this is the more arguable one. It does enable further simplication and constant folding within the rest of the visit by EarlyCSE.
      
      In both cases, the added code only handles the easy dominance based case of each optimization. The general case is deferred to the existing passes.
      
      Differential Revision: http://reviews.llvm.org/D9763
      
      llvm-svn: 238071
      7c78ef7d
  11. May 20, 2015
  12. May 19, 2015
  13. May 18, 2015
  14. May 13, 2015
    • Pete Cooper's avatar
      Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&. · 41e0ee30
      Pete Cooper authored
      The array passed to LoadAndStorePromoter's constructor was a constant reference to a SmallVectorImpl, which is just the same as passing an ArrayRef.
      
      Also, the data in the array can be 'const Instruction*' instead of 'Instruction*'.  Its not possible to convert a SmallVectorImpl<T*> to SmallVectorImpl<const T*>, but ArrayRef does provide such a method.
      
      Currently this added calls to makeArrayRef which should be a nop, but i'm going to kick off a discussion about improving ArrayRef to not need these.
      
      llvm-svn: 237226
      41e0ee30
  15. May 12, 2015
  16. May 06, 2015
  17. May 05, 2015
  18. Apr 30, 2015
  19. Apr 29, 2015
    • David Blaikie's avatar
      [opaque pointer type] Pass GlobalAlias the actual pointer type rather than... · f64246be
      David Blaikie authored
      [opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space
      
      Many of the callers already have the pointer type anyway, and for the
      couple of callers that don't it's pretty easy to call PointerType::get
      on the pointee type and address space.
      
      This avoids LLParser from using PointerType::getElementType when parsing
      GlobalAliases from IR.
      
      llvm-svn: 236160
      f64246be
    • Duncan P. N. Exon Smith's avatar
      IR: Give 'DI' prefix to debug info metadata · a9308c49
      Duncan P. N. Exon Smith authored
      Finish off PR23080 by renaming the debug info IR constructs from `MD*`
      to `DI*`.  The last of the `DIDescriptor` classes were deleted in
      r235356, and the last of the related typedefs removed in r235413, so
      this has all baked for about a week.
      
      Note: If you have out-of-tree code (like a frontend), I recommend that
      you get everything compiling and tests passing with the *previous*
      commit before updating to this one.  It'll be easier to keep track of
      what code is using the `DIDescriptor` hierarchy and what you've already
      updated, and I think you're extremely unlikely to insert bugs.  YMMV of
      course.
      
      Back to *this* commit: I did this using the rename-md-di-nodes.sh
      upgrade script I've attached to PR23080 (both code and testcases) and
      filtered through clang-format-diff.py.  I edited the tests for
      test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
      were off-by-three.  It should work on your out-of-tree testcases (and
      code, if you've followed the advice in the previous paragraph).
      
      Some of the tests are in badly named files now (e.g.,
      test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
      'dicompositetype'); I'll come back and move the files in a follow-up
      commit.
      
      llvm-svn: 236120
      a9308c49
  20. Apr 24, 2015
  21. Apr 23, 2015
    • David Blaikie's avatar
      Recommit r235458: [opaque pointer type] Avoid using... · 348de69a
      David Blaikie authored
      Recommit r235458: [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst
      
      (reverted in r235533)
      
      Original commit message:
      
      "Calls to llvm::Value::mutateType are becoming extra-sensitive now that
      instructions have extra type information that will not be derived from
      operands or result type (alloca, gep, load, call/invoke, etc... ). The
      special-handling for mutateType will get more complicated as this work
      continues - it might be worth making mutateType virtual & pushing the
      complexity down into the classes that need special handling. But with
      only two significant uses of mutateType (vectorization and linking) this
      seems OK for now.
      
      Totally open to ideas/suggestions/improvements, of course.
      
      With this, and a bunch of exceptions, we can roundtrip an indirect call
      site through bitcode and IR. (a direct call site is actually trickier...
      I haven't figured out how to deal with the IR deserializer's lazy
      construction of Function/GlobalVariable decl's based on the type of the
      entity which means looking through the "pointer to T" type referring to
      the global)"
      
      The remapping done in ValueMapper for LTO was insufficient as the types
      weren't correctly mapped (though I was using the post-mapped operands,
      some of those operands might not have been mapped yet so the type
      wouldn't be post-mapped yet). Instead use the pre-mapped type and
      explicitly map all the types.
      
      llvm-svn: 235651
      348de69a
    • Karthik Bhat's avatar
      Move common loop utility function isInductionPHI into LoopUtils.cpp · 24e6cc2d
      Karthik Bhat authored
      This patch refactors the definition of common utility function "isInductionPHI" to LoopUtils.cpp.
      This fixes compilation error when configured with -DBUILD_SHARED_LIBS=ON
      
      llvm-svn: 235577
      24e6cc2d
  22. Apr 22, 2015
    • David Blaikie's avatar
      Revert "[opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst" · d2db881e
      David Blaikie authored
      This reverts commit r235458.
      
      It looks like this might be breaking something LTO-ish. Looking into it
      & will recommit with a fix/test case/etc once I've got more to go on.
      
      llvm-svn: 235533
      d2db881e
    • David Blaikie's avatar
      [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst · 50699363
      David Blaikie authored
      Calls to llvm::Value::mutateType are becoming extra-sensitive now that
      instructions have extra type information that will not be derived from
      operands or result type (alloca, gep, load, call/invoke, etc... ). The
      special-handling for mutateType will get more complicated as this work
      continues - it might be worth making mutateType virtual & pushing the
      complexity down into the classes that need special handling. But with
      only two significant uses of mutateType (vectorization and linking) this
      seems OK for now.
      
      Totally open to ideas/suggestions/improvements, of course.
      
      With this, and a bunch of exceptions, we can roundtrip an indirect call
      site through bitcode and IR. (a direct call site is actually trickier...
      I haven't figured out how to deal with the IR deserializer's lazy
      construction of Function/GlobalVariable decl's based on the type of the
      entity which means looking through the "pointer to T" type referring to
      the global)
      
      llvm-svn: 235458
      50699363
  23. Apr 21, 2015
  24. Apr 20, 2015
  25. Apr 16, 2015
    • Aaron Ballman's avatar
      Silencing a -Wunused-but-set-variable warning; NFC. · a2f9943c
      Aaron Ballman authored
      llvm-svn: 235094
      a2f9943c
    • Duncan P. N. Exon Smith's avatar
      DebugInfo: Gut DIScope, DIEnumerator and DISubrange · b273d06b
      Duncan P. N. Exon Smith authored
      The only class the still has API left is `DIDescriptor` itself.
      
      llvm-svn: 235067
      b273d06b
    • Duncan P. N. Exon Smith's avatar
      DebugInfo: Gut DICompileUnit and DIFile · 35ef22cf
      Duncan P. N. Exon Smith authored
      Continuing gutting `DIDescriptor` subclasses; this edition,
      `DICompileUnit` and `DIFile`.  In the name of PR23080.
      
      llvm-svn: 235055
      35ef22cf
    • Duncan P. N. Exon Smith's avatar
      DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable · 62e0f454
      Duncan P. N. Exon Smith authored
      Remove 'inlinedAt:' from MDLocalVariable.  Besides saving some memory
      (variables with it seem to be single largest `Metadata` contributer to
      memory usage right now in -g -flto builds), this stops optimization and
      backend passes from having to change local variables.
      
      The 'inlinedAt:' field was used by the backend in two ways:
      
       1. To tell the backend whether and into what a variable was inlined.
       2. To create a unique id for each inlined variable.
      
      Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg`
      attachment, and change the DWARF backend to use a typedef called
      `InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`.
      This `DebugLoc` is already passed reliably through the backend (as
      verified by r234021).
      
      This commit removes the check from r234021, but I added a new check
      (that will survive) in r235048, and changed the `DIBuilder` API in
      r235041 to require a `!dbg` attachment whose 'scope:` is in the same
      `MDSubprogram` as the variable's.
      
      If this breaks your out-of-tree testcases, perhaps the script I used
      (mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778
      in a moment.
      
      llvm-svn: 235050
      62e0f454
  26. Apr 15, 2015
    • Duncan P. N. Exon Smith's avatar
      DebugInfo: Require a DebugLoc in DIBuilder::insertDeclare() · cd1aecfe
      Duncan P. N. Exon Smith authored
      Change `DIBuilder::insertDeclare()` and `insertDbgValueIntrinsic()` to
      take an `MDLocation*`/`DebugLoc` parameter which it attaches to the
      created intrinsic.  Assert at creation time that the `scope:` field's
      subprogram matches the variable's.  There's a matching `clang` commit to
      use the API.
      
      The context for this is PR22778, which is removing the `inlinedAt:`
      field from `MDLocalVariable`, instead deferring to the `!dbg` location
      attached to the debug info intrinsic.  The best way to ensure we always
      have a `!dbg` attachment is to require one at creation time.  I'll be
      adding verifier checks next, but this API change is the best way to
      shake out frontend bugs.
      
      Note: I added an `llvm_unreachable()` in `bindings/go` and passed in
      `nullptr` for the `DebugLoc`.  The `llgo` folks will eventually need to
      pass a valid `DebugLoc` here.
      
      llvm-svn: 235041
      cd1aecfe
  27. Apr 14, 2015
Loading