Skip to content
  1. Jun 10, 2016
  2. Jun 09, 2016
    • James Molloy's avatar
      [Thumb] A branch is not part of an IT block · a7dbf987
      James Molloy authored
      ReplaceTailWithBranchTo assumed that if an instruction is predicated, it must be part of an IT block. This is not correct for conditional branches.
      
      No testcase as this was triggered by the reverted patch r272017 - test coverage will occur when that patch is re-reverted and there is no known way to trigger this in the meantime.
      
      llvm-svn: 272258
      a7dbf987
    • James Molloy's avatar
      [Thumb] Select a BIC instead of AND if the immediate can be encoded more optimally negated · feb9f424
      James Molloy authored
      If an immediate is only used in an AND node, it is possible that the immediate can be more optimally materialized when negated. If this is the case, we can negate the immediate and use a BIC instead;
      
        int i(int a) {
          return a & 0xfffffeec;
        }
      
      Used to produce:
          ldr r1, [CONSTPOOL]
          ands r0, r1
        CONSTPOOL: 0xfffffeec
      
      And now produces:
          movs    r1, #255
          adds    r1, #20  ; Less costly immediate generation
          bics    r0, r1
      
      llvm-svn: 272251
      feb9f424
  3. Jun 08, 2016
    • Oliver Stannard's avatar
      [ARM] MSR instructions implicitly set CPSR · b3378e2f
      Oliver Stannard authored
      The MSR instructions can write to the CPSR, but we did not model this
      fact, so we could emit them in the middle of IT blocks, changing the
      condition flags for later instructions in the block.
      
      The tests use two calls to llvm.write_register.i32 because it is valid
      to use these instructions at the end of an IT block, which if conversion
      does do in some cases. With two calls, the first clobbers the flags, so
      a branch has to be used to make the second one conditional.
      
      Differential Revision: http://reviews.llvm.org/D21139
      
      llvm-svn: 272154
      b3378e2f
    • Diana Picus's avatar
      [ARM] Remove redundant check. NFC · 0781d10a
      Diana Picus authored
      isSwift is tested earlier and known to be false when we reach this code.
      
      llvm-svn: 272127
      0781d10a
    • Benjamin Kramer's avatar
      Avoid copies of std::strings and APInt/APFloats where we only read from it · 46e38f36
      Benjamin Kramer authored
      As suggested by clang-tidy's performance-unnecessary-copy-initialization.
      This can easily hit lifetime issues, so I audited every change and ran the
      tests under asan, which came back clean.
      
      llvm-svn: 272126
      46e38f36
  4. Jun 07, 2016
    • Oliver Stannard's avatar
      [ARM] Accept conditional versions of BXNS and BLXNS · 8de5f24d
      Oliver Stannard authored
      These instructions end in "S" but are not flag-setting, so they need including
      in the list of special cases in the assembly parser.
      
      Differential Revision: http://reviews.llvm.org/D21077
      
      llvm-svn: 272015
      8de5f24d
    • James Molloy's avatar
      [Thumb-1] Add optimized constant materialization for integers [256..512) · b101383f
      James Molloy authored
      We can materialize these integers using a MOV; ADDi8 pair.
      
      llvm-svn: 272007
      b101383f
    • James Molloy's avatar
      [ARM] Shrink post-indexed LDR and STR to LDM/STM · 53298a18
      James Molloy authored
      A Thumb-2 post-indexed LDR instruction such as:
      
        ldr.w r0, [r1], #4
      
      Can be rewritten as:
      
        ldm.n r1!, {r0}
      
      LDMs can be more expensive than LDRs on some cores, so this has been enabled only in minsize mode.
      
      llvm-svn: 272002
      53298a18
    • James Molloy's avatar
      [ARM] Transform LDMs into writeback form to save code size · 75afc951
      James Molloy authored
      If we have an LDM that uses only low registers and doesn't write to its base register:
      
        ldm.w r0, {r1, r2, r3}
      
      And that base register is dead after the LDM, then we can convert it to writeback form and use a narrow encoding:
      
        ldm.n r0!, {r1, r2, r3}
      
      Obviously, this introduces a new register write and so can cause WAW hazards, so I've enabled it only in minsize mode. This is a code size trick that ARM Compiler 5 ("armcc") does that we don't.
      
      llvm-svn: 272000
      75afc951
    • Peter Smith's avatar
      [ARM] Incorrect relocation type for Thumb2 B<cond>.w · 353a2286
      Peter Smith authored
      The Thumb2 conditional branch B<cond>.W has a different encoding (T3) 
      to the unconditional branch B.W (T4) as it needs to record <cond>. 
      As the encoding is different the B<cond>.W is given a different 
      relocation type. 
      
      ELF for the ARM Architecture 4.6.1.6 (Table-13) states that 
      R_ARM_THM_JUMP19 should be used for B<cond>.W. At present the 
      MC layer is using the R_ARM_THM_JUMP24 from B.W.
      
      This change makes B<cond>.W use R_ARM_THM_JUMP19 and alters the 
      existing test that checks for R_ARM_THM_JUMP24 to expect 
      R_ARM_THM_JUMP19.
      
      llvm-svn: 271997
      353a2286
    • Saleem Abdulrasool's avatar
      ARM: correct TLS access on WoA · 532dcbc2
      Saleem Abdulrasool authored
      TLS access requires an offset from the TLS index.  The index itself is the
      section-relative distance of the symbol.  For ARM, the relevant relocation
      (IMAGE_REL_ARM_SECREL) is applied as a constant.  This means that the value may
      not be an immediate and must be lowered into a constant pool.  This offset will
      not be base relocated.  We were previously emitting the actual address of the
      symbol which would be base relocated and would therefore be the vaue offset by
      the ImageBase + TLS Offset.
      
      llvm-svn: 271974
      532dcbc2
    • Saleem Abdulrasool's avatar
      ARM: clang-format a couple of switches, add comments · ce4eee49
      Saleem Abdulrasool authored
      clang-format a couple of switches in preparation for a future change.  Add some
      enumeration comments
      
      llvm-svn: 271973
      ce4eee49
    • Saleem Abdulrasool's avatar
      ARM: normalise space in the patterns · 0cd0cb99
      Saleem Abdulrasool authored
      Just adjust the whitespace for the selection patterns.  NFC.
      
      llvm-svn: 271972
      0cd0cb99
  5. Jun 03, 2016
  6. Jun 02, 2016
  7. Jun 01, 2016
  8. May 31, 2016
  9. May 28, 2016
  10. May 27, 2016
  11. May 19, 2016
    • Ranjeet Singh's avatar
      Test commit. · c520e93d
      Ranjeet Singh authored
      llvm-svn: 270056
      c520e93d
    • Rafael Espindola's avatar
      Delete Reloc::Default. · 8c34dd82
      Rafael Espindola authored
      Having an enum member named Default is quite confusing: Is it distinct
      from the others?
      
      This patch removes that member and instead uses Optional<Reloc> in
      places where we have a user input that still hasn't been maped to the
      default value, which is now clear has no be one of the remaining 3
      options.
      
      llvm-svn: 269988
      8c34dd82
  12. May 18, 2016
    • Rafael Espindola's avatar
      Trivial cleanups. · 38af4d63
      Rafael Espindola authored
      This just clang formats and cleans comments in an area I am about to
      post a patch for review.
      
      llvm-svn: 269946
      38af4d63
  13. May 17, 2016
    • Rafael Espindola's avatar
      Simplify handling of hidden stub. · 712f957c
      Rafael Espindola authored
      Since r207518 they are printed exactly like non-hidden stubs on x86 and
      since r207517 on ARM.
      
      This means we can use a single set for all stubs in those platforms.
      
      llvm-svn: 269776
      712f957c
    • Renato Golin's avatar
      [ARM] ARM mov InstAlias for MOVW lacks HasV6T2 · 57bfb69a
      Renato Golin authored
      The movw instruction is only available in ARM state for V6T2 and above.
      The MOVi16 instruction has requirement HasV6T2 but the InstAlias
      for mov rd, imm where the operand is imm0_65535_expr:$imm does not.
      
      This means that movw can incorrectly be used in ARMv4 and ARMv5 by
      writing mov rd, 0x1234. The simple fix is to the requirement HasV6T2
      to the InstAlias. Tests added to not-armv4.s.
      
      Patch by Peter Smith.
      
      llvm-svn: 269761
      57bfb69a
  14. May 14, 2016
    • Saleem Abdulrasool's avatar
      ARM: support export directives for Windows · 8df2f498
      Saleem Abdulrasool authored
      It seems that cl will emit the export directives for Windows ARM targets.  The
      fact that it did this had originally been missed and this functionality was
      never implemented.  This makes it possible to rely solely on the source code for
      indicating what the exported interfaces are and brings us more compatibility
      with cl.
      
      llvm-svn: 269574
      8df2f498
  15. May 13, 2016
    • Tim Northover's avatar
      ARM: use callee-saved list in the order they're actually saved. · f8b0a7af
      Tim Northover authored
      When setting the frame pointer, the offset from SP is calculated based on the
      stack slot it gets allocated, but this slot is in turn based on the order of
      the CSR list so that list should match the order we actually save the registers
      in. Mostly it did, but in the edge-case of MachO AAPCS targets it was wrong.
      
      llvm-svn: 269459
      f8b0a7af
Loading