1. Dec 23, 2016
    • George Burgess IV's avatar
      Don't consider allocsize functions to be allocation functions. · ccae43a2
      George Burgess IV authored
      This patch fixes some ASAN unittest failures on FreeBSD. See the
      cfe-commits email thread for r290169 for more on those.
      
      According to the LangRef, the allocsize attribute only tells us about
      the number of bytes that exist at the memory location pointed to by the
      return value of a function. It does not necessarily mean that the
      function will only ever allocate. So, we need to be very careful about
      treating functions with allocsize as general allocation functions. This
      patch makes us fully conservative in this regard, though I suspect that
      we have room to be a bit more aggressive if we want.
      
      This has a FIXME that can be fixed by a relatively straightforward
      refactor; I just wanted to keep this patch minimal. If this sticks, I'll
      come back and fix it in a few days.
      
      llvm-svn: 290397
      ccae43a2
    • Vitaly Buka's avatar
      [compiler-rt] Define COMMON_INTERCEPT_FUNCTION_MEMCPY for tsan and esan · 2e975542
      Vitaly Buka authored
      Reviewers: eugenis
      
      Subscribers: kubabrecka, dberris, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28072
      
      llvm-svn: 290396
      2e975542
    • Sanjoy Das's avatar
      NFC code motion in ImplicitNullChecks · 50fef432
      Sanjoy Das authored
      Extract out two large lambdas into top level member functions.
      
      llvm-svn: 290395
      50fef432
    • Sanjoy Das's avatar
      Reimplement depedency tracking in the ImplicitNullChecks pass · 9a129807
      Sanjoy Das authored
      Summary:
      This change rewrites a core component in the ImplicitNullChecks pass for
      greater simplicity since the original design was over-complicated for no
      good reason.  Please review this as essentially a new pass.  The change
      is almost NFC and I've added a test case for a scenario that this new
      code handles that wasn't handled earlier.
      
      The implicit null check pass, at its core, is a code hoisting transform.
      It differs from "normal" code transforms in that it speculates
      potentially faulting instructions (by design), but a lot of the usual
      hazard detection logic (register read-after-write etc.) still applies.
      We previously detected hazards by keeping track of registers defined and
      used by machine instructions over an instruction range, but that was
      unwieldy and did not actually confer any performance benefits.  The
      intent was to have linear time complexity over the number of machine
      instructions considered, but it ended up being N^2 is practice.
      
      This new version is more obviously O(N^2) (with N capped to 8 by
      default) in hazard detection.  It does not attempt to be clever in
      tracking register uses or defs (the previous cleverness here was a
      source of bugs).
      
      Once this is checked in, I'll extract out the `IsSuitableMemoryOp` and
      `CanHoistLoadInst` lambda into member functions (they're too complicated
      to be inline lambdas) and do some other related NFC cleanups.
      
      Reviewers: reames, anna, atrick
      
      Subscribers: mcrosier, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D27592
      
      llvm-svn: 290394
      9a129807
    • Vitaly Buka's avatar
      Fix interceptors setup broken after r290382 · cd613e9d
      Vitaly Buka authored
      Summary: We setup these interceptors twice which hangs test on windows.
      
      Reviewers: eugenis
      
      Subscribers: llvm-commits, kubabrecka
      
      Differential Revision: https://reviews.llvm.org/D28070
      
      llvm-svn: 290393
      cd613e9d
    • Chandler Carruth's avatar
      Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'. · 93786da2
      Chandler Carruth authored
      Much to my surprise, '-disable-llvm-optzns' which I thought was the
      magical flag I wanted to get at the raw LLVM IR coming out of Clang
      deosn't do that. It still runs some passes over the IR. I don't want
      that, I really want the *raw* IR coming out of Clang and I strongly
      suspect everyone else using it is in the same camp.
      
      There is actually a flag that does what I want that I didn't know about
      called '-disable-llvm-passes'. I suspect many others don't know about it
      either. It both does what I want and is much simpler.
      
      This removes the confusing version and makes that spelling of the flag
      an alias for '-disable-llvm-passes'. I've also moved everything in Clang
      to use the 'passes' spelling as it seems both more accurate (*all* LLVM
      passes are disabled, not just optimizations) and much easier to remember
      and spell correctly.
      
      This is part of simplifying how Clang drives LLVM to make it cleaner to
      wire up to the new pass manager.
      
      Differential...
      93786da2
    • Petr Hosek's avatar
      [CMake] Add install target for the lld tool · f367a2a5
      Petr Hosek authored
      This is necessary for the distribution targets which assume that
      each component has an install target. This also moves the CMake
      macros into a separate file akin to other LLVM projects.
      
      Differential Revision: https://reviews.llvm.org/D27876
      
      llvm-svn: 290391
      f367a2a5
    • Jonathan Roelofs's avatar
    • Tobias Grosser's avatar
      Update isl to isl-0.18-9-gd4734f3 · ccae1ee4
      Tobias Grosser authored
      llvm-svn: 290389
      ccae1ee4
    • Chris Bieneman's avatar
      [ObjectYAML] Fixing a compiler warning · 7e98468f
      Chris Bieneman authored
      Accidentally re-defined the variable instead of setting it. Oops!
      
      llvm-svn: 290388
      7e98468f
    • Quentin Colombet's avatar
      [GlobalISel] More fix for the size vs. type typo. NFC. · 3749f338
      Quentin Colombet authored
      I missed those in my previous commit (r290378).
      
      llvm-svn: 290387
      3749f338
    • Chris Bieneman's avatar
      [ObjectYAML] Support for DWARF debug_info section · e0e451d9
      Chris Bieneman authored
      This patch adds support for YAML<->DWARF for debug_info sections.
      
      This re-lands r290147, reverted in 290148, re-landed in r290204 after fixing the issue that caused bots to fail (thank you UBSan!), and reverted again in r290209 due to failures on big endian systems.
      
      After adding support for preserving endianness, this should be good now.
      
      llvm-svn: 290386
      e0e451d9
    • Ahmed Bougacha's avatar
      [AArch64] Simplify indexed-memory testcase. NFC. · 1277833a
      Ahmed Bougacha authored
      We're only testing the addressing mode on the stores; we don't
      need to load/store pointers we can simply pass/return.
      
      llvm-svn: 290385
      1277833a
    • Evgeniy Stepanov's avatar
      [cfi] Emit jump tables as a function-level inline asm. · 27d4c9b7
      Evgeniy Stepanov authored
      Use a dummy private function with inline asm calls instead of module
      level asm blocks for CFI jumptables.
      
      The main advantage is that now jumptable codegen can be affected by
      the function attributes (like target_cpu on ARM). Module level asm
      gets the default subtarget based on the target triple, which is often
      not good enough.
      
      This change also uses asm constraints/arguments to reference
      jumptable targets and aliases directly. We no longer do asm name
      mangling in an IR pass.
      
      Differential Revision: https://reviews.llvm.org/D28012
      
      llvm-svn: 290384
      27d4c9b7
    • Chris Bieneman's avatar
    • Vitaly Buka's avatar
      Replace WRAP in interceptors with memset, memmove and memcpy implementation · 9895f795
      Vitaly Buka authored
      Summary:
      According https://reviews.llvm.org/D27659#625093 WRAP adds confusing stack
      frame.
      
      Reviewers: eugenis
      
      Subscribers: kubabrecka, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28039
      
      llvm-svn: 290382
      9895f795
    • Chris Bieneman's avatar
      [ObjectYAML] MachO support for endianness · 55de3a24
      Chris Bieneman authored
      This patch adds support to the macho<->yaml tools for preserving endianness in MachO structures and DWARF data.
      
      llvm-svn: 290381
      55de3a24
    • Quentin Colombet's avatar
      [MachineVerifier] Check that even generic vregs comply to regclass constraints. · fa5960a2
      Quentin Colombet authored
      We used to not check generic vregs, but that is actually a mistake given
      nothing in the GlobalISel pipeline is going to fix the constraints on
      target specific instructions. Therefore, the target has to have them
      right from the start.
      
      llvm-svn: 290380
      fa5960a2
    • Quentin Colombet's avatar
      [AArch64] Change a test to use a generic instr instead of a target specific one. · f372150f
      Quentin Colombet authored
      Target specific instructions have requirements that are not compatible
      with what we want to test here. Namely, target specific instructions
      must have their operands properly mapped on register classes.
      
      llvm-svn: 290379
      f372150f
    • Quentin Colombet's avatar
      [MIRParser] Fix a typo in comment and error message. · e08cc599
      Quentin Colombet authored
      We have long switched from size to type.
      
      llvm-svn: 290378
      e08cc599
    • Quentin Colombet's avatar
      [AArch64][CallLowering] Constraint registers on target specific instruction · f38015e5
      Quentin Colombet authored
      The InstructionSelect pass will not look at target specific instructions
      since they are already selected. As a result, the operands of target
      specific instructions must be properly constrained, because it is not
      going to fix them.
      
      This fixes invalid register classes on call instruction.
      
      llvm-svn: 290377
      f38015e5
    • Quentin Colombet's avatar
      [MIRParser] Non-generic virtual register may have a type. · 9751e61f
      Quentin Colombet authored
      When generic virtual registers get constrained, because of a use on a
      target specific operation for instance, we end up with regular virtual
      registers with a type and that's perfectly fine.
      
      llvm-svn: 290376
      9751e61f
    • Quentin Colombet's avatar
      [RegisterBankInfo] Allow to set a register class when nothing else is set · 7e1f66d6
      Quentin Colombet authored
      This is going to be needed to be able to constraint register class on
      target specific instruction while the RegBankSelect pass did not run
      yet.
      
      llvm-svn: 290375
      7e1f66d6
    • Quentin Colombet's avatar
      [GlobalISel] Refactor the logic to constraint registers. · b4e71185
      Quentin Colombet authored
      Move the logic to constraint register from InstructionSelector to a
      utility function. It will be required by other passes in the GlobalISel
      pipeline.
      
      llvm-svn: 290374
      b4e71185
    • Evgeniy Stepanov's avatar
      Expose thread local quarantine size as ASAN option. · 37db58e9
      Evgeniy Stepanov authored
      Summary: Make thread local quarantine size an option so it can be turned off to save memory.
      
      Reviewers: eugenis
      
      Patch by Alex Shlyapnikov.
      
      Subscribers: kubabrecka, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28027
      
      llvm-svn: 290373
      37db58e9
    • Matt Arsenault's avatar
      AMDGPU: Invert cmp + select with constant · 0b26e473
      Matt Arsenault authored
      Canonicalize a select with a constant to the false side. This
      enables more instruction shrinking opportunities since an
      inline immediate can be used for the false side of v_cndmask_b32_e32.
      
      This seems to usually be better but causes some code size regressions
      in some tests.
      
      llvm-svn: 290372
      0b26e473
    • Evgeniy Stepanov's avatar
      Improve ThreadedQuarantineTest heap memory measurements. · 055f506c
      Evgeniy Stepanov authored
      Summary:
      Warm up ASAN caches in ThreadedQuarantineTest to get more predictable
      incremental heap memory usage measurements.
      
      Reviewers: eugenis
      
      Patch by Alex Shlyapnikov.
      
      Subscribers: aemerson, kubabrecka, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28061
      
      llvm-svn: 290371
      055f506c
    • Tim Shen's avatar
      [PowerPC] Add ppc support to update_llc_test_checks.py, and ppc tests. NFC. · 53ddc1d0
      Tim Shen authored
      Reviewers: chandlerc, hfinkel, echristo, iteratee
      
      Subscribers: mehdi_amini, nemanjai, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28036
      
      llvm-svn: 290370
      53ddc1d0
    • Sean Callanan's avatar
      Testbed and skeleton of a new expression parser · 7d982509
      Sean Callanan authored
      Recommitted after formal approval.
      
      LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project.
      
      Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault.
      
      Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code.
      
      I propose that the parts required to build a simple expression parser be added to Clang. Initially, I aim to have the following features:
      
      A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests.
      A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside.
      This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter. When complete, this tester will implement the first of the above goals.
      
      Differential Revision: https://reviews.llvm.org/D27180
      
      llvm-svn: 290367
      7d982509
    • Krzysztof Parzyszek's avatar
      [Hexagon] Add DAG mutations for machine pipeliner · 3885d87c
      Krzysztof Parzyszek authored
      llvm-svn: 290366
      3885d87c
    • Wei Mi's avatar
      Redo store splitting in CodeGenPrepare. · a2f0b594
      Wei Mi authored
      This is a succeeding patch of https://reviews.llvm.org/D22840 to address the
      issue when a value to be merged into an int64 pair is in a different BB. Redoing
      the store splitting in CodeGenPrepare so we can match the pattern across multiple
      BBs and move some instructions into the same BB. We still keep the code in dag
      combine so that we can catch cases that show up after DAG combining runs.
      
      Differential Revision: https://reviews.llvm.org/D25914
      
      llvm-svn: 290365
      a2f0b594
    • Alexey Bataev's avatar
      [OPENMP] Fix for PR31417: assert failure when compiling trivial openmp · 5e87c346
      Alexey Bataev authored
      program
      
      Offload related code is not quite ready yet, but some simple examples
      must not crash the compiler. Patch fixes the problem in offloading code
      with exceptions.
      
      llvm-svn: 290364
      5e87c346
    • Wei Mi's avatar
      Change the interface of TLI.isMultiStoresCheaperThanBitsMerge. · f3f01aba
      Wei Mi authored
      This is for splitMergedValStore in DAG Combine to share the target query interface
      with similar logic in CodeGenPrepare.
      
      Differential Revision: https://reviews.llvm.org/D24707
      
      llvm-svn: 290363
      f3f01aba
    • Renato Golin's avatar
      Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by... · fe8bbb23
      Renato Golin authored
      Revert "[XRay][AArch64] An attempt to fix test patching-unpatching.cc by flushing the instruction cache after code modification"
      
      This reverts commit r290354, as it broke the build. We need to make sure
      this builds on AArch64 before committing again.
      
      llvm-svn: 290362
      fe8bbb23
    • Petar Jovanovic's avatar
      [mips] Fix compact branch hazard detection, part 2 · 8a4e6399
      Petar Jovanovic authored
      Follow up to D27209 fix, this patch now properly handles single transient
      instruction in basic block.
      
      Patch by Aleksandar Beserminji.
      
      Differential Revision: https://reviews.llvm.org/D27856
      
      llvm-svn: 290361
      8a4e6399
    • Krzysztof Parzyszek's avatar
      Add the DAG mutation interface to the software pipeliner · 88391248
      Krzysztof Parzyszek authored
      llvm-svn: 290360
      88391248
    • Luke Drummond's avatar
      Fix a couple of incorrect format string warnings · 63dea591
      Luke Drummond authored
      This patch fixes use of incorrect `%zi` to format a plain `int`, and using
      `%llu` to format a `uint64_t`. The fix is to use the new typesafe
      `llvm::Formatv` based API.
      
      Differential Revision: https://reviews.llvm.org/D28028
      Subscribers: lldb-commits
      
      llvm-svn: 290359
      63dea591
    • Reid Kleckner's avatar
      Pass -Wa,-mbig-obj in 64-bit mingw builds · c2b56634
      Reid Kleckner authored
      COFF has a 2**16 section limit, and on Win64, every COMDAT function
      creates at least 3 sections: .text, .pdata, and .xdata. For MSVC, we
      enable bigobj on a file-by-file basis, but GCC appears to hit the limit
      on different files.
      
      Fixes PR25953
      
      llvm-svn: 290358
      c2b56634
    • Reid Kleckner's avatar
      Build KillTheDoctor with mingw-w64 · 143a937f
      Reid Kleckner authored
      compiler-rt uses it in its lit tests.
      
      llvm-svn: 290357
      143a937f
    • George Burgess IV's avatar
      Fix warning introduced by r290297. · a8049574
      George Burgess IV authored
      llvm-svn: 290356
      a8049574