Skip to content
  1. Feb 11, 2019
    • Sam Parker's avatar
      [NFC][ARM] Simplify loop-indexing codegen test · 3fbacd49
      Sam Parker authored
      Remove unnecessary offset checks, CHECK-BASE checks and add some
      extra -NOT checks and TODO comments.
      
      llvm-svn: 353689
      3fbacd49
    • Sjoerd Meijer's avatar
      [ARM] LoadStoreOptimizer: reoder limit · 150ccb88
      Sjoerd Meijer authored
      The whole design of generating LDMs/STMs is fragile and unreliable: it depends on
      rescheduling here in the LoadStoreOptimizer that isn't register pressure aware
      and regalloc that isn't aware of generating LDMs/STMs.
      This patch adds a (hidden) option to control the total number of instructions that
      can be re-ordered. I appreciate this looks only a tiny bit better than a hard-coded
      constant, but at least it allows more easy experimentation with different values
      for now. Ideally we calculate this reorder limit based on some heuristics, and take
      register pressure into account. I might be looking into that next.
      
      Differential Revision: https://reviews.llvm.org/D57954
      
      llvm-svn: 353678
      150ccb88
  2. Feb 08, 2019
  3. Feb 07, 2019
    • Sam Parker's avatar
      [LSR] Generate cross iteration indexes · 67756c09
      Sam Parker authored
          
      Modify GenerateConstantOffsetsImpl to create offsets that can be used
      by indexed addressing modes. If formulae can be generated which
      result in the constant offset being the same size as the recurrence,
      we can generate a pre-indexed access. This allows the pointer to be
      updated via the single pre-indexed access so that (hopefully) no
      add/subs are required to update it for the next iteration. For small
      cores, this can significantly improve performance DSP-like loops.
      
      Differential Revision: https://reviews.llvm.org/D55373
      
      llvm-svn: 353403
      67756c09
    • Diana Picus's avatar
      [ARM GlobalISel] Support G_ICMP for Thumb2 · 75a04e2a
      Diana Picus authored
      Mark as legal and use the t2* equivalents of the arm mode instructions,
      e.g. t2CMPrr instead of plain CMPrr.
      
      llvm-svn: 353392
      75a04e2a
  4. Feb 05, 2019
  5. Feb 01, 2019
    • Oliver Stannard's avatar
      [CodeGen] Don't scavenge non-saved regs in exception throwing functions · bac11518
      Oliver Stannard authored
      Previously, LiveRegUnits was assuming that if a block has no successors
      and does not return, then no registers are live at the end of it
      (because the end of the block is unreachable). This was causing the
      register scavenger to use callee-saved registers to materialise stack
      frame addresses without saving them in the prologue. This would normally
      be fine, because the end of the block is unreachable, but this is not
      legal if the block ends by throwing a C++ exception. If this happens,
      the scratch register will be modified, but its previous value won't be
      preserved, so it doesn't get restored by the exception unwinder.
      
      Differential revision: https://reviews.llvm.org/D57381
      
      llvm-svn: 352844
      bac11518
  6. Jan 31, 2019
    • Sjoerd Meijer's avatar
      [ARM] Thumb2: ConstantMaterializationCost · f222259c
      Sjoerd Meijer authored
      Constants can also be materialised using the negated value and a MVN, and this
      case seem to have been missed for Thumb2. To check the constant materialisation
      costs, we now call getT2SOImmVal twice, once for the original constant and then
      also for its negated value, and this function checks if the constant can both
      be splatted or rotated.
      
      This was revealed by a test that optimises for minsize: instead of a LDR
      literal pool load and having a literal pool entry, just a MVN with an immediate
      is smaller (and also faster).
      
      Differential Revision: https://reviews.llvm.org/D57327
      
      llvm-svn: 352737
      f222259c
    • Sjoerd Meijer's avatar
      [SelectionDAG] Codesize: don't expand SHIFT to SHIFT_PARTS · f7cc34ca
      Sjoerd Meijer authored
      And instead just generate a libcall. My motivating example on ARM was a simple:
        
        shl i64 %A, %B
      
      for which the code bloat is quite significant. For other targets that also
      accept __int128/i128 such as AArch64 and X86, it is also beneficial for these
      cases to generate a libcall when optimising for minsize. On these 64-bit targets,
      the 64-bits shifts are of course unaffected because the SHIFT/SHIFT_PARTS
      lowering operation action is not set to custom/expand.
      
      Differential Revision: https://reviews.llvm.org/D57386
      
      llvm-svn: 352736
      f7cc34ca
    • Matt Arsenault's avatar
      GlobalISel: Fix creating MMOs with align 0 · 2a64598e
      Matt Arsenault authored
      llvm-svn: 352712
      2a64598e
    • Matt Arsenault's avatar
      MIR: Reject non-power-of-4 alignments in MMO parsing · 547a83b4
      Matt Arsenault authored
      llvm-svn: 352686
      547a83b4
  7. Jan 29, 2019
  8. Jan 28, 2019
  9. Jan 25, 2019
    • Diana Picus's avatar
      [ARM GlobalISel] Support shifts for Thumb2 · 8976ad12
      Diana Picus authored
      Same as ARM.
      
      On this occasion we split some of the instruction select tests for more
      complicated instructions into their own files, so we can reuse them for
      ARM and Thumb mode. Likewise for the legalizer tests.
      
      llvm-svn: 352188
      8976ad12
    • Aditya Nandakumar's avatar
      [GISel]: Change how CSE is enabled by default for each pass · 3ba0d94b
      Aditya Nandakumar authored
      https://reviews.llvm.org/D57178
      
      Now add a hook in TargetPassConfig to query if CSE needs to be
      enabled. By default this hook returns false only for O0 opt level but
      this can be overridden by the target.
      As a consequence of the default of enabled for non O0, a few tests
      needed to be updated to not use CSE (by passing in -O0) to the run
      line.
      
      reviewed by: arsenm
      
      llvm-svn: 352126
      3ba0d94b
  10. Jan 23, 2019
    • Sam Parker's avatar
      [ARM][CGP] Check trunc type before replacing · 31bef63b
      Sam Parker authored
      In the last stage of type promotion, we replace any zext that uses a
      new trunc with the operand of the trunc. This is okay when we only
      allowed one type to be optimised, but now its the case that the trunc
      maybe needed to produce a more narrow type than the one we were
      optimising for. So we need to check this before doing the replacement.
      
      Differential Revision: https://reviews.llvm.org/D57041
      
      llvm-svn: 351935
      31bef63b
    • Sam Parker's avatar
      [DAGCombine] Enable more pre-indexed stores · 9a2a89d5
      Sam Parker authored
          
      The current check in CombineToPreIndexedLoadStore is too
      conversative, preventing a pre-indexed store when the base pointer
      is a predecessor of the value being stored. Instead, we should check
      the pointer operand of the store.
      
      Differential Revision: https://reviews.llvm.org/D56719
      
      llvm-svn: 351933
      9a2a89d5
  11. Jan 17, 2019
    • Diana Picus's avatar
      [ARM GlobalISel] Allow calls to varargs functions · d5c2499a
      Diana Picus authored
      Allow varargs functions to be called, both in arm and thumb mode. This
      boils down to choosing the correct calling convention, which we can
      easily test by making sure arm_aapcscc is used instead of
      arm_aapcs_vfpcc when the callee is variadic.
      
      llvm-svn: 351424
      d5c2499a
  12. Jan 16, 2019
    • Sam Parker's avatar
      [DAGCombine] Fix ReduceLoadWidth for shifted offsets · dd8cd6d2
      Sam Parker authored
      ReduceLoadWidth can trigger using a shifted mask is used and this
      requires that the function return a shl node to correct for the
      offset. However, the way that this was implemented meant that the
      returned result could be an existing node, which would be incorrect.
      This fixes the method of inserting the new node and replacing uses.
      
      Differential Revision: https://reviews.llvm.org/D50432
      
      llvm-svn: 351310
      dd8cd6d2
  13. Jan 15, 2019
  14. Jan 14, 2019
    • Diana Picus's avatar
      [ARM GlobalISel] Import MOVi32imm into GlobalISel · 8987d006
      Diana Picus authored
      Make it possible for TableGen to produce code for selecting MOVi32imm.
      This allows reasonably recent ARM targets to select a lot more constants
      than before.
      
      We achieve this by adding GISelPredicateCode to arm_i32imm. It's
      impossible to use the exact same code for both DAGISel and GlobalISel,
      since one uses "Subtarget->" and the other "STI." to refer to the
      subtarget. Moreover, in GlobalISel we don't have ready access to the
      MachineFunction, so we need to add a bit of code for obtaining it from
      the instruction that we're selecting. This is also the reason why it
      needs to remain a PatLeaf instead of the more specific IntImmLeaf.
      
      llvm-svn: 351056
      8987d006
    • Francis Visoiu Mistrih's avatar
      Replace "no-frame-pointer-*" function attributes with "frame-pointer" · b7cef81f
      Francis Visoiu Mistrih authored
      Part of the effort to refactoring frame pointer code generation. We used
      to use two function attributes "no-frame-pointer-elim" and
      "no-frame-pointer-elim-non-leaf" to represent three kinds of frame
      pointer usage: (all) frames use frame pointer, (non-leaf) frames use
      frame pointer, (none) frame use frame pointer. This CL makes the idea
      explicit by using only one enum function attribute "frame-pointer"
      
      Option "-frame-pointer=" replaces "-disable-fp-elim" for tools such as
      llc.
      
      "no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" are still
      supported for easy migration to "frame-pointer".
      
      tests are mostly updated with
      
      // replace command line args ‘-disable-fp-elim=false’ with ‘-frame-pointer=none’
      grep -iIrnl '\-disable-fp-elim=false' * | xargs sed -i '' -e "s/-disable-fp-elim=false/-frame-pointer=none/g"
      
      // replace command line args ‘-disable-fp-elim’ with ‘-frame-pointer=all’
      grep -iIrnl '\-disable-fp-elim' * | xargs sed -i '' -e "s/-disable-fp-elim/-frame-pointer=all/g"
      
      Patch by Yuanfang Chen (tabloid.adroit)!
      
      Differential Revision: https://reviews.llvm.org/D56351
      
      llvm-svn: 351049
      b7cef81f
  15. Jan 11, 2019
  16. Jan 08, 2019
    • Sam Parker's avatar
      [ARM] Add missing patterns for DSP muls · 53000a74
      Sam Parker authored
      Using a PatLeaf for sext_16_node allowed matching smulbb and smlabb
      instructions once the operands had been sign extended. But we also
      need to use sext_inreg operands along with sext_16_node to catch a
      few more cases that enable use to remove the unnecessary sxth.
      
      Differential Revision: https://reviews.llvm.org/D55992
      
      llvm-svn: 350613
      53000a74
  17. Jan 07, 2019
  18. Dec 21, 2018
  19. Dec 19, 2018
    • Diana Picus's avatar
      [ARM GlobalISel] Support G_CONSTANT for Thumb2 · 6c35a1e5
      Diana Picus authored
      All we have to do is mark it as legal.
      
      This allows us to select a lot of new patterns handled by TableGen. This
      patch adds tests for them and splits up the existing test file for
      binary operators into 2 files, one for arithmetic ops and one for
      logical ones.
      
      llvm-svn: 349610
      6c35a1e5
  20. Dec 17, 2018
  21. Dec 16, 2018
    • Sanjay Patel's avatar
      [DAGCombiner] allow hoisting vector bitwise logic ahead of truncates · f24900b9
      Sanjay Patel authored
      The transform performs a bitwise logic op in a wider type followed by
      truncate when both inputs are truncated from the same source type:
      logic_op (truncate x), (truncate y) --> truncate (logic_op x, y)
      
      There are a bunch of other checks that should prevent doing this when 
      it might be harmful.
      
      We already do this transform for scalars in this spot. The vector 
      limitation was shared with a check for the case when the operands are 
      extended. I'm not sure if that limit is needed either, but that would 
      be a separate patch.
      
      Differential Revision: https://reviews.llvm.org/D55448
      
      llvm-svn: 349303
      f24900b9
  22. Dec 14, 2018
  23. Dec 13, 2018
    • Diana Picus's avatar
      [ARM GlobalISel] Support exts and truncs for Thumb2 · 99cd644b
      Diana Picus authored
      Mark G_SEXT, G_ZEXT and G_ANYEXT to 32 bits as legal and add support for
      them in the instruction selector. This uses handwritten code again
      because the patterns that are generated with TableGen are tuned for what
      the DAG combiner would produce and not for simple sext/zext nodes.
      Luckily, we only need to update the opcodes to use the Thumb2 variants,
      everything else can be reused from ARM.
      
      llvm-svn: 349026
      99cd644b
    • Clement Courbet's avatar
      [CodeGen] Allow mempcy/memset to generate small overlapping stores. · 76f4ae10
      Clement Courbet authored
      Summary:
      All targets either just return false here or properly model `Fast`, so I
      don't think there is any reason to prevent CodeGen from doing the right
      thing here.
      
      Subscribers: nemanjai, javed.absar, eraman, jsji, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D55365
      
      llvm-svn: 349016
      76f4ae10
  24. Dec 12, 2018
    • Diana Picus's avatar
      [ARM GlobalISel] Select load/store for Thumb2 · 59720b42
      Diana Picus authored
      Unfortunately we can't use TableGen for this because it doesn't yet
      support predicates on the source pattern root. Therefore, add a bit of
      handwritten code to the instruction selector to handle the most basic
      cases.
      
      Also mark them as legal and extract their legalizer test cases to a new
      test file.
      
      llvm-svn: 348920
      59720b42
  25. Dec 10, 2018
Loading