Commit Graph

207143 Commits

Author SHA1 Message Date
Chad Rosier f77e909f0a [AArch64] Improve the readability of the ld/st optimization pass. NFC.
llvm-svn: 244222
2015-08-06 15:50:12 +00:00
Douglas Katzman 63d64da0ce [SPARC] Don't compare arch name as a string, use the enum instead.
Fixes PR22695

llvm-svn: 244221
2015-08-06 15:44:12 +00:00
Rafael Espindola df1e05a26c Delete broken code.
This was using a hard coded string table and getting it for every symbol.

The symbol name was already available.

llvm-svn: 244220
2015-08-06 15:33:21 +00:00
Rafael Espindola 49a2ca6ddd bar
llvm-svn: 244219
2015-08-06 15:33:19 +00:00
Rafael Espindola 08c1df6a45 Bring test back but don't check the filesytem dependent error.
llvm-svn: 244218
2015-08-06 15:18:59 +00:00
Jonathan Peyton 3c4dd1c9f1 Fix link error on Windows when LIBOMP_USE_DEBUGGER is off
Two symbols for the external debugger support were incorrectly exported when LIBOMP_USE_DEBUGGER=off.

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

llvm-svn: 244217
2015-08-06 15:16:54 +00:00
Rafael Espindola 192e1fa59d Move the error handling functions to Error.h. NFC.
llvm-svn: 244216
2015-08-06 15:08:23 +00:00
Rafael Espindola b835ae8e4a Port the error functions from ELF to COFF.
This has a few advantages

* Less C++ code (about 300 lines less).
* Less machine code (about 14 KB of text on a linux x86_64 build).
* It is more debugger friendly. Just set a breakpoint on the exit function and
  you get the complete lld stack trace of when the error was found.
* It is a more robust API. The errors are handled early and we don't get a
  std::error_code hot potato being passed around.
* In most cases the error function in a better position to print diagnostics
  (it has more context).

llvm-svn: 244215
2015-08-06 14:58:50 +00:00
Rafael Espindola dd8bbb7c5e Reuse variable. NFC.
llvm-svn: 244214
2015-08-06 14:51:02 +00:00
Aaron Ballman d502b72d08 Silencing a -Wtype-limits warning; NFC.
llvm-svn: 244213
2015-08-06 14:07:29 +00:00
Yaron Keren 6501e399ce Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.
llvm-svn: 244212
2015-08-06 13:18:59 +00:00
Chad Rosier 5f64aa7e8e Fix minor typos. NFC.
llvm-svn: 244211
2015-08-06 12:49:40 +00:00
Renato Golin 4ae2e1f575 Revert "[sanitizer] Add the flag handle_sigfpe that is default true to handle SIGFPE crashes same as SIGSEV crashes, patch by Karl Skomski"
This reverts commit r244136, it was breaking the ARM bots for too long. We should investigate it offline.

llvm-svn: 244210
2015-08-06 12:42:46 +00:00
Alexey Bataev a889917493 [OPENMP 4.1] Allow references in init expression for loop-based constructs.
OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms.

llvm-svn: 244209
2015-08-06 12:30:57 +00:00
Aaron Ballman 3abb97e4c6 Correcting and adding tests for r244206.
llvm-svn: 244208
2015-08-06 12:15:47 +00:00
Michael Kuperstein 819ad33f63 Mark calls in thunk functions as tail-call optimization candidates
When a thunk is generated with a call to the original adjusted function, 
the thunk appears in the debugger call stack. We want the backend to perform
tail-call optimization on the call, to make it invisible to the debugger.

This fixes PR24235

Patch by: amjad.aboud@intel.com
Differential Revision: http://reviews.llvm.org/D11476

llvm-svn: 244207
2015-08-06 11:57:15 +00:00
Aaron Ballman 5890717e70 Add the "quit" command as a way to terminate clang-query interactive sessions.
llvm-svn: 244206
2015-08-06 11:56:57 +00:00
Renato Golin a02ac60469 Revert "Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test."
This reverts commit r244155, as it was breaking the buildbots for too long.
Should be reapplied with proper fix.

