Commit Graph

174818 Commits

Author SHA1 Message Date
Aaron Ballman 2f22b94201 Cleaning up some range-based for loops so that the automatic type deduction is more explicit about pointers and const. Did some minor drive-by const correctness fixes and identifier updates as well. No functional changes.
llvm-svn: 209233
2014-05-20 19:47:14 +00:00
Peter Collingbourne 786283734a Revert r209231, "Update AttributeReference.rst."
According to Aaron, this is being generated on the server now.

llvm-svn: 209232
2014-05-20 19:38:07 +00:00
Peter Collingbourne 450a0b1dc9 Update AttributeReference.rst.
llvm-svn: 209231
2014-05-20 19:27:39 +00:00
Quentin Colombet c88baa5c10 [LSR] Canonicalize reg1 + ... + regN into reg1 + ... + 1*regN.
This commit introduces a canonical representation for the formulae.
Basically, as soon as a formula has more that one base register, the scaled
register field is used for one of them. The register put into the scaled
register is preferably a loop variant.
The commit refactors how the formulae are built in order to produce such
representation.
This yields a more accurate, but still perfectible, cost model.

<rdar://problem/16731508>

llvm-svn: 209230
2014-05-20 19:25:04 +00:00
Duncan P. N. Exon Smith 6f782b12aa Fix testcase from r209228
llvm-svn: 209229
2014-05-20 19:20:23 +00:00
Duncan P. N. Exon Smith d22b97c30b GlobalValue: Testcase for hidden visibility and local linkage
This is a testcase for r209227, a change in LLVM that automatically sets
visibility to default when the linkage is changed to local (rather than
asserting).

What this testcase triggers is hard to reproduce otherwise:  the
`GlobalValue` is created (with non-local linkage), the visibility is set
to hidden, and then the linkage is set to local.

PR19760

llvm-svn: 209228
2014-05-20 19:04:31 +00:00
Duncan P. N. Exon Smith e432c510dc GlobalValue: Automatically reset visibility when setting local linkage
r208264 started asserting in `setLinkage()` and `setVisibility()` that
visibility and linkage are compatible.  There are a few places in clang
where visibility is set first, and then linkage later, so the assert
fires.  In `setLinkage()`, it's clear what the visibility *should* be,
so rather than updating all the call sites just automatically fix the
visibility.

The testcase for this is for *clang*, so it'll follow separately in cfe.

PR19760

llvm-svn: 209227
2014-05-20 19:00:58 +00:00
David Blaikie 1d9aec67b0 Fix test breakage introduced in r209223.
Oops, broke the broken enum constants again.

llvm-svn: 209226
2014-05-20 18:36:35 +00:00
Alexey Samsonov dfcaf9c8d8 Rewrite calculateDbgValueHistory to make it (hopefully) more transparent.
This change preserves the original algorithm of generating history
for user variables, but makes it more clear.

High-level description of algorithm:
Scan all the machine basic blocks and machine instructions in the order
they are emitted to the object file. Do the following:
1) If we see a DBG_VALUE instruction, add it to the history of the
corresponding user variable. Keep track of all user variables, whose
locations are described by a register.
2) If we see a regular instruction, look at all the registers it clobbers,
and terminate the location range for all variables described by these registers.
3) At the end of the basic block, terminate location ranges for all
user variables described by some register.

Although this change shouldn't be user-visible (the contents of .debug_loc section
should be the same), it changes some internal assumptions about the set
of instructions used to track the variable locations. Watching the bots.

llvm-svn: 209225
2014-05-20 18:34:54 +00:00
Yaron Keren 065da7c53a Fixed spelling.
llvm-svn: 209224
2014-05-20 18:23:05 +00:00
David Blaikie 2af1c805b4 PR19767: DebugInfo emission of pointer constants.
In refactoring DwarfUnit::isUnsignedDIType I restricted it to only work
on values with signedness (unsigned or signed), asserting on anything
else (which did uncover some bugs). But it turns out that we do need to
emit constants of signless data, such as pointer constants - only null
pointer constants are known to need this so far, but it's conceivable
that there might be non-null pointer constants at some point (hardcoded
address offsets for device drivers?).

This patch just uses 'unsigned' for signless data such as pointer
constants. Arguably we could use signless representations
(DW_FORM_dataN) instead, allowing a trinary result from isUnsignedDIType
(signed, unsigned, signless), but this seems reasonable for now.

llvm-svn: 209223
2014-05-20 18:21:51 +00:00
Renato Golin e919fcac05 Avoids DCE on write_register
llvm-svn: 209222
2014-05-20 17:40:03 +00:00
Jordan Rose 7afd71e4ff Add a check for tautological bitwise comparisons to -Wtautological-compare.
This catches issues like:

if ((x & 8) == 4) { ... }
if ((x | 4) != 3) { ... }

Patch by Anders Rönnholm!

