Commit Graph

191306 Commits

Author SHA1 Message Date
Eric Christopher c8c76853b9 Fix a problem where the AArch64 ELF assembler was failing with
-no-exec-stack. This was due to it not deriving from the correct
asm info base class and missing the override for the exec
stack section query. Added another line to the noexec test
line to make sure this doesn't regress.

llvm-svn: 227074
2015-01-26 06:32:17 +00:00
Nico Weber b3a9978dc8 Don't let virtual calls and dynamic casts call Sema::MarkVTableUsed().
clang currently calls MarkVTableUsed() for classes that get their virtual
methods called or that participate in a dynamic_cast. This is unnecessary,
since CodeGen only emits vtables when it generates constructor, destructor, and
vtt code. (*)

Note that Sema::MarkVTableUsed() doesn't cause the emission of a vtable.
Its main user-visible effect is that it instantiates virtual member functions
of template classes, to make sure that if codegen decides to write a vtable
all the entries in the vtable are defined.

While this shouldn't change the behavior of codegen (other than being faster),
it does make clang more permissive: virtual methods of templates (in particular
destructors) end up being instantiated less often. In particular, classes that
have members that are smart pointers to incomplete types will now get their
implicit virtual destructor instantiated less frequently. For example, this
used to not compile but does now compile:

    template <typename T> struct OwnPtr {
      ~OwnPtr() { static_assert((sizeof(T) > 0), "TypeMustBeComplete"); }
    };
    class ScriptLoader;
    struct Base { virtual ~Base(); };
    struct Sub : public Base {
      virtual void someFun() const {}
      OwnPtr<ScriptLoader> m_loader;
    };
    void f(Sub *s) { s->someFun(); }

The more permissive behavior matches both gcc (where this is not often
observable, since in practice most things with virtual methods have a key
function, and Sema::DefineUsedVTables() skips vtables for classes with key
functions) and cl (which is my motivation for this change) – this fixes
PR20337.  See this issue and the review thread for some discussions about
optimizations.

This is similar to r213109 in spirit. r225761 was a prerequisite for this
change.

Various tests relied on "a->f()" marking a's vtable as used (in the sema
sense), switch these to just construct a on the stack. This forces
instantiation of the implicit constructor, which will mark the vtable as used.

(*) The exception is -fapple-kext mode: In this mode, qualified calls to
virtual functions (`a->Base::f()`) still go through the vtable, and since the
vtable pointer off this doesn't point to Base's vtable, this needs to reference
Base's vtable directly. To keep this working, keep referencing the vtable for
virtual calls in apple kext mode.

