1. Jan 10, 2018
    • Don Hinton's avatar
      [cmake] Delete redundant install command for clang-refactor. · 050b4b05
      Don Hinton authored
      Summary: Install targets for clang tools are controlled by
      CLANG_BUILD_TOOLS, and when OFF, cmake issues the following warning:
      
      WARNING: Target "clang-refactor" has EXCLUDE_FROM_ALL set and will not
      be built by default but an install rule has been provided for it.
      CMake does not define behavior for this case.
      
      Differential Revision: https://reviews.llvm.org/D41807
      
      llvm-svn: 322147
      050b4b05
    • Puyan Lotfi's avatar
      [MIR] Repurposing '$' sigil used by external symbols. Replacing with '&'. · fe6c9cbb
      Puyan Lotfi authored
      Planning to add support for named vregs. This puts is in a conundrum since
      physregs are named as well. To rectify this we need to use a sigil other than
      '%' for physregs in MIR. We've settled on using '$' for physregs but first we
      must repurpose it from external symbols using it, which is what this commit is
      all about. We think '&' will have familiar semantics for C/C++ users.
      
      llvm-svn: 322146
      fe6c9cbb
    • Sam Clegg's avatar
      [WebAssembly] Refactor symbol and symbol table to remove WasmSymbol references · 20db381b
      Sam Clegg authored
      This WasmSymbol types comes directly from the input objects
      but we want to be able to represent synthetic symbols too.
      
      This is more in line with how the ELF linker represents symbols.
      
      This change also removes the logic from Symbol::getVirtualAddress
      for finding the global address and instead has the InputFile
      provide this.
      
      Differential Revision: https://reviews.llvm.org/D41426
      
      llvm-svn: 322145
      20db381b
    • Stephan T. Lavavej's avatar
      [libcxx] [test] Improve MSVC portability. · 04576cc0
      Stephan T. Lavavej authored
      test/support/msvc_stdlib_force_include.hpp
      When testing MSVC's STL with C1XX, simulate a couple more compiler feature-test macros.
      
      When testing MSVC's STL, simulate a few library feature-test macros.
      
      test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
      The vector_size attribute is a non-Standard extension that's supported by Clang and GCC,
      but not C1XX. Therefore, guard this with `__has_attribute(vector_size)`.
      
      Additionally, while these tests pass when MSVC's STL is compiled with Clang,
      I don't consider this to be a supported scenario for our library,
      so also guard this with defined(_LIBCPP_VERSION).
      
      test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
      N4713 23.14.10 [func.not_fn]/1 depicts only `call_wrapper(call_wrapper&&) = default;`
      and `call_wrapper(const call_wrapper&) = default;`. According to
      15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable.
      Therefore, guard the assignability tests as libc++ specific.
      
      Add a (void) cast to tolerate not_fn() being marked as nodiscard.
      
      Fixes D41213.
      
      llvm-svn: 322144
      04576cc0
    • Sam Clegg's avatar
      [llvm-readobj] Consistent use of ScopedPrinter · 88e9a15b
      Sam Clegg authored
      There were a few places where outs() was being used
      directly rather than the ScopedPrinter object.
      
      Differential Revision: https://reviews.llvm.org/D41370
      
      llvm-svn: 322141
      88e9a15b
    • Lang Hames's avatar
      [ORC] Re-apply r321838 again with a workaround for a bug present in the libcxx · 9510447a
      Lang Hames authored
      version being used on some of the green dragon builders (plus a clang-format).
      
      Workaround: AsynchronousSymbolQuery and VSO want to work with
      JITEvaluatedSymbols anyway, so just use them (instead of JITSymbol, which
      happens to tickle the bug).
      
      The libcxx bug being worked around was fixed in r276003, and there are plans to
      update the offending builders.
      
      llvm-svn: 322140
      9510447a
    • Vlad Tsyrklevich's avatar
      LowerTypeTests: Add limited support for aliases · cdec22ef
      Vlad Tsyrklevich authored
      Summary:
      LowerTypeTests moves some function definitions from individual object
      files to the merged module, leaving a stub to be called in the merged
      module's jump table. If an alias was pointing to such a function
      definition LowerTypeTests would fail because the alias would be left
      without a definition to point to.
      
      This change 1) emits information about aliases to the ThinLTO summary,
      2) replaces aliases pointing to function definitions that are moved to
      the merged module with function declarations, and 3) re-emits those
      aliases in the merged module pointing to the correct function
      definitions.
      
      The patch does not correctly fix all possible mis-uses of aliases in
      LowerTypeTests. For example, it does not handle aliases with a different
      type from the pointed to function.
      
      The addition of alias data increases the size of Chrome build artifacts
      by less than 1%.
      
      Reviewers: pcc
      
      Reviewed By: pcc
      
      Subscribers: mehdi_amini, eraman, mgrang, llvm-commits, eugenis, kcc
      
      Differential Revision: https://reviews.llvm.org/D41741
      
      llvm-svn: 322139
      cdec22ef
    • Sam Clegg's avatar
      [WebAssembly] Output functions individually · 8d146bbc
      Sam Clegg authored
      The code section is now written out one function
      at a time rather than all the functions in a given
      objects being serialized at once.
      
      This change lays the groundwork for supporting
      --gc-sections.
      
      Differential Revision: https://reviews.llvm.org/D41315
      
      llvm-svn: 322138
      8d146bbc
    • Michael Zolotukhin's avatar
    • Adrian McCarthy's avatar
      Reland "Emit Function IDs table for Control Flow Guard" · db2736dd
      Adrian McCarthy authored
      Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs
      of functions that have their address taken into a section named .gfids$y for
      compatibility with Microsoft's Control Flow Guard feature.
      
      The original patch didn't have the lit.local.cfg file that restricts the new
      test to x86, thus the new test was failing on the non-x86 bots.
      
      Differential Revision: https://reviews.llvm.org/D40531
      
      The reverts r322008, which was a revert of r322005.
      
      This reverts commit a05b89f9aca70597dc79fe97bc49b50b51f525ba.
      
      llvm-svn: 322136
      db2736dd
    • Sam Clegg's avatar
      [WebAssembly] Add COMDAT support · ea7cacee
      Sam Clegg authored
      This adds COMDAT support to the Wasm object-file format.
      Spec: https://github.com/WebAssembly/tool-conventions/pull/31
      
      Corresponding LLD change:
      https://bugs.llvm.org/show_bug.cgi?id=35533, and D40845
      
      Patch by Nicholas Wilson
      
      Differential Revision: https://reviews.llvm.org/D40844
      
      llvm-svn: 322135
      ea7cacee
    • Paul Robinson's avatar
      [DWARFv5] MC support for MD5 file checksums · 29f5f987
      Paul Robinson authored
      Extend .file directive syntax to allow specifying an MD5 checksum for
      the source file.  Emit the checksums in DWARF v5 line tables.
      
      llvm-svn: 322134
      29f5f987
    • Eric Christopher's avatar
      Tidy some grammar in some comments · d72f78e7
      Eric Christopher authored
      llvm-svn: 322133
      d72f78e7
    • Jake Ehrlich's avatar
      temp · 99482fda
      Jake Ehrlich authored
      llvm-svn: 322132
      99482fda
    • Rafael Espindola's avatar
      Use a MCExpr for the size of MCFillFragment. · d707c370
      Rafael Espindola authored
      This allows the size to be found during ralaxation. This fixes
      pr35858.
      
      llvm-svn: 322131
      d707c370
    • Sam Clegg's avatar
      [WebAssembly] MC: Use zero for provisional value of undefined symbols · 270ed1b3
      Sam Clegg authored
      This is more in line with what happens in the final
      executable when symbols are undefined (i.e. weak
      references).
      
      Differential Revision: https://reviews.llvm.org/D41840
      
      llvm-svn: 322130
      270ed1b3
    • Rafael Espindola's avatar
      Add a test. · 94a72b99
      Rafael Espindola authored
      Currently we don't have any tests for this error case.
      
      llvm-svn: 322129
      94a72b99
    • Jason Molenda's avatar
      This change updates the deployment target for lldb and debugserver · 6b7daba6
      Jason Molenda authored
      (built with Xcode) from 10.9 to 10.11.  It also enables the use of
      libcompression in debugserver by default (these API are only present
      in macOS 10.11 and newer -- 10.11 was released c. Sep 2015).
      
      I don't know if we have people / bots building lldb on older mac
      releases; if this turns out to be a problem I will revert the change.
      There are some parts of lldb (e.g. debugserer's ability to report
      the OS version #) that only work with 10.10 and this changes the
      behavior of lldb (whether the older or newer dyld interfaces are
      used) so there is some importance to updating the min required
      version.
      
      llvm-svn: 322128
      6b7daba6
    • David Blaikie's avatar
      ADT: Add a range-based version of std::copy · 5ccff0f9
      David Blaikie authored
      llvm-svn: 322127
      5ccff0f9
    • David Blaikie's avatar
      Wire up GCOV to the new pass manager · 7a4f7f56
      David Blaikie authored
      GCOV in the old pass manager also strips debug info (if debug info is
      disabled/only produced for profiling anyway) after the GCOV pass runs.
      
      I think the strip pass hasn't been ported to the new pass manager, so it
      might take me a little while to wire that up.
      
      llvm-svn: 322126
      7a4f7f56
    • Chris Bieneman's avatar
      [IPSCCP] Remove calls without side effects · abdea268
      Chris Bieneman authored
      Summary:
      When performing constant propagation for call instructions we have historically replaced all uses of the return from a call, but not removed the call itself. This is required for correctness if the calls have side effects, however the compiler should be able to safely remove calls that don't have side effects.
      
      This allows the compiler to completely fold away calls to functions that have no side effects if the inputs are constant and the output can be determined at compile time.
      
      Reviewers: davide, sanjoy, bruno, dberlin
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D38856
      
      llvm-svn: 322125
      abdea268
    • Stefan Pintilie's avatar
      [PowerPC] Manually schedule the prologue and epilogue · 17127008
      Stefan Pintilie authored
      This patch makes the following changes to the schedule of instructions in the
      prologue and epilogue.
      
      The stack pointer update is moved down in the prologue so that the callee saves
      do not have to wait for the update to happen.
      Saving the lr is moved down in the prologue to hide the latency of the mflr.
      The stack pointer is moved up in the epilogue so that restoring of the lr can
      happen sooner.
      The mtlr is moved up in the epilogue so that it is away form the blr at the end
      of the epilogue. The latency of the mtlr can now be hidden by the loads of the
      callee saved registers.
      
      This commit is almost identical to this one: r322036 except that two warnings
      that broke build bots have been fixed.
      
      The revision number is D41737 as before.
      
      llvm-svn: 322124
      17127008
    • Rafael Espindola's avatar
      Don't create MCFillFragment directly. · 07657a8d
      Rafael Espindola authored
      Instead use higher level APIs that take care of most bookkeeping.
      
      llvm-svn: 322123
      07657a8d
    • Sam Clegg's avatar
      [WebAssembly] Update YAML in tests to match LLVM change · f50534b1
      Sam Clegg authored
      Differential Revision: https://reviews.llvm.org/D41878
      
      llvm-svn: 322122
      f50534b1
    • Sam Clegg's avatar
      [WebAssembly] Explicitly specify function/global index space in YAML · e53af7f6
      Sam Clegg authored
      These indexes are useful because they are not always zero based and
      functions and globals are referenced elsewhere by their index.
      
      This matches what we already do for the type index space.
      
      Differential Revision: https://reviews.llvm.org/D41877
      
      llvm-svn: 322121
      e53af7f6
    • Tim Renouf's avatar
      [SelectionDAG] Fixed f16-from-vector promotion problem · d68fa1be
      Tim Renouf authored
      Summary:
      In the case of an fp_extend of v1f16 to v1f32 where the v1f16 is the
      result of a bitcast from i16, avoid creating an illegal fp16_to_fp where
      the input is not a vector and the result is a v1f32.
      
      V2: The fix is now to avoid vector scalarization creating a v1->scalar
      bitcast.
      
      Reviewers: srhines, t.p.northover
      
      Subscribers: nhaehnle, llvm-commits, dstuttard, t-tye, yaxunl, wdng, kzhuravl, arsenm
      
      Differential Revision: https://reviews.llvm.org/D41126
      
      llvm-svn: 322120
      d68fa1be
    • Tim Renouf's avatar
      [AMDGPU] Fixed incorrect uniform branch condition · 6eaad1e5
      Tim Renouf authored
      Summary:
      I had a case where multiple nested uniform ifs resulted in code that did
      v_cmp comparisons, combining the results with s_and_b64, s_or_b64 and
      s_xor_b64 and using the resulting mask in s_cbranch_vccnz, without first
      ensuring that bits for inactive lanes were clear.
      
      There was already code for inserting an "s_and_b64 vcc, exec, vcc" to
      clear bits for inactive lanes in the case that the branch is instruction
      selected as s_cbranch_scc1 and is then changed to s_cbranch_vccnz in
      SIFixSGPRCopies. I have added the same code into SILowerControlFlow for
      the case that the branch is instruction selected as s_cbranch_vccnz.
      
      This de-optimizes the code in some cases where the s_and is not needed,
      because vcc is the result of a v_cmp, or multiple v_cmp instructions
      combined by s_and/s_or. We should add a pass to re-optimize those cases.
      
      Reviewers: arsenm, kzhuravl
      
      Subscribers: wdng, yaxunl, t-tye, llvm-commits, dstuttard, timcorringham, nhaehnle
      
      Differential Revision: https://reviews.llvm.org/D41292
      
      llvm-svn: 322119
      6eaad1e5
    • Brian Gesiak's avatar
      [Frontend] Remove unused FileMgr in pp arg parse · f0ef137b
      Brian Gesiak authored
      Summary:
      A FIXME added 8 years ago (2010) in https://reviews.llvm.org/rL118203
      mentioned that a FileManager should not need to be used when parsing
      preprocessor arguments. In fact, its only use was removed 6 years ago
      (2012), in https://reviews.llvm.org/rL166452. Remove the unused
      variable and the obsolete FIXME.
      
      Test Plan: `check-clang`
      
      Reviewers: v.g.vassilev
      
      Reviewed By: v.g.vassilev
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D41867
      
      llvm-svn: 322118
      f0ef137b
    • Rui Ueyama's avatar
      [COFF] Process /EXPORT option in fastpath · 5fa0d6e4
      Rui Ueyama authored
      Patch by Takuto Ikuta.
      
      This patch reduces lld link time of chromium's blink_core.dll in
      component build.
      
      Total size of input argument in .directives become nearly 300MB in the
      build and almost all its content are /EXPORT.
      
      To reduce time of parsing too many /EXPORT option in the build, I
      introduce fastpath for /EXPORT in ArgParser::parseDirectives.
      
      On my desktop machine, 4 times stats of the link time are like below.
      Improved around 20%.
      
      This patch
      TotalSeconds : 8.6217627
      TotalSeconds : 8.5402175
      TotalSeconds : 8.6855853
      TotalSeconds : 8.3624441
      Ave : 8.5525024
      
      master
      TotalSeconds : 10.9975031
      TotalSeconds : 11.3409428
      TotalSeconds : 10.6332897
      TotalSeconds : 10.7650687
      Ave : 10.934201075
      
      llvm-svn: 322117
      5fa0d6e4
    • Eric Liu's avatar
      Try to fix build failure caused by r322097 · 72b3855b
      Eric Liu authored
      Avoid mapping during output when Detail is nullptr; otherwise, an empty
      "Detail" field will be populated in YAML output.
      
      llvm-svn: 322116
      72b3855b
    • Daniel Berlin's avatar
      NewGVN: Fix PR/33367, which was causing us to delete non-copy intrinsics... · 56cca743
      Daniel Berlin authored
      NewGVN: Fix PR/33367, which was causing us to delete non-copy intrinsics accidentally in some rare cases
      
      llvm-svn: 322115
      56cca743
    • Hubert Tong's avatar
      Profiling tests: Endianess XFAIL for powerpc- (32-bit) · 55662a8e
      Hubert Tong authored
      Add powerpc- (32-bit) as XFAIL for tests that are documented either in-
      line or via commit messages as expected to fail on big-endian systems.
      
      Tests not documented in-line are documented in commit messages as
      follows:
      r211172 - test/tools/llvm-cov/llvm-cov.test
      r247920 - test/Transforms/SampleProfile/gcc-simple.ll
      
      llvm-svn: 322114
      55662a8e
    • Rafael Espindola's avatar
      Don't duplicate names in comments. NFC. · 22e1c14c
      Rafael Espindola authored
      llvm-svn: 322113
      22e1c14c
    • Alexey Bataev's avatar
      768f1f21
    • Rafael Espindola's avatar
      Inline a emitFill variant that is only used once. NFC. · e70ececa
      Rafael Espindola authored
      llvm-svn: 322111
      e70ececa
    • Easwaran Raman's avatar
      Add a pass to generate synthetic function entry counts. · bdf20261
      Easwaran Raman authored
      Summary:
      This pass synthesizes function entry counts by traversing the callgraph
      and using the relative block frequencies of the callsites. The intended
      use of these counts is in inlining to determine hot/cold callsites in
      the absence of profile information.
      
      The pass is split into two files with the code that propagates the
      counts in a callgraph in a Utils file. I plan to add support for
      propagation in the thinlto link phase and the propagation code will be
      shared and hence this split. I did not add support to the old PM since
      hot callsite determination in inlining is not possible in old PM
      (although we could use hot callee heuristic with synthetic counts in the
      old PM it is not worth the effort tuning it)
      
      Reviewers: davidxl, silvas
      
      Subscribers: mgorny, mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41604
      
      llvm-svn: 322110
      bdf20261
    • Brian Gesiak's avatar
      [Option] For typo '-foo', suggest '--foo' · d481df53
      Brian Gesiak authored
      Summary:
      https://reviews.llvm.org/rL321877 introduced the `OptTable::findNearest`
      method, to find the closest edit distance option for a given string.
      However, the implementation contained a bug: for a typo `-foo` with an
      edit distance of 1 away from a valid option `--foo`, `findNearest`
      would suggest a nearby option of `foo`. That is, the result would not
      include the `--` prefix, and so was not a valid option.
      
      Fix the bug by ensuring that the prefix string is initialized to one of
      the valid prefixes for the option.
      
      Test Plan: `check-llvm-unit`
      
      Reviewers: v.g.vassilev, teemperor, ruiu, jroelofs, yamaguchi
      
      Reviewed By: jroelofs
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41873
      
      llvm-svn: 322109
      d481df53
    • Rafael Espindola's avatar
      Make one of the emitFill methods non virtual. NFC. · 8fcd07d5
      Rafael Espindola authored
      This is just preparatory work to fix PR35858.
      
      llvm-svn: 322108
      8fcd07d5
    • Alexey Bataev's avatar
      [OpenMP] Fix handling of clause on wrong directive, by Joel. E. Denny · f3c832a9
      Alexey Bataev authored
      Summary:
      First, this patch fixes an assert failure when, for example, "omp for"
      has num_teams.
      
      Second, this patch prevents duplicate diagnostics when, for example,
      "omp for" has uniform.
      
      This patch makes the general assumption (even where it doesn't
      necessarily fix an existing bug) that it is worthless to perform sema
      for a clause that appears on a directive on which OpenMP does not
      permit that clause.  However, due to this assumption, this patch
      suppresses some diagnostics that were expected in the test suite.  I
      assert that those diagnostics were likely just distracting to the
      user.
      
      Reviewers: ABataev
      
      Reviewed By: ABataev
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D41841
      
      llvm-svn: 322107
      f3c832a9
    • Alexey Bataev's avatar
      [COST]Fix PR35865: Fix cost model evaluation for shuffle on X86. · 771ec9f3
      Alexey Bataev authored
      Summary:
      If the vector type is transformed to non-vector single type, the compile
      may crash trying to get vector information about non-vector type.
      
      Reviewers: RKSimon, spatel, mkuper, hfinkel
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D41862
      
      llvm-svn: 322106
      771ec9f3