llvm-svn: 209221
2014-05-20 17:31:11 +00:00
Peter Collingbourne d2402470ee Make the wording for the flatten docs a little clearer.
llvm-svn: 209220
2014-05-20 17:30:03 +00:00
Adam Nemet 571eb5fc91 [PowerPC] PR19796: Also match ISD::TargetConstant in isIntS16Immediate
The SplitIndexingFromLoad changes exposed a latent isel bug in the PowerPC64
backend.  We matched an immediate offset with STWX8 even though it only
supports register offset.

The culprit is the complex-pattern predicate, SelectAddrIdx, which decides
that if the offset is not ISD::Constant it must be a register.

Many thanks to Bill Schmidt for testing this.

llvm-svn: 209219
2014-05-20 17:20:34 +00:00
Eric Christopher 4c08be18b1 Fix testcase for case.
llvm-svn: 209218
2014-05-20 17:15:31 +00:00
Peter Collingbourne 41af7c2fdc Implement the flatten attribute.
This is a GNU attribute that causes calls within the attributed function
to be inlined where possible. It is implemented by giving such calls the
alwaysinline attribute.

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

llvm-svn: 209217
2014-05-20 17:12:51 +00:00
Eric Christopher 650c8f2a06 Clean up language and grammar.
Based on a patch by jfcaron3@gmail.com!
PR19806

llvm-svn: 209216
2014-05-20 17:11:11 +00:00
Eric Christopher c9e2a68905 Clean up language and grammar.
Based on a patch by jfcaron3@gmail.com!
PR19806

llvm-svn: 209215
2014-05-20 17:10:39 +00:00
Joerg Sonnenberger b1cc6d5603 Go via uintptr_t when casting away constness, otherwise GCC will warn
when using -Wcast-qual.

llvm-svn: 209214
2014-05-20 16:37:07 +00:00
Alp Toker 2e62f7220f Fix typos
llvm-svn: 209213
2014-05-20 16:17:53 +00:00
NAKAMURA Takumi 32d832af98 clang/test/SemaCXX/err_init_conversion_failed.cpp: Tweak for i686-msvc.
For targeting i686-msvc, declarations are seen as thiscall like;

  void (template_test::S::*)(const int &) __attribute__((thiscall))
  void (template_test::S::*)(int) __attribute__((thiscall))

It didn't affect x86_64-msvc.

llvm-svn: 209212
2014-05-20 15:44:42 +00:00
Daniel Sanders a714fcb02a Temporarily revert: r209129 - [mips][mips64r6] Sorted *_ENC, *_DESC classes and tests
After discussion with Zoran, we have decided to temporarily revert this commit.
It's causing some difficult to resolve conflicts and we are under time pressure
to deliver an initial MIPS64r6 compiler.

We will re-apply an equivalent patch once the time pressure has passed.

llvm-svn: 209211
2014-05-20 14:46:24 +00:00
Timur Iskhodzhanov e7894f3b14 [ASan Win] Simplify and improve the way we forward ASan interface calls from DLLs
Reviewed at http://reviews.llvm.org/D3848

llvm-svn: 209210
2014-05-20 14:26:19 +00:00
Aaron Ballman 981ba24156 None of these attributes require FunctionTemplate to be explicitly listed as part of their subject definition. FunctionTemplateDecls are not what the attribute appertains to in the first place -- it attaches to the underlying FunctionDecl.
The attribute emitter was using FunctionTemplate to map the diagnostic to "functions or methods", but that isn't a particularly clear diagnostic in these cases anyway (since they do not apply to ObjC methods). Updated the attribute emitter to remove custom logic for FunctionTemplateDecl, and updated the test cases for the change in diagnostic wording.

llvm-svn: 209209
2014-05-20 14:10:53 +00:00
Bradley Smith cf5b09b5dc [ARM64] Port basic-a64-diagnostics.s over to ARM64
llvm-svn: 209207
2014-05-20 13:33:41 +00:00
Tim Northover c807a17a9b TableGen: permit non-leaf ComplexPattern uses
This allows the results of a ComplexPattern check to be distributed to separate
named Operands, instead of the current system where all results must apply (and
match perfectly) with a single Operand.

For example, if "some_addrmode" is a ComplexPattern producing two results, you
can write:

   def : Pat<(load (some_addrmode GPR64:$base, imm:$offset)),
             (INST GPR64:$base, imm:$offset)>;

This should allow neater instruction definitions in TableGen that don't put all
possible aspects of addressing into a single operand, but are still usable with
relatively simple C++ CodeGen idioms.

llvm-svn: 209206
2014-05-20 11:52:46 +00:00
Daniel Jasper 069e5f4858 clang-format: [JS] Understand top-level function literals properly.
llvm-svn: 209205
2014-05-20 11:14:57 +00:00
Simon Atanasyan e7fa2314af Add parentheses to suppress the gcc warning '-Wparentheses'.
No functional changes.

