Commit Graph

327 Commits

Author SHA1 Message Date
Dimitry Andric
1286cb8390 Add llvm patch corresponding to r289072. 2015-10-09 21:00:04 +00:00
Dimitry Andric
d361766d4b Temporarily revert upstream llvm trunk r240144 (by Michael Zolotukhin):
[SLP] Vectorize for all-constant entries.

This should fix libc++'s iostream initialization SIGBUSing on amd64,
whenever the global cout symbol is not aligned to 16 bytes.

Some further explanation: libc++'s iostream.cpp contains the definitions
of std::cout, std::cerr and so on.  These global objects are effectively
declared with an alignment of 8 bytes.  When an executable is linked
against libc++.so, it can sometimes get a copy of the global object,
which is then at the same alignment.

However, with clang 3.7.0, the initialization of these global objects
will incorrectly use SSE instructions (e.g. movdqa), whenever the
optimization level is high enough, and SSE is enabled, such as on amd64.
When any of these objects is not aligned to 16 bytes, this will result
in a SIGBUS during iostream initialization.  In contrast, clang 3.6.x
and earlier took the 8 byte alignment into consideration, and avoided
SSE for those particular operations.

After bisecting of upstream changes, I found that the above revision
caused the change of this behavior, so I am reverting it now as a
workaround, while a discussion and test case is being prepared for
upstream.
2015-10-09 18:21:45 +00:00
Dimitry Andric
ba96f361ba Add llvm patch corresponding to r288195. 2015-09-25 18:21:48 +00:00
Dimitry Andric
98e67009c0 Merge ^/head r288126 through r288196. 2015-09-24 21:48:04 +00:00
Dimitry Andric
a502cd2f72 Pull in r248439 from upstream llvm trunk (by Sanjay Patel):
set div/rem default values to 'expensive' in TargetTransformInfo's
  cost model

  ...because that's what the cost model was intended to do.

  As discussed in D12882, this fix has a temporary unintended
  consequence for SimplifyCFG: it causes us to not speculate an fdiv.
  However, two wrongs make PR24818 right, and two wrongs make PR24343
  act right even though it's really still wrong.

  I intend to correct SimplifyCFG and add to CodeGenPrepare to account
  for this cost model change and preserve the righteousness for the bug
  report cases.

  https://llvm.org/bugs/show_bug.cgi?id=24818
  https://llvm.org/bugs/show_bug.cgi?id=24343

  Differential Revision: http://reviews.llvm.org/D12882

This fixes the too-eager fdiv hoisting in pow(), which could lead to
unexpected floating point exceptions.
2015-09-24 21:20:00 +00:00
Ed Maste
8c034f6af7 Bring LLVM libunwind snapshot into contrib/llvm/projects 2015-09-23 19:30:46 +00:00
Dimitry Andric
977b468e25 Add clang patch corresponding to r288127. 2015-09-22 20:42:14 +00:00
Dimitry Andric
f3d77c91e9 Pull in r244063 from upstream clang trunk (by James Y Knight):
Add missing atomic libcall support.

  Support for emitting libcalls for __atomic_fetch_nand and
  __atomic_{add,sub,and,or,xor,nand}_fetch was missing; add it, and some
  test cases.

  Differential Revision: http://reviews.llvm.org/D10847

This fixes "cannot compile this atomic library call yet" errors when
compiling code which calls the above builtins, on arm < v6.
2015-09-22 20:39:59 +00:00
Dimitry Andric
883df6251d Revert merge of clang trunk r244063, which I did not intend to commit
yet.  Reminder to self: never merge to an unclean tree.
2015-09-22 10:00:32 +00:00
Dimitry Andric
26e065d02e Merge ^/head r288035 through r288099. 2015-09-22 09:50:11 +00:00
Dimitry Andric
c394288fa5 The R600 target got renamed to AMDGPU, but I missed deleting the old
directory during the vendor import.  Delete it now.
2015-09-21 22:34:16 +00:00
Dimitry Andric
2dd978e891 Drop a patch which is already included in 3.7.0. 2015-09-21 22:29:43 +00:00
Dimitry Andric
b6c25e0ef3 Update llvm, clang and lldb to 3.7.0 release. 2015-09-06 19:58:48 +00:00
Dimitry Andric
b91a7dfcc6 Update lldb to upstream trunk r242221. 2015-09-06 15:21:47 +00:00
Dimitry Andric
1757ba14bf Merge ^/head r287490 through r287501. 2015-09-06 12:02:28 +00:00
Dimitry Andric
7ff2ee1244 Update lldb's FREEBSD-Xlist to match reality. 2015-09-06 11:48:50 +00:00
Dimitry Andric
b10d76f080 Import r243925 from the upstream clang release_37 branch:
Reverting r239883 and r240720:
------------------------------------------------------------------------
r239883 | echristo | 2015-06-17 00:09:32 -0700 (Wed, 17 Jun 2015) | 16 lines

