1. Sep 30, 2014
    • Todd Fiala's avatar
      thread state coordinator: added a thread resume request and related tests. · e2109e73
      Todd Fiala authored
      The thread resume block is executed in the normal flow of thread
      state queued event processing.  The tests verify that it is executed
      when we track the thread to be stopped and skipped when we track
      it to already be running.
      
      llvm-svn: 218638
      e2109e73
    • Adam Nemet's avatar
      [AVX512] Use X86VectorVTInfo in the masking helper classes and the FMAs · 6bddb8c3
      Adam Nemet authored
      No functionality change.
      
      Makes the code more compact (see the FMA part).
      
      This needs a new type attribute MemOpFrag in X86VectorVTInfo.  For now I only
      defined this in the simple cases.  See the commment before the attribute.
      
      Diff of X86.td.expanded before and after is empty except for the appearance of
      the new attribute.
      
      llvm-svn: 218637
      6bddb8c3
    • Hans Wennborg's avatar
      WinCOFFObjectWriter: optimize the string table for common suffices · f26bfc16
      Hans Wennborg authored
      This is a follow-up from r207670 which did the same for ELF.
      
      Differential Revision: http://reviews.llvm.org/D5530
      
      llvm-svn: 218636
      f26bfc16
    • Alexey Samsonov's avatar
      Use ClangToLLVMArgsMapping in CodeGenTypes::GetFunctionType(). NFC. · 153004f2
      Alexey Samsonov authored
      This is the last piece of CGCall code that had implicit assumptions about
      the order in which Clang arguments are translated to LLVM ones (positions
      of inalloca argument, sret, this, padding arguments etc.) Now all of
      this data is encapsulated in ClangToLLVMArgsMapping. If this information
      would be required somewhere else, this class can be moved to a separate
      header or pulled into CGFunctionInfo.
      
      llvm-svn: 218634
      153004f2
    • Rafael Auler's avatar
      [lld] [ELF] Support for general dynamic TLS relocations on X86_64 · 5a1000dd
      Rafael Auler authored
      Summary:
      This patch adds support for the general dynamic TLS access model for X86_64 (see www.akkadia.org/drepper/tls.pdf).
      
      To properly support TLS, the patch also changes the __tls_get_addr atom to be a shared library atom instead of a regularly defined atom (the previous lld approach). This closely models the reality of a function that will be resolved at runtime by the dynamic linker and loader itself (ld.so). I was tempted to force LLD to link against ld.so itself to resolve these symbols, but since GNU ld does not need the ld.so library to resolve this symbol, I decided to mimic its behavior and keep hardwired a definition of __tls_get_addr in the lld code.
      
      This patch also moves some important logic that previously was only available to the MIPS lld backend to be used to all ELF backends. This logic, which now lives in the DefaultLayout class, will monitor which external (shared lib) symbols are really imported by the current module and will only populate the dynamic symbol table with used symbols, as opposed to the previous approach of dumping all shared lib symbols in the dynamic symbol table. This is important to this patch to avoid __tls_get_addr from getting injected into all dynamic symbol tables.
      
      By solving the previous problem of always adding __tls_get_addr, now the produced symbol tables are slightly smaller. But this impacted several tests that relied on hardwired/predefined sizes of the symbol table, requiring this patch to update such tests.
      
      Test Plan: Added a LIT test case that exercises a simple use case of TLS variable in a shared library.
      
      Reviewers: ruiu, rafael, Bigcheese, shankarke
      
      Reviewed By: Bigcheese, shankarke
      
      Subscribers: emaste, shankarke, joerg, kledzik, mcrosier, llvm-commits
      
      Projects: #lld
      
      Differential Revision: http://reviews.llvm.org/D5505
      
      llvm-svn: 218633
      5a1000dd
    • Eric Christopher's avatar
      Add soft-float to the key for the subtarget lookup in the TargetMachine · 6a0551e4
      Eric Christopher authored
      map, this makes sure that we can compile the same code for two different
      ABIs (hard and soft float) in the same module.
      
      Update one testcase accordingly (and fix some confusing naming) and
      add a new testcase as well with the ordering swapped which would
      highlight the problem.
      
      llvm-svn: 218632
      6a0551e4
    • Eric Christopher's avatar
      Fix spelling and reflow comments. · 9b270d4d
      Eric Christopher authored
      llvm-svn: 218631
      9b270d4d
    • Rafael Auler's avatar
      Test commit. Fix a whitespace in ToolChains.cpp. · 3f7abf7d
      Rafael Auler authored
      llvm-svn: 218630
      3f7abf7d
    • Todd Fiala's avatar
      thread state coordinator: add exec reset support, remove empty virtual destructors. · 424723b2
      Todd Fiala authored
      Also added a test for the reset handling.  The reset/state clearing happens
      as a processed queue event.  The only diff vs. standard processing is that
      the exec clears the queue before queueing the activity to clear internal state.
      i.e. once we get an exec, we really stop doing any other queue-based activity.
      
      llvm-svn: 218629
      424723b2
    • David Majnemer's avatar
      AST: Fix a typo in RecordLayoutBuilder · 4ce469b7
      David Majnemer authored
      No functional change intended.
      
      llvm-svn: 218628
      4ce469b7
    • Dave Estes's avatar
      [AArch64] Refines the Cortex-A57 Machine Model · 5f9daea1
      Dave Estes authored
      Primarily refines all of the instructions with accurate latency
      and micro-op information. Refinements largely focus on the NEON
      instructions.
      
      Additionally, a few advanced features are modeled, including
      forwarding for MAC instructions and hazards for floating point SQRT
      and DIV.
      
      Lastly, the issue-width is reduced to three so that the scheduler
      will better accommodate the narrower decode and dispatch width.
      
      llvm-svn: 218627
      5f9daea1
    • David Blaikie's avatar
      Unit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior... · ce3f573a
      David Blaikie authored
      Unit test r218187, changing RTDyldMemoryManager::getSymbolAddress's behavior favor mangled lookup over unmangled lookup.
      
      The contract of this function seems problematic (fallback in either
      direction seems like it could produce bugs in one client or another),
      but here's some tests for its current behavior, at least. See the
      commit/review thread of r218187 for more discussion.
      
      llvm-svn: 218626
      ce3f573a
    • Alexey Samsonov's avatar
      Introduce CGFunctionInfo::getNumRequiredArgs(). NFC. · 34625dda
      Alexey Samsonov authored
      Save the callers from necessity to special-case on variadic functions.
      
      llvm-svn: 218625
      34625dda
    • Eli Bendersky's avatar
      CUDA: Fix incorrect target inference for implicit members. · 9a220fca
      Eli Bendersky authored
      As PR20495 demonstrates, Clang currenlty infers the CUDA target (host/device,
      etc) for implicit members (constructors, etc.) incorrectly. This causes errors
      and even assertions in Clang when compiling code (assertions in C++11 mode where
      implicit move constructors are added into the mix).
      
      Fix the problem by inferring the target from the methods the implicit member
      should call (depending on its base classes and fields).
      
      llvm-svn: 218624
      9a220fca
    • Alexey Samsonov's avatar
      Speedup ClangToLLVMArgMapping construction. NFC. · 52c0f6ad
      Alexey Samsonov authored
      Add a method to calculate the number of arguments given QualType
      expnads to. Use this method in ClangToLLVMArgMapping calculation.
      This number may be cached in CodeGenTypes for efficiency, if needed.
      
      llvm-svn: 218623
      52c0f6ad
    • Aaron Ballman's avatar
    • Fariborz Jahanian's avatar
      Objective-C [qoi] - provide group name for · b417b8f7
      Fariborz Jahanian authored
      warn_property_types_are_incompatible. rdar://18487506
      
      llvm-svn: 218621
      b417b8f7
    • Kostya Serebryany's avatar
      [asan] add a test for array cookie if the operator new is defined inside the... · da9d495d
      Kostya Serebryany authored
      [asan] add a test for array cookie if the operator new is defined inside the class (the cookie should not be poisoned in such case); update the related comment in asan_poisoning.cc
      
      llvm-svn: 218620
      da9d495d
    • Jordan Rose's avatar
      Add getValueOr to llvm::Optional<T>. · 59e4e1b5
      Jordan Rose authored
      This takes a single argument convertible to T, and
      - if the Optional has a value, returns the existing value,
      - otherwise, constructs a T from the argument and returns that.
      
      Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.
      
      llvm-svn: 218618
      59e4e1b5
    • Jordan Rose's avatar
      Add "typedef T value_type;" to llvm::Optional<T>. · 40424cd6
      Jordan Rose authored
      Inspired by std::experimental::optional from the "Library Fundamentals" C++ TS.
      
      llvm-svn: 218617
      40424cd6
    • Samuel Benzaquen's avatar
      Refactor Matcher<T> and DynTypedMatcher to reduce overhead of casts. · ee110341
      Samuel Benzaquen authored
      Summary:
      This change introduces DynMatcherInterface and changes the internal
      representation of DynTypedMatcher and Matcher<T> to use a generic
      interface instead.
      It removes unnecessary indirections and virtual function calls when
      converting matchers by implicit and dynamic casts.
      DynTypedMatcher now remembers the stricter type in the chain of casts
      and checks it before calling into DynMatcherInterface.
      This change improves our clang-tidy related benchmark by ~14%.
      Also, it opens the door for more optimizations of this kind that are
      coming in future changes.
      
      As a side effect of removing these template instantiations, it also
      speeds up compilation of Dynamic/Registry.cpp by ~17% and reduces the number of
      symbols generated by ~30%.
      
      Reviewers: klimek
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: http://reviews.llvm.org/D5485
      
      llvm-svn: 218616
      ee110341
    • Alexey Samsonov's avatar
      Refactor ABIArgInfo::Expand implementation (NFC). · 8a0bad0b
      Alexey Samsonov authored
      Hoist the logic which determines the way QualType is expanded
      into a separate method. Remove a bunch of copy-paste and simplify
      getTypesFromArgs() / ExpandTypeFromArgs() / ExpandTypeToArgs() methods.
      
      llvm-svn: 218615
      8a0bad0b
    • Richard Smith's avatar
      bf65300f
    • Johannes Doerfert's avatar
      Disable runtime alias checks when we ignore aliasing. · 928229fd
      Johannes Doerfert authored
        This is just a optimization to save the compile time and execution time
        for runtime alias checks if the user guarantees no aliasing all together.
      
      llvm-svn: 218613
      928229fd
  2. Sep 29, 2014
    • Matt Arsenault's avatar
      Fixing missing C++ mode comment · 9f617a0c
      Matt Arsenault authored
      llvm-svn: 218612
      9f617a0c
    • Matt Arsenault's avatar
      Fix include order · 1fd0c628
      Matt Arsenault authored
      llvm-svn: 218611
      1fd0c628
    • Matt Arsenault's avatar
      R600/SI: Fix hardcoded values for modifiers. · 9783e00d
      Matt Arsenault authored
      Move enums to SIDefines.h
      
      llvm-svn: 218610
      9783e00d
    • Matt Arsenault's avatar
      R600/SI: Also fix fsub + fadd a, a to mad combines · 3d4233fe
      Matt Arsenault authored
      llvm-svn: 218609
      3d4233fe
    • Matt Arsenault's avatar
      R600/SI: Fix using mad with multiplies by 2 · 02cb0ff7
      Matt Arsenault authored
      These turn into fadds, so combine them into the target
      mad node.
      
      fadd (fadd (a, a), b) -> mad 2.0, a, b
      
      llvm-svn: 218608
      02cb0ff7
    • Chad Rosier's avatar
      [AArch64] Improve cost model to handle sdiv by a pow-of-two. · 70d54ac8
      Chad Rosier authored
      This patch improves the target-specific cost model to better handle signed
      division by a power of two. The immediate result is that this enables the SLP
      vectorizer to do a better job.
      
      http://reviews.llvm.org/D5469
      PR20714
      
      llvm-svn: 218607
      70d54ac8
    • Frederic Riss's avatar
      Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection. · 312a02e1
      Frederic Riss authored
      There will be multiple TypeUnits in an unlinked object that will be extracted
      from different sections. Now that we have DWARFUnitSection that is supposed
      to represent an input section, we need a DWARFUnitSection<TypeUnit> per
      input .debug_types section.
      
      Once this is done, the interface is homogenous and we can move the Section
      parsing code into DWARFUnitSection.
      
      This is a respin of r218513 that got reverted because it broke some builders.
      This new version features an explicit move constructor for the DWARFUnitSection
      class to workaround compilers unable to generate correct C++11 default
      constructors.
      
      Reviewers: samsonov, dblaikie
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D5482
      
      llvm-svn: 218606
      312a02e1
    • Evgeniy Stepanov's avatar
      [sanitizer] Android build cleanup. · 9e922e7d
      Evgeniy Stepanov authored
      * Detect Android toolchain target arch and set correct runtime library name.
      * Merged a lot of Android and non-Android code paths.
      * Android is only supported in standalone build of compiler-rt now.
      * Linking lsan-common in ASan-Android (makes lsan annotations work).
      * Relying on -fsanitize=address linker flag when building tests (again,
        unification with non-Android path).
      * Runtime library moved from lib/asan to lib/linux.
      
      llvm-svn: 218605
      9e922e7d
    • Kevin Qin's avatar
      Use a loop to simplify the runtime unrolling prologue. · fc02e3c3
      Kevin Qin authored
      Runtime unrolling will create a prologue to execute the extra
      iterations which is can't divided by the unroll factor. It
      generates an if-then-else sequence to jump into a factor -1
      times unrolled loop body, like
      
          extraiters = tripcount % loopfactor
          if (extraiters == 0) jump Loop:
          if (extraiters == loopfactor) jump L1
          if (extraiters == loopfactor-1) jump L2
          ...
          L1:  LoopBody;
          L2:  LoopBody;
          ...
          if tripcount < loopfactor jump End
          Loop:
          ...
          End:
      
      It means if the unroll factor is 4, the loop body will be 7
      times unrolled, 3 are in loop prologue, and 4 are in the loop.
      This commit is to use a loop to execute the extra iterations
      in prologue, like
      
              extraiters = tripcount % loopfactor
              if (extraiters == 0) jump Loop:
              else jump Prol
       Prol:  LoopBody;
              extraiters -= 1                 // Omitted if unroll factor is 2.
              if (extraiters != 0) jump Prol: // Omitted if unroll factor is 2.
              if (tripcount < loopfactor) jump End
       Loop:
       ...
       End:
      
      Then when unroll factor is 4, the loop body will be copied by
      only 5 times, 1 in the prologue loop, 4 in the original loop.
      And if the unroll factor is 2, new loop won't be created, just
      as the original solution.
      
      llvm-svn: 218604
      fc02e3c3
    • Oliver Stannard's avatar
      [Thumb2] ldrexd and strexd are not defined on v7M · a4eba5ad
      Oliver Stannard authored
      The Thumb2 ldrexd and strexd instructions are not defined for
      M-class architectures.
      
      llvm-svn: 218603
      a4eba5ad
    • Alexey Bataev's avatar
      Fix bug 20116 - http://llvm.org/bugs/show_bug.cgi?id=20116 · 5bd68794
      Alexey Bataev authored
      Fixes incorrect codegen when devirtualization is aborted due to covariant return types.
      
      Differential Revision: http://reviews.llvm.org/D5321
      
      llvm-svn: 218602
      5bd68794
    • Oliver Stannard's avatar
      [compiler-rt] Do not use ldrexd or strexd on v7M · 609e2e6a
      Oliver Stannard authored
      The ldrexd and strexd instructions are undefined for the ARMv7M
      architecture, so we cannot use them to implement the
      __sync_fetch_and_*_8 builtins. There is no other way to implement
      these without OS support, so this patch #ifdef's these functions out
      for M-class architectures.
      
      There are no tests as I cannot find any existing tests for these
      builtins.
      
      I used the __ARM_ARCH_PROFILE predefine because __ARM_FEATURE_LDREX is
      deprecated and not set by clang.
      
      llvm-svn: 218601
      609e2e6a
    • Chandler Carruth's avatar
      [x86] Make the new vector shuffle lowering lower blends as VSELECT · 6cbf4316
      Chandler Carruth authored
      nodes, and rely exclusively on its logic. This removes a ton of
      duplication from the blend lowering and centralizes it in one place.
      
      One downside is that it requires a bunch of hacks to make this work with
      the current legalization framework. We have to manually speculate one
      aspect of legalizing VSELECT nodes to get everything to work nicely
      because the existing legalization framework isn't *actually* bottom-up.
      
      The other grossness is that we somewhat duplicate the analysis of
      constant blends. I'm on the fence here. If reviewers thing this would
      look better with VSELECT when it has constant operands dumping over tho
      VECTOR_SHUFFLE, we could go that way. But it would be a substantial
      change because currently all of the actual blend instructions are
      matched via patterns in the TD files based around VSELECT nodes (despite
      them not being perfect fits for that). Suggestions welcome, but at least
      this removes the rampant duplication in the backend.
      
      llvm-svn: 218600
      6cbf4316
    • Evgeniy Stepanov's avatar
      [asan] Fix SELinux setup on Android-K. · 3f11c0d7
      Evgeniy Stepanov authored
      On pre-L devices SELinux is set up in such a way that zygote wrapper
      has to be in system_file context, not zygote_exec.
      
      llvm-svn: 218599
      3f11c0d7
    • Daniel Jasper's avatar
      clang-format: Fix GCC warning about implicit bool pointer conversion. · 91881d99
      Daniel Jasper authored
      Introduced in r217880.
      
      llvm-svn: 218597
      91881d99
    • Matthew Gardiner's avatar
      Very minimal support 24-bit kalimbas. Vanilla "memory read" for data sections · f03e6d84
      Matthew Gardiner authored
      works, as do breakpoints, run and pause, display zeroth frame.
      
      See
      http://reviews.llvm.org/D5503
      
      for a fuller description of the changes in this commit.
      
      llvm-svn: 218596
      f03e6d84