llvm-svn: 209203
2014-05-20 10:23:04 +00:00
Benjamin Kramer 7bd6bee385 Legalizer: Make bswap promotion safe for vectors.
llvm-svn: 209202
2014-05-20 09:42:31 +00:00
Simon Atanasyan 9cb4090867 [Mips] Add more relocation types and MIPS specific e_flags constants.
llvm-svn: 209201
2014-05-20 09:27:49 +00:00
Christian Pirker 875629f713 ARMEB: Additional test files for ARM fixups
llvm-svn: 209200
2014-05-20 09:24:37 +00:00
Tim Northover 9a24f88a37 TableGen: convert InstAlias's Emit bit to an int.
When multiple aliases overlap, the correct string to print can often be
determined purely by considering the InstAlias declarations in some particular
order. This allows the user to specify that order manually when desired,
without resorting to hacking around with the default lexicographical order on
Record instantiation, which is error-prone and ugly.

I was also mistaken about "add w2, w3, w4" being the same as "add w2, w3, w4,
uxtw". That's only true if Rn is the stack pointer.

llvm-svn: 209199
2014-05-20 09:17:16 +00:00
Alexey Volkov 6226de6721 [X86] Tune LEA usage for Silvermont
According to Intel Software Optimization Manual on Silvermont in some cases LEA
is better to be replaced with ADD instructions:
"The rule of thumb for ADDs and LEAs is that it is justified to use LEA
with a valid index and/or displacement for non-destructive destination purposes
(especially useful for stack offset cases), or to use a SCALE.
Otherwise, ADD(s) are preferable."

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

llvm-svn: 209198
2014-05-20 08:55:50 +00:00
Zinovy Nis abdf44e7f3 [LV][REFACTOR] One more tiny fix for printing debug locations in loop vectorizer. Now consistent with the remarks emitter.
Differential Revision: http://reviews.llvm.org/D3821

llvm-svn: 209197
2014-05-20 08:26:20 +00:00
Robert Lytton db8c1cb02c XCore target: sort typestring enum fields alphabetically
llvm-svn: 209196
2014-05-20 07:19:33 +00:00
Ben Langmuir 5988590363 Speculative fix for Windows buildbot after r209138
It appears that Windows doesn't like renaming over open files, which we
do in clearOutputFiles. The file being compiled should be safe to
removed, but this isn't very satisfying - we don't want to manually
manage the lifetime of files we cannot prove have no references.

llvm-svn: 209195
2014-05-20 05:55:04 +00:00
Saleem Abdulrasool 4a6f58380a llvm-readobj: use range-based for loop
Convert an additional site to a range based for loop.  NFC.

llvm-svn: 209194
2014-05-20 05:18:06 +00:00
Nick Lewycky ec373545b8 Teach isKnownNonNull that a nonnull return is not null. Add a test for this case as well as the case of a nonnull attribute (already handled but not tested).
llvm-svn: 209193
2014-05-20 05:13:21 +00:00
Craig Topper ccbc35edc2 [C++11] Use 'nullptr'. Tooling edition.
llvm-svn: 209192
2014-05-20 04:51:16 +00:00
Craig Topper 2554294321 [C++11] Use 'nullptr'. Analysis edition.
llvm-svn: 209191
2014-05-20 04:30:07 +00:00
Richard Trieu 5fe0a42ae9 Fix diagnostic message for member function pointer mismatches where one of the
classes is a template argument.

llvm-svn: 209190
2014-05-20 04:10:24 +00:00
David Blaikie 8e1d489351 DebugInfo: Emit function definitions within their namespace scope.
This workaround (presumably for ancient GDB) doesn't appear to be
required (GDB 7.5 seems to tolerate function definition DIEs in
namespace scope just fine).

llvm-svn: 209189
2014-05-20 03:23:24 +00:00
David Blaikie e837e96a82 Follow up to 209187, updating a test to use FileCheck. Needed to ignore an extra DW_TAG_class_type
llvm-svn: 209188
2014-05-20 02:40:34 +00:00
David Blaikie 0a8cabb431 Update test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll to use FileCheck.
llvm-svn: 209187
2014-05-20 02:19:15 +00:00
Richard Trieu ccedd52736 Ignore void returning overloaded functions fom -Wunused-comparison. PR19791.
llvm-svn: 209186
2014-05-20 01:34:43 +00:00
Nick Lewycky d52b1528c0 Add 'nonnull', a new parameter and return attribute which indicates that the pointer is not null. Instcombine will elide comparisons between these and null. Patch by Luqman Aden!
llvm-svn: 209185
2014-05-20 01:23:40 +00:00
Alp Toker 57cccec446 ARCMT/GC-check-warn-nsalloc.m: don't provide a diag group
This diagnostic is now controlled solely by -no-ns-alloc-error thus matching
the original intended behaviour.

llvm-svn: 209184
2014-05-19 23:48:49 +00:00
Adrian Prantl eb1ddfc8f4 LTO: Add a testcase for linking modules with incompatible Debug Info
Versions.
rdar://problem/16926122

llvm-svn: 209183
2014-05-19 23:41:25 +00:00
Adrian Prantl 2dbdd20d37 Demote the "Debug Info Version" module flag to llvm::Module::Warning
behavior on mismatch. The AutoUpgrader will drop incompatible debug info
any way and also emit a warning diagnostic for it.

rdar://problem/16926122

llvm-svn: 209182
2014-05-19 23:40:06 +00:00