Skip to content
  1. Mar 27, 2015
  2. Mar 26, 2015
    • Ahmed Bougacha's avatar
      [CodeGen] Report error rather than crash when unable to makeLibCall. · e85a2d34
      Ahmed Bougacha authored
      Also, make the assumption explicit in the header.
      
      llvm-svn: 233329
      e85a2d34
    • Ahmed Bougacha's avatar
      [CodeGen] Don't pretend we can expand f16 libcalls. · 2721f62d
      Ahmed Bougacha authored
      We used to mark a bunch of libm nodes as Expand for f16.  There are no
      libcalls we can use for those, so we eventually just hit an unhelpful
      llvm_unreachable in ExpandFPLibCall.
      
      Instead, just ignore them altogether.  If nothing else changes, we'll
      then get the more descriptive and pleasant "Cannot select" fatal error.
      
      There's an argument to be made for consistency, but f16 is already
      special in all the good ways, and as long as there's no f16 support in
      the ops expander (this patch), as well as the Soften/Expand float
      legalizers (which, when hit, will currently segfault), I think there's
      no point in even pretending we can legalize any of this.
      
      This shouldn't affect anything that's not already broken.
      
      llvm-svn: 233328
      2721f62d
    • Derek Schuff's avatar
      Use movw/movt instead of constant pool loads to lower byval parameter copies · b051389f
      Derek Schuff authored
      Summary:
      The ARM backend can use a loop to implement copying byval parameters before
      a call. In non-thumb2 mode it uses a constant pool load to materialize the
      trip count. For targets that need movt instead (e.g. Native Client), use
      the same code as in thumb2 mode to materialize the trip count.
      
      Reviewers: jfb, t.p.northover
      
      Differential Revision: http://reviews.llvm.org/D8442
      
      llvm-svn: 233324
      b051389f
    • Duncan P. N. Exon Smith's avatar
      Verifier: Check accessors of MDLocation · 26489982
      Duncan P. N. Exon Smith authored
      Check accessors of `MDLocation`, and change them to `cast<>` down to the
      right types.  Also add type-safe factory functions.
      
      All the callers that handle broken code need to use the new versions of
      the accessors (`getRawScope()` instead of `getScope()`) that still
      return `Metadata*`.  This is also necessary for things like
      `MDNodeKeyImpl<MDLocation>` (in LLVMContextImpl.h) that need to unique
      the nodes when their operands might still be forward references of the
      wrong type.
      
      In the `Value` hierarchy, consumers that handle broken code use
      `getOperand()` directly.  However, debug info nodes have a ton of
      operands, and their order (even their existence) isn't stable yet.  It's
      safer and more maintainable to add an explicit "raw" accessor on the
      class itself.
      
      llvm-svn: 233322
      26489982
    • Derek Schuff's avatar
      Default to armv7 cpu for NaCl when march=arm · a3b594c4
      Derek Schuff authored
      Summary:
      When the arch is given as "arm" clang uses the default target CPU from
      LLVM to determine what the real arch should be (i.e. "arm" becomes
      "armv4t" because LLVM's getARMCPUForArch falls back to "arm7tdmi").
      Default to "cortex-a8" so that we end up with "armv7" in clang.
      
      the nacl-direct.c test in clang also covers this case.
      
      Differential Revision: http://reviews.llvm.org/D8589
      
      llvm-svn: 233321
      a3b594c4
    • Rafael Espindola's avatar
      Fix PR23025. · aeed3cbc
      Rafael Espindola authored
      There is something in link.exe that requires a relocation to use a
      global symbol. Not doing so breaks the chrome build on windows.
      
      This patch sets isWeak for that to work. To compensate,
      we then need to look past those symbols when not creating relocations.
      
      This patch includes an ELF test that matches GNU as behaviour.
      
      I am still reducing the chrome build issue and will add a test
      once that is done.
      
      llvm-svn: 233318
      aeed3cbc
    • Yaron Keren's avatar
      Fix rare case where APInt divide algorithm applied un-needed transformation. · 39fc5a6f
      Yaron Keren authored
      APInt uses Knuth's D algorithm for long division. In rare cases the
      implementation applied a transformation that was not needed.
      
      Added unit tests for long division. KnuthDiv() procedure is fully covered.
      There is a case in APInt::divide() that I believe is never used (marked with
      a comment) as all users of divide() handle trivial cases earlier.
      
      Patch by Pawel Bylica!
      
        http://reviews.llvm.org/D8448
      
      llvm-svn: 233312
      39fc5a6f
    • Sanjoy Das's avatar
      [ADT][CMake][AutoConf] Fail-fast iterators for DenseMap · 8ce6499b
      Sanjoy Das authored
      Summary:
      This patch is an attempt at making `DenseMapIterator`s "fail-fast".
      Fail-fast iterators that have been invalidated due to insertion into
      the host `DenseMap` deterministically trip an assert (in debug mode)
      on access, instead of non-deterministically hitting memory corruption
      issues.
      
      Enabling fail-fast iterators breaks the LLVM C++ ABI, so they are
      predicated on `LLVM_ENABLE_ABI_BREAKING_CHECKS`.
      `LLVM_ENABLE_ABI_BREAKING_CHECKS` by default flips with
      `LLVM_ENABLE_ASSERTS`, but can be clamped to ON or OFF using the CMake /
      autoconf build system.
      
      Reviewers: chandlerc, dexonsmith, rnk, zturner
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D8351
      
      llvm-svn: 233310
      8ce6499b
    • Justin Bogner's avatar
      [ARM] Fix some non-portable shell syntax in r233301's tests · 54dd7df1
      Justin Bogner authored
      The "|&" operator isn't POSIX, so it can fail depending on the host's
      default shell. Avoid it.
      
      There were also a couple of places that did "2>1", but this creates a
      file called "1". They clearly meant "2>&1".
      
      llvm-svn: 233309
      54dd7df1
    • Paul Robinson's avatar
      Ignore compile_commands.json only at the root of the tree. · d8587b8b
      Paul Robinson authored
      Can avoid a problem if tools/clang/tools/extra is in the tree.
      
      Patch by Douglas Yung!
      
      llvm-svn: 233307
      d8587b8b
    • Andrew Kaylor's avatar
      Supress MSVC padding warning in alignment test · f8fea095
      Andrew Kaylor authored
      llvm-svn: 233305
      f8fea095
    • Renato Golin's avatar
      Adds an option to disable ARM ld/st optim pass · 4c871396
      Renato Golin authored
      Enabled by default, but it's useful when debugging with llc.
      
      Patch by Ranjeet Singh.
      
      llvm-svn: 233303
      4c871396
    • Duncan P. N. Exon Smith's avatar
      Reapply "Linker: Drop function pointers for overridden subprograms" · c947892d
      Duncan P. N. Exon Smith authored
      This reverts commit r233254, effectively reapplying r233164 (and its
      successors), with an additional testcase for when subprograms match
      exactly.  This fixes PR22792 (again).
      
      I'm using the same approach, but I've moved up the call to
      `stripReplacedSubprograms()`.  The function pointers need to be dropped
      before mapping any metadata from the source module, or else this can
      drop the function from new subprograms that have merged (via Metadata
      uniquing) with the old ones.  Dropping the pointers first prevents them
      from merging.
      
      **** The original commit message follows. ****
      
      Linker: Drop function pointers for overridden subprograms
      
      Instead of dropping subprograms that have been overridden, just set
      their function pointers to `nullptr`.  This is a minor adjustment to the
      stop-gap fix for PR21910 committed in r224487, and fixes the crasher
      from PR22792.
      
      The problem that r224487 put a band-aid on: how do we find the canonical
      subprogram for a `Function`?  Since the backend currently relies on
      `DebugInfoFinder` (which does a naive in-order traversal of compile
      units and picks the first subprogram) for this, r224487 tried dropping
      non-canonical subprograms.
      
      Dropping subprograms fails because the backend *also* builds up a map
      from subprogram to compile unit (`DwarfDebug::SPMap`) based on the
      subprogram lists.  A missing subprogram causes segfaults later when an
      inlined reference (such as in this testcase) is created.
      
      Instead, just drop the `Function` pointer to `nullptr`, which nicely
      mirrors what happens when an already-inlined `Function` is optimized
      out.  We can't really be sure that it's the same definition anyway, as
      the testcase demonstrates.
      
      This still isn't completely satisfactory.  Two flaws at least that I can
      think of:
      
        - I still haven't found a straightforward way to make this symmetric
          in the IR.  (Interestingly, the DWARF output is already symmetric,
          and I've tested for that to be sure we don't regress.)
        - Using `DebugInfoFinder` to find the canonical subprogram for a
          function is kind of crazy.  We should just attach metadata to the
          function, like this:
      
              define weak i32 @foo(i32, i32) !dbg !MDSubprogram(...) {
      
      llvm-svn: 233302
      c947892d
    • Vladimir Sukharev's avatar
      [ARM] Add v8.1a "Rounding Double Multiply Add/Subtract" extension · 4b18c727
      Vladimir Sukharev authored
      Reviewers: t.p.northover
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D8503
      
      llvm-svn: 233301
      4b18c727
Loading