llvm-svn: 227073
2015-01-26 06:23:36 +00:00
Nico Weber 220b3ad598 Test that member functions of constexpr constructed templates are instantiated.
They are referenced from the vtable. (This worked fine, but I couldn't find
an existing test for this.  Maybe I didn't look hard enough.)

llvm-svn: 227072
2015-01-26 06:08:07 +00:00
Nico Weber 4a18449c2c Remove -verify from a codegen test that didn't have any expected-foo lines.
Makes the error output of the test more readable when it fails. Also allows
removing a "not" from the run line.

llvm-svn: 227071
2015-01-26 05:47:24 +00:00
Yaron Keren 3bf8462331 clang-format two Decl* code locations, NFC.
llvm-svn: 227070
2015-01-26 04:41:07 +00:00
Nico Weber fe0053eb42 Reword comment.
llvm-svn: 227069
2015-01-26 03:03:49 +00:00
Nico Weber 99e05d02cb Test that qualified virtual calls mark vtables referenced in apple kext mode.
I broke this locally while working on PR20337 and no test caught that.  Now
there's coverage for this, and a comment explaining why this is needed.

llvm-svn: 227068
2015-01-26 02:59:07 +00:00
Craig Topper 4cac1c2318 [X86] Add AVX512F integer comparision intrinsics to header file.
llvm-svn: 227067
2015-01-25 23:30:07 +00:00
Craig Topper 95b0d73cee [X86] Add immediate range checking to AVX512 integer comparision builtins.
llvm-svn: 227066
2015-01-25 23:30:05 +00:00
Craig Topper ad1766aaa0 [X86] Add AVX512 floating cmpgt and integer comparison builtins. Intrinsic header file usages coming later.
llvm-svn: 227065
2015-01-25 23:30:00 +00:00
Craig Topper d1e1d106ca [X86] Change comparision immediate type to i8 in test cases for AVX512 floating point comparisons. The type was already changed in the definitions and was being auto upgraded to the new type.
llvm-svn: 227064
2015-01-25 23:26:12 +00:00
Craig Topper 29f2e95185 [X86] Use i8 immediate for comparison type on AVX512 packed integer instructions. This matches floating point equivalents. Includes autoupgrade support to convert old code.
llvm-svn: 227063
2015-01-25 23:26:02 +00:00
Renato Golin b625f48862 Allows Clang to use LLVM's fixes-x18 option
This patch allows clang to have llvm reserve the x18
platform register on AArch64. FreeBSD will use this in the kernel for
per-cpu data but has no need to reserve this register in userland so
will need this flag to reserve it.

This uses llvm r226664 to allow this register to be reserved.

Patch by Andrew Turner.

llvm-svn: 227062
2015-01-25 23:17:48 +00:00
NAKAMURA Takumi 1dba307c0f clang/test/Driver/rewrite-map-in-diagnostics.c: This depends on crash-recovery.
llvm-svn: 227061
2015-01-25 23:10:21 +00:00
Alex Rosenberg 38babd1eeb Add the triple for the Sony Playstation®4.
Lots more to follow.

llvm-svn: 227060
2015-01-25 22:46:59 +00:00
Simon Atanasyan efdbf4c0b7 [Mips] Add checking of disassembler output in some test cases
No functional changes.

llvm-svn: 227059
2015-01-25 21:31:52 +00:00
Simon Atanasyan 0712650742 [Mips] Teach LLD to recognize one more MIPS target triple - mips64el
This is initial patch to support MIPS64 object files linking.
The patch just makes some classes more generalized, and rejects
attempts to interlinking O32 and N64 ABI object files.

I try to reuse the current MIPS target related classes as much as
possible because O32 and N64 MIPS ABI are tightly related and share
almost the same set of relocations, GOT, flags etc.

llvm-svn: 227058
2015-01-25 19:15:35 +00:00
Johannes Doerfert 07e8a406d6 [FIX] Independent blocks with intrinsics handling
Also an old option was removed from some new test cases

llvm-svn: 227057
2015-01-25 19:09:49 +00:00
Adrian Prantl 40cb819c6f Debug info: Fix PR22296 by omitting the DW_AT_location if we lost the
physical register that is described in a DBG_VALUE.

In the testcase the DBG_VALUE describing "p5" becomes unavailable
because the register its address is in is clobbered and we (currently)
aren't smart enough to realize that the value is rematerialized immediately
after the DBG_VALUE and/or is actually a stack slot.

llvm-svn: 227056
2015-01-25 19:04:08 +00:00
Bill Schmidt 258ac3cc56 [PowerPC] Revert ppc64le-aggregates.ll test changes from r227053
It appears we have different behavior with and without -mcpu=pwr8 even
with ppc64le defaulting to POWER8.  The failure appears as follows:

/home/bb/cmake-llvm-x86_64-linux/llvm-project/llvm/test/CodeGen/PowerPC/ppc64le-aggregates.ll:268:14: error: expected string not found in input
; CHECK-DAG: lfs 1, 0([[REG]])
             ^
<stdin>:497:11: note: scanning from here
 ld 3, .LC1@toc@l(3)
          ^
<stdin>:497:11: note: with variable "REG" equal to "3"
 ld 3, .LC1@toc@l(3)
          ^
<stdin>:514:2: note: possible intended match here
 lfs 1, 0(4)
 ^

Reverting this particular test case change.  Nemanja, please have a look
at the reason for the failure.

llvm-svn: 227055
2015-01-25 18:18:54 +00:00
Johannes Doerfert 3f500fa2f6 Support for math/misc intrinsics
The support is currently limited as we only allow them in the input but do
  not emit them in the transformed SCoP due to the possible semantic changes.

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

llvm-svn: 227054
2015-01-25 18:07:30 +00:00
Bill Schmidt 279cabb450 [PowerPC] Reset the baseline for ppc64le to be equivalent to pwr8
Test by Nemanja Ivanovic.

Since ppc64le implies POWER8 as a minimum, it makes sense that the
same features are included. Since the pwr8 processor model will likely
be getting new features until the implementation is complete, I
created a new list to add these updates to. This will include them in
both pwr8 and ppc64le.

Furthermore, it seems that it would make sense to compose the feature
lists for other processor models (pwr3 and up). Per discussion in the
review, I will make this change in a subsequent patch.

In order to test the changes, I've added an additional run step to
test cases that specify -march=ppc64le -mcpu=pwr8 to omit the -mcpu
option. Since the feature lists are the same, the behaviour should be
unchanged.

llvm-svn: 227053
2015-01-25 18:05:42 +00:00
Francisco Lopes da Silva 1a4f855595 Sema: Formatting. No behavior change.
llvm-svn: 227052
2015-01-25 17:00:47 +00:00
Simon Atanasyan 6acffa459b [Mips] Make MipsELFObjectReader and MipsELFDSOReader class templates
No functional changes.

llvm-svn: 227051
2015-01-25 16:38:16 +00:00
Simon Atanasyan 4685c839d4 [docs] Add link to the MIPS 64-bit ELF object file specification
llvm-svn: 227050
2015-01-25 16:20:30 +00:00
Simon Atanasyan 6d0f0021ee [Mips] Reformat the code with clang-format
No functional changes.

llvm-svn: 227049
2015-01-25 16:17:16 +00:00
Simon Atanasyan d94b0e6541 [Mips] Remove duplicated typedef's
No functional changes.

llvm-svn: 227048
2015-01-25 16:17:10 +00:00
Simon Atanasyan 752df2c767 [Mips] Use template class argument instead of hard-coded type name in
the class field declarations.

No functional changes.

llvm-svn: 227047
2015-01-25 16:17:02 +00:00
NAKAMURA Takumi 4834009898 Instantiate Registry<GCStrategy> in LLVMCore, to let it available on Win32 DLL.
llvm-svn: 227046
2015-01-25 15:05:36 +00:00
Simon Atanasyan e4135ae643 [ELF] Update for LLVM api change
The `Elf_Rel_Impl::setSymbolAndType` method now has the third argument
`IsMips64EL` (like complement methods `getSymbol` and `getType`). While
we do not support linking of MIPS64 ELF object file just pass `false`
to the `setSymbolAndType`.

llvm-svn: 227045
2015-01-25 13:44:02 +00:00
Simon Atanasyan 5d19c67a68 [ELFYAML] Support mips64 relocation record format in yaml2obj/obj2yaml
MIPS64 ELF file has a very specific relocation record format. Each
record might specify up to three relocation operations. So the `r_info`
field in fact consists of three relocation type sub-fields and optional
code of "special" symbols.

http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf
page 40

The patch implements support of the MIPS64 relocation record format in
yaml2obj/obj2yaml tools by introducing new optional Relocation fields:
Type2, Type3, and SpecSym. These fields are recognized only if the
object/YAML file relates to the MIPS64 target.

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

llvm-svn: 227044
2015-01-25 13:29:25 +00:00
Elena Demikhovsky 1a603b3f13 AVX-512: Changes in operations on masks registers for KNL and SKX
- Added KSHIFTB/D/Q for skx
- Added KORTESTB/D/Q for skx
- Fixed store operation for v8i1 type for KNL
- Store size of v8i1, v4i1 and v2i1 are changed to 8 bits

llvm-svn: 227043
2015-01-25 12:47:15 +00:00
NAKAMURA Takumi c17696022d Orc/IRCompileLayer.h: Avoid non-static initializer.
llvm-svn: 227042
2015-01-25 11:41:56 +00:00
NAKAMURA Takumi 2fb9a523ab OrcJIT: Avoid non-static initializers.
llvm-svn: 227041
2015-01-25 11:41:49 +00:00
NAKAMURA Takumi 94a6bef31f Orc/LLVMBuild.txt: Prune redundant "Target" in libdeps.
llvm-svn: 227040
2015-01-25 11:41:41 +00:00
Craig Topper ca8e179bc2 [X86] Give scalar VRNDSCALE instructions priority in AVX512 mode.
llvm-svn: 227039
2015-01-25 08:49:22 +00:00
Craig Topper 1d60952401 Simplify a multiclass. No functional change.
llvm-svn: 227038
2015-01-25 08:49:19 +00:00
Francisco Lopes da Silva a349a8aee9 Sema: require a complete type before lookup.
llvm-svn: 227037
2015-01-25 08:47:59 +00:00
Craig Topper e3155c96ee Remove tab characters. NFC
llvm-svn: 227036
2015-01-25 08:45:32 +00:00
Elena Demikhovsky a3232f764e Implemented cost model for masked load/store operations.
llvm-svn: 227035
2015-01-25 08:44:46 +00:00
David Blaikie 4e340b75b2 Fix the buildbots (fallout from r227028) by returning the exprloc of non-binary operator overload calls (and ->) to the start of the expression, not the location of the operator
I'll give this some further thought/discussion later, but this is enough
to unbreak the buildbots at least.

llvm-svn: 227034
2015-01-25 07:44:05 +00:00
David Blaikie b26513950d Fix up test cases to account for improved column fidelity provided by clang
llvm-svn: 227033
2015-01-25 04:39:06 +00:00
Craig Topper 53a846764c [X86] Replace i32i8imm on SSE/AVX instructions with i32u8imm which will make the assembler bounds check them. It will also make them print as unsigned.
llvm-svn: 227032
2015-01-25 02:21:16 +00:00
Craig Topper fc946a0e6f [X86] Use u8imm in several places that used i32i8imm that don't require an i32 type.
llvm-svn: 227031
2015-01-25 02:21:13 +00:00
Craig Topper e7f6cf437c Remove tab characters. NFC.
llvm-svn: 227030
2015-01-25 02:21:11 +00:00
Nico Weber a24b299c00 Rename four test files from .C to .cpp.
lit.cfg has never supported running .C files, so these tests were never
executed by check-clang.  Rename them to .cpp so that they run as part of
the test suite, and minorly tweak two of them that look like they were broken
when checked in to actually pass.

llvm-svn: 227029
2015-01-25 02:04:36 +00:00
David Blaikie 9f7ae2c948 DebugInfo: Attribute calls to overloaded operators with the operator, not the start of the whole expression
llvm-svn: 227028
2015-01-25 01:25:37 +00:00
David Blaikie 9b47966615 DebugInfo: Use the preferred location rather than the start location for expression line info
This causes things like assignment to refer to the '=' rather than the
LHS when attributing the store instruction, for example.

There were essentially 3 options for this:

* The beginning of an expression (this was the behavior prior to this
  commit). This meant that stepping through subexpressions would bounce
  around from subexpressions back to the start of the outer expression,
  etc. (eg: x + y + z would go x, y, x, z, x (the repeated 'x's would be
  where the actual addition occurred)).

* The end of an expression. This seems to be what GCC does /mostly/, and
  certainly this for function calls. This has the advantage that
  progress is always 'forwards' (never jumping backwards - except for
  independent subexpressions if they're evaluated in interesting orders,
  etc). "x + y + z" would go "x y z" with the additions occurring at y
  and z after the respective loads.
  The problem with this is that the user would still have to think
  fairly hard about precedence to realize which subexpression is being
  evaluated or which operator overload is being called in, say, an asan
  backtrace.

* The preferred location or 'exprloc'. In this case you get sort of what
  you'd expect, though it's a bit confusing in its own way due to going
  'backwards'. In this case the locations would be: "x y + z +" in
  lovely postfix arithmetic order. But this does mean that if the op+
  were an operator overload, say, and in a backtrace, the backtrace will
  point to the exact '+' that's being called, not to the end of one of
  its operands.

(actually the operator overload case doesn't work yet for other reasons,
but that's being fixed - but this at least gets scalar/complex
assignments and other plain operators right)

llvm-svn: 227027
2015-01-25 01:19:10 +00:00
Nico Weber 562ff37507 Name a bool parameter. No behavior change.
llvm-svn: 227026
2015-01-25 01:00:21 +00:00
Chandler Carruth db0809fff3 [PM] Remove the restricted visibility from the instcombine worklist. Now
that library consumers access the instcombine pass directly, they also
(transitively) access the worklist. Also, it would need to be used
directly in order to have a useful utility if we ever want that.

This should fix some warnings since I moved this code. Sorry for the
trouble.

llvm-svn: 227025
2015-01-25 00:30:05 +00:00