Update the intel intrinsic headers to use the target attribute support.

This involved removing the conditional inclusion and replacing them
with target attributes matching the original conditional inclusion
and checks. The testcase update removes the macro checks for each
file and replaces them with usage of the __target__ attribute, e.g.:

int __attribute__((__target__(("sse3")))) foo(int a) {
  _mm_mwait(0, 0);
  return 4;
}

This usage does require the enclosing function have the requisite
__target__ attribute for inlining and code generation - also for
any macro intrinsic uses in the enclosing function. There's no change
for existing uses of the intrinsic headers.
------------------------------------------------------------------------

------------------------------------------------------------------------
r240720 | silvas | 2015-06-25 16:22:11 -0700 (Thu, 25 Jun 2015) | 6 lines

Remove `requires` for x86 CPU features.

Ever since the target attributes change, we don't need to guard these
headers with `requires`. Actually it's a bit worse, because if we do
then they are included textually under the covers, causing declarations
to appear in submodules they aren't supposed to be in.
------------------------------------------------------------------------

This reverts the changes to the intrinsics headers in trunk, which could
result in some ports' configure scripts misdetecting SSE (and higher)
support.
2015-08-18 19:03:59 +00:00
Dimitry Andric
875ed54817 Update llvm/clang to r242221. 2015-08-12 18:31:11 +00:00
Dimitry Andric
1347814ced Merge ^/head r285924 through r286421. 2015-08-07 20:18:55 +00:00
Ed Maste
93d8f98ac7 Remove claim that the OS is Darwin from lldb(1)
Reported by:	bapt
2015-07-28 13:09:16 +00:00
Dimitry Andric
3dac3a9bad Update llvm/clang to r241361. 2015-07-05 22:34:42 +00:00
Dimitry Andric
4cd9b24e47 Merge ^/head r284737 through r285152. 2015-07-04 21:50:39 +00:00
Dimitry Andric
b41932d54e Add llvm patch corresponding to r285149. 2015-07-04 20:09:24 +00:00
Dimitry Andric
5f4899dbfe Pull in r241142 from upstream llvm trunk (by David Majnemer):
[SCCP] Turn loads of null into undef instead of zero initialized values

  Surprisingly, this is a correctness issue: the mmx type exists for
  calling convention purposes, LLVM doesn't have a zero representation for
  them.

  This partially fixes PR23999.

Pull in r241143 from upstream llvm trunk (by David Majnemer):

  [LoopUnroll] Use undef for phis with no value live

  We would create a phi node with a zero initialized operand instead of
  undef in the case where no value was originally available.  This was
  problematic for x86_mmx which has no null value.

These fix a "Cannot create a null constant of that type!" error when
compiling the graphics/sdl2_gfx port with MMX enabled.

Reported by:	amdmi3
2015-07-04 20:07:37 +00:00
Ed Maste
1c3bbb013d Update LLDB snapshot to upstream r241361
Notable upstream commits (upstream revision in parens):

