Skip to content
  1. Nov 08, 2013
  2. Nov 05, 2013
    • Andrew Trick's avatar
      Slightly change the way stackmap and patchpoint intrinsics are lowered. · 6664df12
      Andrew Trick authored
      MorphNodeTo is not safe to call during DAG building. It eagerly
      deletes dependent DAG nodes which invalidates the NodeMap. We could
      expose a safe interface for morphing nodes, but I don't think it's
      worth it. Just create a new MachineNode and replaceAllUsesWith.
      
      My understaning of the SD design has been that we want to support
      early target opcode selection. That isn't very well supported, but
      generally works. It seems reasonable to rely on this feature even if
      it isn't widely used.
      
      llvm-svn: 194102
      6664df12
  3. Nov 02, 2013
  4. Nov 01, 2013
  5. Oct 31, 2013
    • Andrew Trick's avatar
      Unused variable · c21d86f7
      Andrew Trick authored
      llvm-svn: 193819
      c21d86f7
    • Andrew Trick's avatar
      Add support for stack map generation in the X86 backend. · 153ebe6d
      Andrew Trick authored
      Originally implemented by Lang Hames.
      
      llvm-svn: 193811
      153ebe6d
    • Manman Ren's avatar
      Debug Info: remove duplication of DIEs when a DIE can be shared across CUs. · 4dbdc902
      Manman Ren authored
      We add a map in DwarfDebug to map MDNodes that are shareable across CUs to the
      corresponding DIEs: MDTypeNodeToDieMap. These DIEs can be shared across CUs,
      that is why we keep the maps in DwarfDebug instead of CompileUnit.
      
      We make the assumption that if a DIE is not added to an owner yet, we assume
      it belongs to the current CU. Since DIEs for the type system are added to
      their owners immediately after creation, and other DIEs belong to the current
      CU, the assumption should be true.
      
      A testing case is added to show that we only create a single DIE for a type
      MDNode and we use ref_addr to refer to the type DIE.
      
      We also add a testing case to show ref_addr relocations for non-darwin
      platforms.
      
      llvm-svn: 193779
      4dbdc902
    • Andrew Trick's avatar
      74f4c749
    • Andrew Trick's avatar
      whitespace · d4d1d9c0
      Andrew Trick authored
      llvm-svn: 193765
      d4d1d9c0
    • Rafael Espindola's avatar
      Remove the --shrink-wrap option. · dbec9d9b
      Rafael Espindola authored
      It had no tests, was unused and was "experimental at best".
      
      llvm-svn: 193749
      dbec9d9b
    • Jim Grosbach's avatar
      Legalize: Improve legalization of long vector extends. · 72366786
      Jim Grosbach authored
      When an extend more than doubles the size of the elements (e.g., a zext
      from v16i8 to v16i32), the normal legalization method of splitting the
      vectors will run into problems as by the time the destination vector is
      legal, the source vector is illegal. The end result is the operation
      often becoming scalarized, with the typical horrible performance. For
      example, on x86_64, the simple input of:
      define void @bar(<16 x i8> %a, <16 x i32>* %p) nounwind {
        %tmp = zext <16 x i8> %a to <16 x i32>
        store <16 x i32> %tmp, <16 x i32>*%p
        ret void
      }
      
      Generates:
        .section  __TEXT,__text,regular,pure_instructions
        .section  __TEXT,__const
        .align  5
      LCPI0_0:
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .long 255                     ## 0xff
        .section  __TEXT,__text,regular,pure_instructions
        .globl  _bar
        .align  4, 0x90
      _bar:
        vpunpckhbw  %xmm0, %xmm0, %xmm1
        vpunpckhwd  %xmm0, %xmm1, %xmm2
        vpmovzxwd %xmm1, %xmm1
        vinsertf128 $1, %xmm2, %ymm1, %ymm1
        vmovaps LCPI0_0(%rip), %ymm2
        vandps  %ymm2, %ymm1, %ymm1
        vpmovzxbw %xmm0, %xmm3
        vpunpckhwd  %xmm0, %xmm3, %xmm3
        vpmovzxbd %xmm0, %xmm0
        vinsertf128 $1, %xmm3, %ymm0, %ymm0
        vandps  %ymm2, %ymm0, %ymm0
        vmovaps %ymm0, (%rdi)
        vmovaps %ymm1, 32(%rdi)
        vzeroupper
        ret
      
      So instead we can check if there are legal types that enable us to split
      more cleverly when the input vector is already legal such that we don't
      turn it into an illegal type. If the extend is such that it's more than
      doubling the size of the input we check if
        - the number of vector elements is even,
        - the source type is legal,
        - the type of a split source is illegal,
        - the type of an extended (by doubling element size) source is legal, and
        - the type of that extended source when split is legal.
      If the conditions are met, instead of just splitting both the
      destination and the source types, we create an extend that only goes up
      one "step" (doubling the element width), and the continue legalizing the
      rest of the operation normally. The result is that this operates as a
      new, more effecient, termination condition for the loop of "split the
      operation until the destination type is legal."
      
      With this change, the above example now compiles to:
      _bar:
        vpxor %xmm1, %xmm1, %xmm1
        vpunpcklbw  %xmm1, %xmm0, %xmm2
        vpunpckhwd  %xmm1, %xmm2, %xmm3
        vpunpcklwd  %xmm1, %xmm2, %xmm2
        vinsertf128 $1, %xmm3, %ymm2, %ymm2
        vpunpckhbw  %xmm1, %xmm0, %xmm0
        vpunpckhwd  %xmm1, %xmm0, %xmm3
        vpunpcklwd  %xmm1, %xmm0, %xmm0
        vinsertf128 $1, %xmm3, %ymm0, %ymm0
        vmovaps %ymm0, 32(%rdi)
        vmovaps %ymm2, (%rdi)
        vzeroupper
        ret
      
      This generalizes a custom lowering that was added a while back to the
      ARM backend. That lowering is no longer necessary, and is removed. The
      testcases for it, however, provide excellent ARM tests for this change
      and so remain.
      
      rdar://14735100
      
      llvm-svn: 193727
      72366786
    • Matt Arsenault's avatar
      Fix CodeGen for unaligned loads with address spaces · 2ba54c3d
      Matt Arsenault authored
      llvm-svn: 193721
      2ba54c3d
  6. Oct 30, 2013
  7. Oct 29, 2013
    • Manman Ren's avatar
      Debug Info: support for DW_FORM_ref_addr. · ce20d460
      Manman Ren authored
      To support ref_addr, we calculate the section offset of a DIE (i.e. offset
      of a DIE from beginning of the debug info section). The Offset field in DIE
      is currently CU-relative. To calculate the section offset, we add a
      DebugInfoOffset field in CompileUnit to store the offset of a CU from beginning
      of the debug info section. We set the value in DwarfUnits::computeSizeAndOffset
      for each CompileUnit.
      
      A helper function DIE::getCompileUnit is added to return the CU DIE that
      the input DIE belongs to. We also add a map CUDieMap in DwarfDebug to help
      finding the CU for a given CU DIE.
      
      For a cross-referenced DIE, we first find the CU DIE it belongs to with
      getCompileUnit, then we use CUDieMap to get the corresponding CU for the CU DIE.
      Adding the section offset of the CU with the CU-relative offset of a DIE gives
      us the seciton offset of the DIE.
      
      We correctly emit ref_addr with relocation using EmitLabelPlusOffset when
      doesDwarfUseRelocationsAcrossSections is true.
      
      This commit handles the emission of DW_FORM_ref_addr when we have an attribute
      with FORM_ref_addr. A follow-on patch will start using ref_addr when adding a
      DIEEntry. This commit will be tested and verified in the follow-on patch.
      
      Reviewed off-list by Eric, Thanks.
      
      llvm-svn: 193658
      ce20d460
    • Manman Ren's avatar
      Debug Info: instead of calling addToContextOwner which constructs the context · f4c339e0
      Manman Ren authored
      after the DIE creation, we construct the context first.
      
      Ensure that we create the context before we create a type so that we can add
      the newly created type to the parent. Remove last use of addToContextOwner
      now that it's not needed.
      
      We use createAndAddDIE to wrap around "new DIE(". Now all shareable DIEs
      should be added to their parents right after the creation.
      
      Reviewed off-list by Eric, Thanks.
      
      llvm-svn: 193657
      f4c339e0
    • Josh Magee's avatar
      [stackprotector] Update the StackProtector pass to perform datalayout analysis. · 3f1c0e35
      Josh Magee authored
      This modifies the pass to classify every SSP-triggering AllocaInst according to
      an SSPLayoutKind (LargeArray, SmallArray, AddrOf).  This analysis is collected
      by the pass and made available for use, but no other pass uses it yet.
      
      The next patch will make use of this analysis in PEI and StackSlot
      passes.  The end goal is to support ssp-strong stack layout rules.
      
      WIP.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1789
      
      llvm-svn: 193653
      3f1c0e35
    • Rafael Espindola's avatar
      Move getSymbol to TargetLoweringObjectFile. · e133ed88
      Rafael Espindola authored
      This allows constructing a Mangler with just a TargetMachine.
      
      llvm-svn: 193630
      e133ed88
    • Rafael Espindola's avatar
      Add a helper getSymbol to AsmPrinter. · 79858aa3
      Rafael Espindola authored
      llvm-svn: 193627
      79858aa3
    • Manman Ren's avatar
      Debug Info: instead of calling addToContextOwner which constructs the context · f6b936bc
      Manman Ren authored
      after the DIE creation, we construct the context first.
      
      This touches creation of namespaces and global variables. The purpose is to
      handle all DIE creations similarly: constructs the context first, then creates
      the DIE and immediately adds the DIE to its parent.
      
      We use createAndAddDIE to wrap around "new DIE(".
      
      llvm-svn: 193589
      f6b936bc
    • Alp Toker's avatar
      Fix "existant" typos · 6a033745
      Alp Toker authored
      llvm-svn: 193579
      6a033745
    • Manman Ren's avatar
      Debug Info: use createAndAddDIE to wrap around "new DIE" in DwarfDebug. · 4a841a86
      Manman Ren authored
      This commit ensures DIEs are constructed within a compile unit and
      immediately added to their parents.
      
      Reviewed off-list by Eric.
      
      llvm-svn: 193568
      4a841a86
    • Manman Ren's avatar
      Debug Info: use createAndAddDIE for newly-created Subprogram DIEs. · 73d697c6
      Manman Ren authored
      More patches will be submitted to convert "new DIE(" to use createAddAndDIE in
      DwarfCompileUnit.cpp. This will simplify implementation of addDIEEntry where
      we have to decide between ref4 and ref_addr, because DIEs that can be shared
      across CU will be added to a CU already.
      
      Reviewed off-list by Eric.
      
      llvm-svn: 193567
      73d697c6
    • Manman Ren's avatar
      Debug Info: add a helper function createAndAddDIE. · b987e517
      Manman Ren authored
      It wraps around "new DIE(" and handles the bookkeeping part of the newly-created
      DIE. It adds the DIE to its parent, and calls insertDIE if necessary. It makes
      sure that bookkeeping is done at the earliest time and we should not see
      parentless DIEs if all constructions of DIEs go through this helper function.
      
      Later on, we can use an allocator for DIE allocation, and will only need to
      change createAndAddDIE instead of modifying all the "new DIE(".
      
      Reviewed off-list by Eric.
      
      llvm-svn: 193566
      b987e517
  8. Oct 28, 2013
    • Richard Sandiford's avatar
      [DAGCombiner] Respect volatility when checking for aliases · 981fdeb4
      Richard Sandiford authored
      Making useAA() default to true for SystemZ showed that the combiner alias
      analysis wasn't handling volatile accesses.  This hit many of the SystemZ
      tests, but I arbitrarily picked one for the purpose of this patch.
      
      llvm-svn: 193518
      981fdeb4
    • Richard Sandiford's avatar
      Keep TBAA info when rewriting SelectionDAG loads and stores · 39c1ce4d
      Richard Sandiford authored
      Most SelectionDAG code drops the TBAA info when creating a new form of a
      load and store (e.g. during legalization, or when converting a plain
      load to an extending one).  This patch tries to catch all cases where
      the TBAA information can legitimately be carried over.
      
      The patch adds alternative forms of getLoad() and getExtLoad() that take
      a MachineMemOperand instead of individual fields.  (The corresponding
      getTruncStore() already exists.)  The idea is to use the MachineMemOperand
      forms when all fields are carried over (size, pointer info, isVolatile,
      isNonTemporal, alignment and TBAA info).  If some adjustment is being
      made, e.g. to narrow the load, then we still pass the individual fields
      but also pass the TBAA info.
      
      llvm-svn: 193517
      39c1ce4d
  9. Oct 25, 2013
Loading