llvm-svn: 244205
2015-08-06 10:37:59 +00:00
NAKAMURA Takumi 51fe119a30 llvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, introduced in r244164. [-Wdocumentation]
llvm-svn: 244204
2015-08-06 09:49:17 +00:00
Michael Liao 66233b7d79 Removing tailing whitespaces
llvm-svn: 244203
2015-08-06 09:06:20 +00:00
Michael Kuperstein 868dc65444 [X86] Improve EmitLoweredSelect for contiguous CMOV pseudo instructions.
This change improves EmitLoweredSelect() so that multiple contiguous CMOV pseudo
instructions with the same (or exactly opposite) conditions get lowered using a single
new basic-block. This eliminates unnecessary extra basic-blocks (and CFG merge points)
when contiguous CMOVs are being lowered.

Patch by: kevin.b.smith@intel.com
Differential Revision: http://reviews.llvm.org/D11428

llvm-svn: 244202
2015-08-06 08:45:34 +00:00
Michael Kuperstein d7b9392f59 [X86] Add support for _MM_ALIGN16
Differential Revision: http://reviews.llvm.org/D11753

llvm-svn: 244201
2015-08-06 08:24:38 +00:00
Chandler Carruth c5d811253a [PM/AA] Clean up and homogenize comments throughout basic-aa.
llvm-svn: 244200
2015-08-06 08:17:06 +00:00
Yaron Keren 051eeca08e Fix Visual C++ error C2248:
'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>::additionalSizeToAlloc' :
cannot access protected member declared in class
 'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>'

 I'm not sure how this compiles with gcc.
 Aren't protecteded members accessible only with protected or public inheritance?
 

llvm-svn: 244199
2015-08-06 07:59:26 +00:00
Chandler Carruth 903c5f9329 [PM/AA] Run clang-format over all of basic-aa before making more
substantive edits.

llvm-svn: 244198
2015-08-06 07:57:58 +00:00
Chandler Carruth 17e0bc37fd [PM/AA] Hoist the interface for BasicAA into a header file.
This is the first mechanical step in preparation for making this and all
the other alias analysis passes available to the new pass manager. I'm
factoring out all the totally boring changes I can so I'm moving code
around here with no other changes. I've even minimized the formatting
churn.

I'll reformat and freshen comments on the interface now that its located
in the right place so that the substantive changes don't triger this.

llvm-svn: 244197
2015-08-06 07:33:15 +00:00
Yaron Keren 9f168530a2 Plug a memory leak in NeonEmitter: Intrinsics allocated were never released.
llvm-svn: 244196
2015-08-06 07:28:36 +00:00
Peter Collingbourne e834f42073 COFF: Assign the correct symbol type to internal functions.
The COFFSymbolRef::isFunctionDefinition() function tests for several conditions
that are not related to whether a symbol is a function, but rather whether
the symbol meets the requirements for a function definition auxiliary record,
which excludes certain symbols such as internal functions and undefined
references. The test we need to determine the symbol type is much simpler:
we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION.

llvm-svn: 244195
2015-08-06 05:26:35 +00:00
Richard Smith 4cb29abcdb Update lldb's ExternalASTSources to match Clang r244161.
llvm-svn: 244194
2015-08-06 05:13:41 +00:00
Alex Denisov 5dfac81c60 [ObjC] Circular containers: add support of subclasses
llvm-svn: 244193
2015-08-06 04:51:14 +00:00
Richard Smith 0f4e2c4d0f [modules] Defer setting up the lookup table for a DeclContext until we can
determine the primary context, rather than sometimes registering the lookup
table on the wrong context.

This exposed a couple of bugs:
 * the odr violation check didn't deal properly with mergeable declarations
   if the declaration retained by name lookup wasn't in the canonical
   definition of the class
 * the (broken) RewriteDecl mechanism would emit two name lookup tables for
   the same DeclContext into the same module file (one as part of the
   rewritten declaration and one as a visible update for the old declaration)
These are both fixed too.

llvm-svn: 244192
2015-08-06 04:23:48 +00:00
Rui Ueyama 9b000812a4 COFF: ARM: Sort .pdata section correctly.
On ARM, exception handler entries in .pdata section are 8 byte long.

llvm-svn: 244191
2015-08-06 03:45:27 +00:00
Jason Molenda ef7d641617 Second part of indicating when the user is stopped in optimized code.
The first part was in r243508 -- the extent of the UI changes in that
patchset was to add "[opt]" to the frame-format when a stack frame was
built with optimized code.

In this change, when a stack frame built with optimization is selected,
a message will be printed to the async output channel --