- Add a JSON producer to LLDB (228636)
- Don't crash on bad DWARF expression (228729)
- Add support of DWARFv3 DW_OP_form_tls_address (231342)
- Assembly profiler for MIPS64 (232619)
- Handle FreeBSD/arm64 core files (233273)
- Read/Write register for MIPS64 (233685)
- Rework LLDB system initialization (233758)
- SysV ABI for aarch64 (236098)
- MIPS software single stepping (236696)
- FreeBSD/arm live debugging support (237303)
- Assembly profiler for mips32 (237420)
- Parse function name from DWARF DW_AT_abstract_origin (238307)
- Improve LLDB prompt handling (238313)
- Add real time signals support to FreeBSDSignals (238316)
- Fix race in IOHandlerProcessSTDIO (238423)
- MIPS64 Branch instruction emulation for SW single stepping (238820)
- Improve OSType initialization in elf object file's arch_spec (239148)
- Emulation of MIPS64 floating-point branch instructions (239996)
- ABI Plugin for MIPS32 (239997)
- ABI Plugin for MIPS64 (240123)
- MIPS32 branch emulation and single stepping (240373)
- Improve instruction emulation based stack unwinding on ARM (240533)
- Add branch emulation to aarch64 instruction emulator (240769)
2015-07-04 01:02:43 +00:00
Dimitry Andric
8f0fd8f6b8 Update llvm/clang to r240225. 2015-06-23 18:44:19 +00:00
Dimitry Andric
97bc6c731e Update Makefiles and other build glue for llvm/clang 3.7.0, as of trunk
r239412.
2015-06-10 19:12:52 +00:00
Dimitry Andric
021049273c Drop llvm/clang patches which are no longer necessary. 2015-05-30 15:36:23 +00:00
Dimitry Andric
b736063065 Update FREEBSD-Xlist files for llvm and clang. 2015-05-27 20:58:54 +00:00
Dimitry Andric
33956c4300 Merge clang trunk r238337 from ^/vendor/clang/dist, resolve conflicts,
and preserve our customizations, where necessary.
2015-05-27 20:44:45 +00:00
Dimitry Andric
ff0cc061ec Merge llvm trunk r238337 from ^/vendor/llvm/dist, resolve conflicts, and
preserve our customizations, where necessary.
2015-05-27 20:26:41 +00:00
Dimitry Andric
ef6fa9e26d Upgrade our copy of clang and llvm to 3.6.1 release.
This release contains the following cherry-picked revisions from
upstream trunk:

  226124 226151 226164 226165 226166 226407 226408 226409 226652
  226905 226983 227084 227087 227089 227208 227209 227210 227211
  227212 227213 227214 227269 227430 227482 227503 227519 227574
  227822 227986 227987 227988 227989 227990 228037 228038 228039
  228040 228188 228189 228190 228273 228372 228373 228374 228403
  228765 228848 228918 229223 229225 229226 229227 229228 229230
  229234 229235 229236 229238 229239 229413 229507 229680 229750
  229751 229752 229911 230146 230147 230235 230253 230255 230469
  230500 230564 230603 230657 230742 230748 230956 231219 231237
  231245 231259 231280 231451 231563 231601 231658 231659 231662
  231984 231986 232046 232085 232142 232176 232179 232189 232382
  232386 232389 232425 232438 232443 232675 232786 232797 232943
  232957 233075 233080 233351 233353 233409 233410 233508 233584
  233819 233904 234629 234636 234891 234975 234977 235524 235641
  235662 235931 236099 236306 236307

Please note that from 3.5.0 onwards, clang and llvm require C++11
support to build; see UPDATING for more information.
2015-05-25 13:43:03 +00:00
Dimitry Andric
867073d7fb Add llvm patch corresponding to r281775. 2015-04-20 17:37:37 +00:00
Dimitry Andric
98095a5dd2 Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):
MC: Allow multiple comma-separated expressions on the .uleb128 directive.

  For compatiblity with GNU as. Binutils documents this as
  '.uleb128 expressions'. Subtle, isn't it?

Reported by:	sbruno
PR:		199554
MFC after:	3 days
2015-04-20 17:36:35 +00:00
Dimitry Andric
ebfc641e4e Update FREEBSD-Xlist for llvm. 2015-04-03 19:49:39 +00:00
Dimitry Andric
fe2efc8c43 Add the llvm-cov and llvm-profdata tools, when WITH_CLANG_EXTRAS is
defined.  These help with processing coverage and profile data.
2015-04-03 19:43:39 +00:00
Dimitry Andric
1f26983742 Add clang patch corresponding to r281046. 2015-04-03 18:42:38 +00:00
Dimitry Andric
de460a4881 Pull in r227115 from upstream clang trunk (by Ben Langmuir):
Fix assert instantiating string init of static variable

  ... when the variable's type is a typedef of a ConstantArrayType. Just
  look through the typedef (and any other sugar).  We only use the
  constant array type here to get the element count.

This fixes an assertion failure when building the games/redeclipse port.

