Skip to content
  1. Dec 12, 2012
  2. Dec 11, 2012
    • Patrik Hagglund's avatar
      Revert EVT->MVT changes, r169836-169851, due to buildbot failures. · e98b7a03
      Patrik Hagglund authored
      llvm-svn: 169854
      e98b7a03
    • Patrik Hagglund's avatar
      Change TargetLowering::findRepresentativeClass to take an MVT, instead · 8d2e7cf5
      Patrik Hagglund authored
      of EVT.
      
      llvm-svn: 169845
      8d2e7cf5
    • Patrik Hagglund's avatar
      Change TargetLowering::getRegClassFor to take an MVT, instead of EVT. · 3708e548
      Patrik Hagglund authored
      Accordingly, add helper funtions getSimpleValueType (in parallel to
      getValueType) in SDValue, SDNode, and TargetLowering.
      
      This is the first, in a series of patches.
      
      llvm-svn: 169837
      3708e548
    • Evan Cheng's avatar
      Stylistic tweak. · c2bd620f
      Evan Cheng authored
      llvm-svn: 169811
      c2bd620f
    • Chad Rosier's avatar
      Fall back to the selection dag isel to select tail calls. · df42cf39
      Chad Rosier authored
      This shouldn't affect codegen for -O0 compiles as tail call markers are not
      emitted in unoptimized compiles.  Testing with the external/internal nightly
      test suite reveals no change in compile time performance.  Testing with -O1,
      -O2 and -O3 with fast-isel enabled did not cause any compile-time or
      execution-time failures.  All tests were performed on my x86 machine.
      I'll monitor our arm testers to ensure no regressions occur there.
      
      In an upcoming clang patch I will be marking the objc_autoreleaseReturnValue
      and objc_retainAutoreleaseReturnValue as tail calls unconditionally.  While
      it's theoretically true that this is just an optimization, it's an
      optimization that we very much want to happen even at -O0, or else ARC
      applications become substantially harder to debug.
      
      Part of rdar://12553082
      
      llvm-svn: 169796
      df42cf39
    • Evan Cheng's avatar
      Some enhancements for memcpy / memset inline expansion. · 79e2ca90
      Evan Cheng authored
      1. Teach it to use overlapping unaligned load / store to copy / set the trailing
         bytes. e.g. On 86, use two pairs of movups / movaps for 17 - 31 byte copies.
      2. Use f64 for memcpy / memset on targets where i64 is not legal but f64 is. e.g.
         x86 and ARM.
      3. When memcpy from a constant string, do *not* replace the load with a constant
         if it's not possible to materialize an integer immediate with a single
         instruction (required a new target hook: TLI.isIntImmLegal()).
      4. Use unaligned load / stores more aggressively if target hooks indicates they
         are "fast".
      5. Update ARM target hooks to use unaligned load / stores. e.g. vld1.8 / vst1.8.
         Also increase the threshold to something reasonable (8 for memset, 4 pairs
         for memcpy).
      
      This significantly improves Dhrystone, up to 50% on ARM iOS devices.
      
      rdar://12760078
      
      llvm-svn: 169791
      79e2ca90
  3. Dec 08, 2012
    • Benjamin Kramer's avatar
      Simplify code. Sort includes. No functionality change. · f242d8c3
      Benjamin Kramer authored
      llvm-svn: 169676
      f242d8c3
    • Chandler Carruth's avatar
      Fix a use-after-free bug found by ASan. You can't assign a temporary · 1d94e932
      Chandler Carruth authored
      std::string to a StringRef. Moreover, the method being called accepts
      a Twine to simplify these patterns.
      
      Fixes this ASan failure:
      ==6312== ERROR: AddressSanitizer: heap-use-after-free on address 0x7fd558b1af58 at pc 0xcb7529 bp 0x7fffff572080 sp 0x7fffff572078
      READ of size 1 at 0x7fd558b1af58 thread T0
          #0 0xcb7528 .../llvm/include/llvm/ADT/StringRef.h:192 llvm::StringRef::operator[]()
          #1 0x1d53c0a .../llvm/include/llvm/ADT/StringExtras.h:128 llvm::HashString()
          #2 0x1d53878 .../llvm/lib/Support/StringMap.cpp:64 llvm::StringMapImpl::LookupBucketFor()
          #3 0x1b6872f .../llvm/include/llvm/ADT/StringMap.h:352 llvm::StringMap<>::GetOrCreateValue<>()
          #4 0x1b61836 .../llvm/lib/MC/MCContext.cpp:109 llvm::MCContext::GetOrCreateSymbol()
          #5 0xe9fd47 .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:154 (anonymous namespace)::ARMELFStreamer::EmitMappingSymbol()
          #6 0xea01dd .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:133 (anonymous namespace)::ARMELFStreamer::EmitDataMappingSymbol()
          #7 0xe9f78b .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:91 (anonymous namespace)::ARMELFStreamer::EmitBytes()
          #8 0x1b15d82 .../llvm/lib/MC/MCStreamer.cpp:89 llvm::MCStreamer::EmitIntValue()
          #9 0xcc0f9b .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:713 llvm::ARMAsmPrinter::emitAttributes()
          #10 0xcc0d44 .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:632 llvm::ARMAsmPrinter::EmitStartOfAsmFile()
          #11 0x14692ad .../llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:162 llvm::AsmPrinter::doInitialization()
          #12 0x1bc4677 .../llvm/lib/VMCore/PassManager.cpp:1561 llvm::FPPassManager::doInitialization()
          #13 0x1bc4990 .../llvm/lib/VMCore/PassManager.cpp:1595 llvm::MPPassManager::runOnModule()
          #14 0x1bc55e5 .../llvm/lib/VMCore/PassManager.cpp:1705 llvm::PassManagerImpl::run()
          #15 0x1bc5878 .../llvm/lib/VMCore/PassManager.cpp:1740 llvm::PassManager::run()
          #16 0xc3954d .../llvm/tools/llc/llc.cpp:378 compileModule()
          #17 0xc38001 .../llvm/tools/llc/llc.cpp:194 main
          #18 0x7fd557d6a11c __libc_start_main
      0x7fd558b1af58 is located 24 bytes inside of 29-byte region [0x7fd558b1af40,0x7fd558b1af5d)
      freed by thread T0 here:
          #0 0xc337da .../llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:56 operator delete()
          #1 0x1ee9cef .../libstdc++-v3/include/bits/basic_string.h:535 std::string::~string()
          #2 0xea01dd .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:133 (anonymous namespace)::ARMELFStreamer::EmitDataMappingSymbol()
          #3 0xe9f78b .../llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp:91 (anonymous namespace)::ARMELFStreamer::EmitBytes()
          #4 0x1b15d82 .../llvm/lib/MC/MCStreamer.cpp:89 llvm::MCStreamer::EmitIntValue()
          #5 0xcc0f9b .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:713 llvm::ARMAsmPrinter::emitAttributes()
          #6 0xcc0d44 .../llvm/lib/Target/ARM/ARMAsmPrinter.cpp:632 llvm::ARMAsmPrinter::EmitStartOfAsmFile()
          #7 0x14692ad .../llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:162 llvm::AsmPrinter::doInitialization()
          #8 0x1bc4677 .../llvm/lib/VMCore/PassManager.cpp:1561 llvm::FPPassManager::doInitialization()
          #9 0x1bc4990 .../llvm/lib/VMCore/PassManager.cpp:1595 llvm::MPPassManager::runOnModule()
          #10 0x1bc55e5 .../llvm/lib/VMCore/PassManager.cpp:1705 llvm::PassManagerImpl::run()
          #11 0x1bc5878 .../llvm/lib/VMCore/PassManager.cpp:1740 llvm::PassManager::run()
          #12 0xc3954d .../llvm/tools/llc/llc.cpp:378 compileModule()
          #13 0xc38001 .../llvm/tools/llc/llc.cpp:194 main
          #14 0x7fd557d6a11c __libc_start_main
      
      llvm-svn: 169668
      1d94e932
  4. Dec 07, 2012
  5. Dec 06, 2012
    • Evan Cheng's avatar
      Replace r169459 with something safer. Rather than having computeMaskedBits to · 9ec512d7
      Evan Cheng authored
      understand target implementation of any_extend / extload, just generate
      zero_extend in place of any_extend for liveouts when the target knows the
      zero_extend will be implicit (e.g. ARM ldrb / ldrh) or folded (e.g. x86 movz).
      
      rdar://12771555
      
      llvm-svn: 169536
      9ec512d7
    • Chad Rosier's avatar
    • Evan Cheng's avatar
      Let targets provide hooks that compute known zero and ones for any_extend · 5213139f
      Evan Cheng authored
      and extload's. If they are implemented as zero-extend, or implicitly
      zero-extend, then this can enable more demanded bits optimizations. e.g.
      
      define void @foo(i16* %ptr, i32 %a) nounwind {
      entry:
        %tmp1 = icmp ult i32 %a, 100
        br i1 %tmp1, label %bb1, label %bb2
      bb1:
        %tmp2 = load i16* %ptr, align 2
        br label %bb2
      bb2:
        %tmp3 = phi i16 [ 0, %entry ], [ %tmp2, %bb1 ]
        %cmp = icmp ult i16 %tmp3, 24
        br i1 %cmp, label %bb3, label %exit
      bb3:
        call void @bar() nounwind
        br label %exit
      exit:
        ret void
      }
      
      This compiles to the followings before:
              push    {lr}
              mov     r2, #0
              cmp     r1, #99
              bhi     LBB0_2
      @ BB#1:                                 @ %bb1
              ldrh    r2, [r0]
      LBB0_2:                                 @ %bb2
              uxth    r0, r2
              cmp     r0, #23
              bhi     LBB0_4
      @ BB#3:                                 @ %bb3
              bl      _bar
      LBB0_4:                                 @ %exit
              pop     {lr}
              bx      lr
      
      The uxth is not needed since ldrh implicitly zero-extend the high bits. With
      this change it's eliminated.
      
      rdar://12771555
      
      llvm-svn: 169459
      5213139f
  6. Dec 05, 2012
    • David Sehr's avatar
      Correct ARM NOP encoding · 05176cad
      David Sehr authored
      The encoding of NOP in ARMAsmBackend.cpp is missing a trailing zero, which
      causes the emission of a coprocessor instruction rather than "mov r0, r0"
      as indicated in the comment.  The test also checks for the wrong encoding.
      
      http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/157919.html
      
      llvm-svn: 169420
      05176cad
    • Kevin Enderby's avatar
      Added a option to the disassembler to print immediates as hex. · 168ffb36
      Kevin Enderby authored
      This is for the lldb team so most of but not all of the values are
      to be printed as hex with this option.  Some small values like the
      scale in an X86 address were requested to printed in decimal
      without the leading 0x.
      
      There may be some tweaks need to places that may still be in
      decimal that they want in hex.  Specially for arm.  I made my best
      guess.  Any tweaks from here should be simple.
      
      I also did the best I know now with help from the C++ gurus
      creating the cleanest formatImm() utility function and containing
      the changes.  But if someone has a better idea to make something
      cleaner I'm all ears and game for changing the implementation.
      
      rdar://8109283
      
      llvm-svn: 169393
      168ffb36
    • Matt Beaumont-Gay's avatar
      Appease GCC's -Wparentheses. · 50f61b66
      Matt Beaumont-Gay authored
      (TIL that Clang's -Wparentheses ignores 'x || y && "foo"' on purpose. Neat.)
      
      llvm-svn: 169337
      50f61b66
  7. Dec 04, 2012
  8. Dec 03, 2012
    • Jakob Stoklund Olesen's avatar
      Implement ARMBaseRegisterInfo::getRegAllocationHints(). · 742f201e
      Jakob Stoklund Olesen authored
      This provides the same functionality as getRawAllocationOrder() for the
      even/odd hints, but without the many constant register arrays.
      
      llvm-svn: 169169
      742f201e
    • Chandler Carruth's avatar
      Use the new script to sort the includes of every file under lib. · ed0881b2
      Chandler Carruth authored
      Sooooo many of these had incorrect or strange main module includes.
      I have manually inspected all of these, and fixed the main module
      include to be the nearest plausible thing I could find. If you own or
      care about any of these source files, I encourage you to take some time
      and check that these edits were sensible. I can't have broken anything
      (I strictly added headers, and reordered them, never removed), but they
      may not be the headers you'd really like to identify as containing the
      API being implemented.
      
      Many forward declarations and missing includes were added to a header
      files to allow them to parse cleanly when included first. The main
      module rule does in fact have its merits. =]
      
      llvm-svn: 169131
      ed0881b2
  9. Nov 30, 2012
    • Sebastian Pop's avatar
      Codegen failure for vmull with small vectors · a204f722
      Sebastian Pop authored
      Codegen was failing with an assertion because of unexpected vector
      operands when legalizing the selection DAG for a MUL instruction.
      
      The asserting code was legalizing multiplies for vectors of size 128
      bits. It uses a custom lowering to try and detect cases where it can
      use a VMULL instruction instead of a VMOVL + VMUL.  The code was
      looking for input operands to the MUL that had been sign or zero
      extended. If it found the extended operands it would drop the
      sign/zero extension and use the original vector size as input to a
      VMULL instruction.
      
      The code assumed that the original input vector was 64 bits so that
      after dropping the extension it would fit directly into a D register
      and could be used as an operand of a VMULL instruction. The input
      code that trigger the failure used a vector of <4 x i8> that was
      sign extended to <4 x i32>. It was not safe to drop the sign
      extension in this case because the original vector is only 32 bits
      wide. The fix is to insert a sign extension for the vector to reach
      the required 64 bit size. In this particular example, the vector would
      need to be sign extented to a <4 x i16>.
      
      llvm-svn: 169024
      a204f722
    • Kevin Enderby's avatar
      Fixed the arm disassembly of invalid BFI instructions to not build a bad MCInst · 136d6746
      Kevin Enderby authored
      which would then cause an assert when printed.  rdar://11437956
      
      llvm-svn: 168960
      136d6746
  10. Nov 29, 2012
  11. Nov 28, 2012
  12. Nov 27, 2012
Loading