Skip to content
  1. Dec 13, 2012
  2. Dec 12, 2012
  3. Dec 11, 2012
    • Tom Stellard's avatar
      Add R600 backend · 75aadc28
      Tom Stellard authored
      A new backend supporting AMD GPUs: Radeon HD2XXX - HD7XXX
      
      llvm-svn: 169915
      75aadc28
    • Bill Schmidt's avatar
      This patch implements the general dynamic TLS model for 64-bit PowerPC. · c56f1d34
      Bill Schmidt authored
      Given a thread-local symbol x with global-dynamic access, the generated
      code to obtain x's address is:
      
           Instruction                            Relocation            Symbol
        addis ra,r2,x@got@tlsgd@ha           R_PPC64_GOT_TLSGD16_HA       x
        addi  r3,ra,x@got@tlsgd@l            R_PPC64_GOT_TLSGD16_L        x
        bl __tls_get_addr(x@tlsgd)           R_PPC64_TLSGD                x
                                             R_PPC64_REL24           __tls_get_addr
        nop
        <use address in r3>
      
      The implementation borrows from the medium code model work for introducing
      special forms of ADDIS and ADDI into the DAG representation.  This is made
      slightly more complicated by having to introduce a call to the external
      function __tls_get_addr.  Using the full call machinery is overkill and,
      more importantly, makes it difficult to add a special relocation.  So I've
      introduced another opcode GET_TLS_ADDR to represent the function call, and
      surrounded it with register copies to set up the parameter and return value.
      
      Most of the code is pretty straightforward.  I ran into one peculiarity
      when I introduced a new PPC opcode BL8_NOP_ELF_TLSGD, which is just like
      BL8_NOP_ELF except that it takes another parameter to represent the symbol
      ("x" above) that requires a relocation on the call.  Something in the 
      TblGen machinery causes BL8_NOP_ELF and BL8_NOP_ELF_TLSGD to be treated
      identically during the emit phase, so this second operand was never
      visited to generate relocations.  This is the reason for the slightly
      messy workaround in PPCMCCodeEmitter.cpp:getDirectBrEncoding().
      
      Two new tests are included to demonstrate correct external assembly and
      correct generation of relocations using the integrated assembler.
      
      Comments welcome!
      
      Thanks,
      Bill
      
      llvm-svn: 169910
      c56f1d34
    • 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::getTypeForExtArgOrReturn to take and return · ad432a8e
      Patrik Hagglund authored
      MVTs, instead of EVTs.
      
      Accordingly, add bitsLT (and similar) to MVT.
      
      llvm-svn: 169850
      ad432a8e
    • Patrik Hagglund's avatar
      Change TargetLowering::RegisterTypeForVT to contain MVTs, instead of · 03e9628c
      Patrik Hagglund authored
      EVTs.
      
      llvm-svn: 169848
      03e9628c
    • 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
    • NAKAMURA Takumi's avatar
      99feb75c
    • Jyotsna Verma's avatar
      Use multiclass for new-value store instructions with MEMri operand. · 92e71918
      Jyotsna Verma authored
      llvm-svn: 169814
      92e71918
    • 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
  4. Dec 10, 2012
  5. Dec 09, 2012
  6. Dec 08, 2012
    • Chandler Carruth's avatar
      Revert the patches adding a popcount loop idiom recognition pass. · 91e47532
      Chandler Carruth authored
      There are still bugs in this pass, as well as other issues that are
      being worked on, but the bugs are crashers that occur pretty easily in
      the wild. Test cases have been sent to the original commit's review
      thread.
      
      This reverts the commits:
        r169671: Fix a logic error.
        r169604: Move the popcnt tests to an X86 subdirectory.
        r168931: Initial commit adding the pass.
      
      llvm-svn: 169683
      91e47532
    • 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
    • Bill Wendling's avatar
  7. Dec 07, 2012
Loading