Reported by:	amdmi3
2015-04-03 18:38:37 +00:00
Dimitry Andric
830e9b84d8 Add llvm patch corresponding to r280865. 2015-03-30 20:23:06 +00:00
Ed Maste
e93a7dab19 llvm: Backport upstream r229195 to fix arm64 TLS relocations
As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the GNU
  linkers ld.bfd and ld.gold currently only support a subset of the
  whole range of AArch64 ELF TLS relocations. Furthermore, they assume
  that some of the code sequences to access thread-local variables are
  produced in a very specific sequence.  When the sequence is not as the
  linker expects, it can silently mis-relaxe/mis-optimize the
  instructions.
  Even if that wouldn't be the case, it's good to produce the exact
  sequence, as that ensures that linkers can perform optimizing
  relaxations.

  This patch:

  * implements support for 16MiB TLS area size instead of 4GiB TLS area
    size. Ideally clang would grow an -mtls-size option to allow support
    for both, but that's not part of this patch.
  * by default doesn't produce local dynamic access patterns, as even
    modern ld.bfd and ld.gold linkers do not support the associated
    relocations. An option (-aarch64-elf-ldtls-generation) is added to
    enable generation of local dynamic code sequence, but is off by
    default.
  * makes sure that the exact expected code sequence for local dynamic
    and general dynamic accesses is produced, by making use of a new
    pseudo instruction. The patch also removes two
    (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing
    AArch64-specific pseudo SDNode instructions that are superseded by
    the new one (TLSDESC_CALLSEQ).

Submitted by:	Kristof Beyls
Differential Revision:	https://reviews.freebsd.org/D2175
2015-03-30 20:01:41 +00:00
Ed Maste
e3327e3942 Import lldb r233478: Fix build failure on Freebsd with gcc 4.9.
llvm.org/pr23051

Submitted by:	rodrigc
2015-03-28 18:29:13 +00:00
Ed Maste
acf33b5c74 lldb: Move debug register output into __amd64__
This debug register diagnostic is really only applicable to amd64 at
present.

Sponsored by:	The FreeBSD Foundation
2015-03-27 19:42:38 +00:00
Dimitry Andric
24db767d81 Add llvm patch corresponding to r280400. 2015-03-23 21:15:07 +00:00
Dimitry Andric
c738625756 Pull in r230348 from upstream llvm trunk (by Tim Northover):
ARM: treat [N x i32] and [N x i64] as AAPCS composite types

  The logic is almost there already, with our special homogeneous
  aggregate handling. Tweaking it like this allows front-ends to emit
  AAPCS compliant code without ever having to count registers or add
  discarded padding arguments.

  Only arrays of i32 and i64 are needed to model AAPCS rules, but I
  decided to apply the logic to all integer arrays for more consistency.

This fixes a possible "Unexpected member type for HA" error when
compiling lib/msun/bsdsrc/b_tgamma.c for armv6.

Reported by:	Jakub Palider <jpa@semihalf.com>
2015-03-23 21:13:29 +00:00
Dimitry Andric
be01698709 Add FREEBSD-Xlist files for llvm, clang and lldb.
These are generated, and not "optimized" in any way, since I am not
entirely sure of the syntax or format of this type of file.  Feel free
to suggest ways of shortening these lists.

The general idea is the same for all three files, though:
* Get rid of upstream build infrastructure (CMakeLists, Makefiles, etc)
* Delete tests, tools and utilities we don't want or use (including
  samples)
* Remove various bits of upstream metadata files that we don't want or
  use (.arcconfig, .gitignore, etc)
2015-03-22 17:56:49 +00:00
Dimitry Andric
08122893fe Update README for the 3.6.0 release. 2015-03-09 21:31:37 +00:00
Dimitry Andric
cef93a3d52 Merge llvm 3.6.0 final from ^/vendor/llvm/dist, merge clang 3.6.0 final
from ^/vendor/clang/dist, and resolve conflicts.
2015-02-25 18:50:24 +00:00
Dimitry Andric
79a79bd7c1 Belatedly add llvm patch corresponding to r278367. 2015-02-22 16:28:24 +00:00
Dimitry Andric
9b2a0d91b8 Merge ^/head r279023 through r279162. 2015-02-22 16:04:37 +00:00
Dimitry Andric
680ef382a2 Add llvm patch corresponding to r279161. 2015-02-22 15:56:16 +00:00