opt1.c was compiled with optimization - stepping may behave oddly; variables may not be available.

The warning will be only be printed once per source file in a debug session.
These warnings may be disabled by

settings set target.process.optimization-warnings false

Internally, a new Process::PrintWarning() method has been added for
warnings that we want to print only once to the user.  It takes a type
of warning (currently only eWarningsOptimization) and an object
pointer (CompileUnit*) - the warning will only be printed once for a
given object pointer value.

This is a bit of a prototype of this change -  I think we will be
tweaking it more in the future.  But I wanted to land this and see
how it goes.  Advanced users will find these warnings unnecessary
noise and will quickly disable them - but anyone who maintains a 
debugger knows that debugging optimized code, without realizing it,
is a constant source of confusion and frustation for more typical
debugger users.  

I imagine there will be more of these "warn once per whatever" style
warnings that we will want to add in the future and we'll need to 
come up with a better way for enabling/disabling them.  But I'm not
srue what form that warning settings should take and I didn't want
to code up something that we regret later, so for now I just added
another process setting for this one warning.

<rdar://problem/19281172> 

llvm-svn: 244190
2015-08-06 03:27:10 +00:00
Chandler Carruth 50fee93926 [PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
around a DataLayout interface in favor of directly querying DataLayout.

This wrapper specifically helped handle the case where this no
DataLayout, but LLVM now requires it simplifynig all of this. I've
updated callers to directly query DataLayout. This in turn exposed
a bunch of places where we should have DataLayout readily available but
don't which I've fixed. This then in turn exposed that we were passing
DataLayout around in a bunch of arguments rather than making it readily
available so I've also fixed that.

No functionality changed.

llvm-svn: 244189
2015-08-06 02:05:46 +00:00
Kostya Serebryany bf29ff2fa5 [libFuzzer] add one more mutation strategy: byte shuffling
llvm-svn: 244188
2015-08-06 01:29:13 +00:00
Argyrios Kyrtzidis 3f84b7353b [test] Another attempt to fix the test.
llvm-svn: 244187
2015-08-06 01:06:55 +00:00
Eric Christopher 02d5d86b4e Rename the non-coding style conformant functions in namespace Builtins
to match the rest of their brethren and reformat the bits that need it.

llvm-svn: 244186
2015-08-06 01:01:12 +00:00
Alex Lorenz 49873a8382 MIR Serialization: Initial serialization of the machine operand target flags.
This commit implements the initial serialization of the machine operand target
flags. It extends the 'TargetInstrInfo' class to add two new methods that help
to provide text based serialization for the target flags.

This commit can serialize only the X86 target flags, and the target flags for
the other targets will be serialized in the follow-up commits.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 244185
2015-08-06 00:44:07 +00:00
Davide Italiano 7f6c301090 [llvm-objdump] Add missing call to exit(1).
Reported by: Rafael Espindola.

llvm-svn: 244184
2015-08-06 00:18:52 +00:00
Rafael Espindola 3b8018069e For completeness, add a 64 bit big endian test.
llvm-svn: 244183
2015-08-06 00:00:50 +00:00
Frederic Riss b5dce473e3 Revert "Make sure all temporary files get created under %T."
This reverts commit r244163. The workaround shouldn't be necessary
after r244172, and moreover the commit was slightly buggy as it
dis a simple mkdir without removing the directory first, which could
cause 'File exists' errors.

llvm-svn: 244182
2015-08-05 23:53:38 +00:00
Duncan P. N. Exon Smith 3115f75bf8 ValueMapper: Rotate distinct node remapping algorithm
Rotate the algorithm for remapping distinct nodes in order to simplify
how uniquing cycles get resolved.  This removes some of the recursion,
and, most importantly, exposes all uniquing cycles at the top-level.
Besides being a little more efficient -- temporary MDNodes won't live as
long -- the clearer logic should help protect against bugs like those
fixed in r243961 and r243976.

What are uniquing cycles?  Why do they present challenges when remapping
metadata?

    !0 = !{!1}
    !1 = !{!0}

!0 and !1 form a simple uniquing cycle.  When remapping from one
metadata graph to another, every uniquing cycle gets "duplicated"
through a dance:

    !0-temp = !{!1?}     ; map(!0): clone !0, VM[!0] = !0-temp
    !1-temp = !{!0?}     ; ..map(!1): clone !1, VM[!1] = !1-temp
    !1-temp = !{!0-temp} ; ..map(!1): remap !1's operands
    !2      = !{!0-temp} ; ..map(!1): uniquify: !1-temp => !2
    !0-temp = !{!2}      ; map(!0): remap !0's operands
    !3      = !{!2}      ; map(!0): uniquify: !0-temp => !3

    ; Result
    !2 = !{!3}
    !3 = !{!2}

(In the two "uniquify" steps above, the operands of !X-temp are compared
to the operands of !X.  If they're the same, then !X-temp gets RAUW'ed
to !X; if they're different, then !X-temp is promoted to a new unique
node.  The latter case always hits in for uniquing cycles, so we
duplicate all the nodes involved.)

Why is this a problem?  Uniquable Metadata nodes that have temporary
node as transitive operands keep RAUW support until the temporary nodes
get finalized.  With non-cycles, this happens automatically: when a
uniquable node's count of unresolved operands drops to zero, it
immediately sheds its own RAUW support (possibly triggering the same in
any node that references it).  However, uniquing cycles create a
reference cycle, and uniqued nodes that transitively reference a
uniquing cycle are "stuck" in an unresolved state until someone calls
`MDNode::resolveCycles()` on a node in the unresolved subgraph.

Distinct nodes should help here (and mostly do): since they aren't
uniqued anywhere, they are guaranteed not to be RAUW'ed.  They
effectively form a barrier between uniqued nodes, breaking some uniquing
cycles, and shielding uniqued nodes from uniquing cycles.

Unfortunately, with this barrier in place, the unresolved subgraph(s)
can be disjoint from the top-level node.  The mapping algorithm needs to
find at least one representative from each disjoint subgraph.  But which
nodes are *stuck*, and which will get resolved automatically?  And which
nodes are in the unresolved subgraph?  The old logic was conservative.

This commit rotates the logic for distinct nodes, so that we have access
to unresolved nodes at the top-level call to `llvm::MapMetadata()`.
Each time we return to the top-level, we know that all temporaries have
been RAUW'ed away.  Here, it's safe (and necessary) to call
`resolveCycles()` immediately on unresolved operands.

This should also perform better than the old algorithm.  The recursion
stack is shorter, temporary nodes don't live as long, and there are
fewer tracking references to unresolved nodes.  As the debug info graph
introduces more 'distinct' nodes, remapping should incrementally get
cheaper and cheaper.

Aside from possible performance improvements (and reduced cruft in the
`LLVMContext`), there should be no functionality change here.

llvm-svn: 244181
2015-08-05 23:52:42 +00:00
Rui Ueyama cb8474edae COFF, ELF2: Pass output file path implicitly using Config global variable.
Various parameters are passed implicitly using Config global variable
already. Output file path is no different from others, so there was no
special reason to handle that differnetly.

This patch changes the signature of writeResult(SymbolTable *, StringRef)
to writeResult(SymbolTable *).

llvm-svn: 244180
2015-08-05 23:51:50 +00:00
Justin Bogner e03437c756 Driver: Strip -header-include-file and -diagnostic-log-file from crash repro scripts
These two arguments tend to refer to a local path that won't exist
when we try to reproduce a bug. Strip them.

llvm-svn: 244179
2015-08-05 23:49:44 +00:00
Eric Christopher 964a5f3b5c Rename DescriptionString -> DataLayoutString as it matches the actual
use of the string.

llvm-svn: 244178
2015-08-05 23:48:05 +00:00
Kostya Serebryany d46369d8b3 [libFuzzer] avoid build warnings in non-assert build (useful warning in this case)
llvm-svn: 244177
2015-08-05 23:44:42 +00:00
Argyrios Kyrtzidis 5365532b99 [test] Fix tests in non-darwin bots.
llvm-svn: 244176
2015-08-05 23:44:06 +00:00
Rui Ueyama 685c41cd39 COFF: Simplify Writer interface by hiding Writer class.
llvm-svn: 244175
2015-08-05 23:43:53 +00:00
Wei Mi d67daae4f1 Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.
Differential Revision: http://reviews.llvm.org/D9689

llvm-svn: 244174
2015-08-05 23:40:30 +00:00
Rafael Espindola 1c2f64d1a6 Add a big endian testcase.
llvm-svn: 244173
2015-08-05 23:40:20 +00:00