Skip to content
  1. Feb 15, 2017
  2. Feb 14, 2017
    • Easwaran Raman's avatar
      Fix a bug in caller's BFI update code after inlining. · 5a12f236
      Easwaran Raman authored
      Multiple blocks in the callee can be mapped to a single cloned block
      since we prune the callee as we clone it. The existing code
      iterates over the value map and clones the block frequency (and
      eventually scales the frequencies of the cloned blocks). Value map's
      iteration is not deterministic and so the cloned block might get the
      frequency of any of the original blocks. The fix is to set the max of
      the original frequencies to the cloned block. The first block in the
      sequence must have this max frequency and, in the call context,
      subsequent blocks must have its frequency.
      
      Differential Revision: https://reviews.llvm.org/D29696
      
      llvm-svn: 295115
      5a12f236
    • Kostya Serebryany's avatar
      Use "%zd" format specifier for printing number of testcases executed. · ae579a79
      Kostya Serebryany authored
      Summary:
      This helps to avoid signed integer overflow after running a fast fuzz target for several hours, e.g.:
      
      <...>
      Done -1097903291 runs in 54001 second(s)
      
      
      
      Reviewers: kcc
      
      Reviewed By: kcc
      
      Differential Revision: https://reviews.llvm.org/D29941
      
      llvm-svn: 295112
      ae579a79
    • Michael Kuperstein's avatar
      [LV] Rename Induction to PrimaryInduction. NFC. · 569162fe
      Michael Kuperstein authored
      llvm-svn: 295111
      569162fe
    • Peter Collingbourne's avatar
      WholeProgramDevirt: Change internal vcall data structures to match summary. · 534c0175
      Peter Collingbourne authored
      Group calls into constant and non-constant arguments up front, and use uint64_t
      instead of ConstantInt to represent constant arguments. The goal is to allow
      the information from the summary to fit naturally into this data structure in
      a future change (specifically, it will be added to CallSiteInfo).
      
      This has two side effects:
      - We disallow VCP for constant integer arguments of width >64 bits.
      - We remove the restriction that the bitwidth of a vcall's argument and return
        types must match those of the vfunc definitions.
      I don't expect either of these to matter in practice. The first case is
      uncommon, and the second one will lead to UB (so we can do anything we like).
      
      Differential Revision: https://reviews.llvm.org/D29744
      
      llvm-svn: 295110
      534c0175
    • Simon Dardis's avatar
      [mips] Correct mips16 return instructions definitions · 454f2e78
      Simon Dardis authored
      Correct the definition of MIPS16 instructions that act as return instructions
      so that isReturn = 1 as expected.
      
      llvm-svn: 295109
      454f2e78
    • Taewook Oh's avatar
      [BasicBlockUtils] Use getFirstNonPHIOrDbg to set debugloc for instructions... · 2e945ebb
      Taewook Oh authored
      [BasicBlockUtils] Use getFirstNonPHIOrDbg to set debugloc for instructions created in SplitBlockPredecessors
      
      Summary:
      When setting debugloc for instructions created in SplitBlockPredecessors, current implementation copies debugloc from the first-non-phi instruction of the original basic block. However, if the first-non-phi instruction is a call for @llvm.dbg.value, the debugloc of the instruction may point the location outside of the block itself. For the example code of
      
      ```
        1 typedef struct _node_t {
        2   struct _node_t *next;
        3 } node_t;
        4
        5 extern node_t *root;
        6
        7 int foo() {
        8   node_t *node, *tmp;
        9   int ret = 0;
       10
       11   node = tmp = root->next;
       12   while (node != root) {
       13     while (node) {
       14       tmp = node;
       15       node = node->next;
       16       ret++;
       17     }
       18   }
       19
       20   return ret;
       21 }
      ```
      
      , below is the basicblock corresponding to line 12 after Reassociate expressions pass:
      
      ```
      while.cond:                                       ; preds = %while.cond2, %entry
        %node.0 = phi %struct._node_t* [ %1, %entry ], [ null, %while.cond2 ]
        %ret.0 = phi i32 [ 0, %entry ], [ %ret.1, %while.cond2 ]
        tail call void @llvm.dbg.value(metadata i32 %ret.0, i64 0, metadata !19, metadata !20), !dbg !21
        tail call void @llvm.dbg.value(metadata %struct._node_t* %node.0, i64 0, metadata !11, metadata !20), !dbg !31
        %cmp = icmp eq %struct._node_t* %node.0, %0, !dbg !33
        br i1 %cmp, label %while.end5, label %while.cond2, !dbg !35
      ```
      
      As you can see, the first-non-phi instruction is a call for @llvm.dbg.value, and the debugloc is
      
      ```
      !21 = !DILocation(line: 9, column: 7, scope: !6)
      ```
      
      , which is a definition of 'ret' variable and outside of the scope of the basicblock itself. However, current implementation picks up this debugloc for the instructions created in SplitBlockPredecessors. This patch addresses this problem by picking up debugloc from the first-non-phi-non-dbg instruction.
      
      Reviewers: dblaikie, samsonov, eugenis
      
      Reviewed By: eugenis
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D29867
      
      llvm-svn: 295106
      2e945ebb
    • Reid Kleckner's avatar
      [BranchFolding] Tail common all identical unreachable blocks · a622fc9b
      Reid Kleckner authored
      Summary:
      Blocks ending in unreachable are typically cold because they end the
      program or throw an exception, so merging them with other identical
      blocks is usually profitable because it reduces the size of cold code.
      MachineBlockPlacement generally does not arrange to fall through to such
      blocks, so commoning these blocks will not introduce additional
      unconditional branches.
      
      Reviewers: hans, iteratee, haicheng
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D29153
      
      llvm-svn: 295105
      a622fc9b
    • Tim Northover's avatar
      GlobalISel: deal with new G_PTR_MASK instruction on AArch64. · 398c5f57
      Tim Northover authored
      It's just an AND-immediate instruction for us, surprisingly simple to select.
      
      llvm-svn: 295104
      398c5f57
    • Tim Northover's avatar
      GlobalISel: introduce G_PTR_MASK to simplify alloca handling. · c2f89563
      Tim Northover authored
      This instruction clears the low bits of a pointer without requiring (possibly
      dodgy if pointers aren't ints) conversions to and from an integer. Since (as
      far as I'm aware) all masks are statically known, the instruction takes an
      immediate operand rather than a register to specify the mask.
      
      llvm-svn: 295103
      c2f89563
    • Vedant Kumar's avatar
      Re-apply "[profiling] Remove dead profile name vars after emitting name data" · 55891fc7
      Vedant Kumar authored
      This reverts 295092 (re-applies 295084), with a fix for dangling
      references from the array of coverage names passed down from frontends.
      
      I missed this in my initial testing because I only checked test/Profile,
      and not test/CoverageMapping as well.
      
      Original commit message:
      
      The profile name variables passed to counter increment intrinsics are dead
      after we emit the finalized name data in __llvm_prf_nm. However, we neglect to
      erase these name variables. This causes huge size increases in the
      __TEXT,__const section as well as slowdowns when linker dead stripping is
      disabled. Some affected projects are so massive that they fail to link on
      Darwin, because only the small code model is supported.
      
      Fix the issue by throwing away the name constants as soon as we're done with
      them.
      
      Differential Revision: https://reviews.llvm.org/D29921
      
      llvm-svn: 295099
      55891fc7
    • Eric Christopher's avatar
      Reformat slightly. · 14303d18
      Eric Christopher authored
      llvm-svn: 295096
      14303d18
    • Wolfgang Pieb's avatar
      Reapply r294532, reverted in r294787. · 399dcfaa
      Wolfgang Pieb authored
      Store instructions can have more than one memory operand as a result
      of optimizations that fold different stores into one.
      When we identify spill instructions to generate DBG_VALUE instructions
      to record the spilling of a variable, we disregard stores with 
      multiple memory operands for now. We may miss some relevant spills but
      the handling is a bit more complex, so we'll do it in a different patch.
      
      This fixes PR31935.
      
      llvm-svn: 295093
      399dcfaa
    • Vedant Kumar's avatar
      Revert "[profiling] Remove dead profile name vars after emitting name data" · 27ebdf4b
      Vedant Kumar authored
      This reverts commit r295084. There is a test failure on:
      
      http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/2620/
      
      llvm-svn: 295092
      27ebdf4b
Loading