Commit Graph

199585 Commits

Author SHA1 Message Date
Steven Wu 2baa53ace9 Fix -fno-gnu-inline-asm doesn't catch file scope asm
Summary:
FileScopeAsm should be treated the same as funcion level inline asm.
-fno-gnu-inline-asm should trigger an error if file scope asm is used.
I missed this case from r226340. This should not affect ms-extension
because it is not allowed in the file scope.

Reviewers: bob.wilson, rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

llvm-svn: 236044
2015-04-28 21:49:09 +00:00
Richard Smith 6d69e8c00b Fix assertion failure if a lambda array-capture is followed by a this capture.
llvm-svn: 236043
2015-04-28 21:41:14 +00:00
James Y Knight e8da8096ec Sparc: Add alternate aliases for conditional branch instructions.
llvm-svn: 236042
2015-04-28 21:27:31 +00:00
Reid Kleckner 2e49c605ad [SEH] Add an LLVM intrinsic for _exception_info
Eventually, we will lower this out during IR preparation.

llvm-svn: 236036
2015-04-28 21:20:42 +00:00
Sean Callanan 9a89d6a185 Attempt to fix the MSVC build by making ExprIterator
inherit correctly.

llvm-svn: 236035
2015-04-28 21:18:01 +00:00
Richard Smith 9a99aa75d7 Work around a suspected MSVC miscompile to try to bring the MSVC2013 buildbot back.
llvm-svn: 236034
2015-04-28 21:09:27 +00:00
Rafael Espindola 55a3afb418 Remove the GroupMapTy DenseMap. NFC.
Instead use the Group symbol of MCSectionELF.

llvm-svn: 236033
2015-04-28 21:07:28 +00:00
Richard Smith 1e1728536a Refactor to make MacroState ownership and lifetime clearer.
llvm-svn: 236032
2015-04-28 21:05:07 +00:00
Sanjay Patel 2fbc4e5c49 transform fadd chains to increase parallelism
This is a compromise: with this simple patch, we should always handle a chain of exactly 3
operations optimally, but we're not generating the optimal balanced binary tree for a longer
sequence.

In general, this transform will reduce the dependency chain for a sequence of instructions
using N operands from a worst case N-1 dependent operations to N/2 dependent operations. 
The optimal balanced binary tree would reduce the chain to log2(N).

The trade-off for not dealing with longer sequences is: (1) we have less complexity in the
compiler, (2) we avoid unknown compile-time blowup calculating a balanced tree, and (3) we
don't need to worry about the increased register pressure required to parallelize longer
sequences. It also seems unlikely that we would ever encounter really long strings of
dependent ops like that in the wild, but I'm not sure how to verify that speculation.
FWIW, I see no perf difference for test-suite running on btver2 (x86-64) with -ffast-math
and this patch.

We can extend this patch to cover other associative operations such as fmul, fmax, fmin, 
integer add, integer mul.

This is a partial fix for:
https://llvm.org/bugs/show_bug.cgi?id=17305

and if extended:
https://llvm.org/bugs/show_bug.cgi?id=21768
https://llvm.org/bugs/show_bug.cgi?id=23116

The issue also came up in:
http://reviews.llvm.org/D8941

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

llvm-svn: 236031
2015-04-28 21:03:22 +00:00
Alexei Starovoitov 659ece9ddb [bpf] fix build
Patch by Brenden Blanco.

llvm-svn: 236030
2015-04-28 20:38:56 +00:00
Artem Belevich a0473a5479 [cuda] Preserve TLS storage class of host variable even if it's a
device-side compilation.

llvm-svn: 236029
2015-04-28 20:31:49 +00:00
Rafael Espindola ad3cfaaa20 Use range loops. NFC.
llvm-svn: 236028
2015-04-28 20:23:35 +00:00
Filipe Cabecinhas b435d0f439 Relax an assert when there's a type mismatch in forward references
Summary:
We don't seem to need to assert here, since this function's callers expect
to get a nullptr on error. This way we don't assert on user input.

Bug found with AFL fuzz.

Reviewers: rafael

Subscribers: llvm-commits

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

llvm-svn: 236027
2015-04-28 20:18:47 +00:00
Rafael Espindola e3ff9305cd Avoid adding to SectionIndexMap sections that we never lookup. NFC.
llvm-svn: 236026
2015-04-28 20:09:13 +00:00
Marshall Clow 903a5dd112 Removed 'complete' from 2408; updated status
llvm-svn: 236025
2015-04-28 19:35:36 +00:00
Siva Chandra e6303cc3a1 [TestMiVar] Enable one of the tests for GCC.
Summary:
The "internal" name of vars is different between clang and GCC. All this
change does is to use a regex instead of the hardcoded internal name.

Test Plan: dotest.py -C <clang|gcc> -p TestMiVar

Reviewers: ki.stfu

Reviewed By: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 236024
2015-04-28 19:21:57 +00:00
Daniel Berlin ec1de3fb19 Make getModRefInfo(Instruction *) not crash on certain types of instructions
llvm-svn: 236023
2015-04-28 19:19:14 +00:00
Rafael Espindola 163f672cd5 Use a range loop. NFC.
llvm-svn: 236015
2015-04-28 19:07:16 +00:00
Evgeniy Stepanov f483a8a9d0 [asan] Use dl_iterate_phdr on Android.
It's available on Android/ARM starting with API 21 (L).

llvm-svn: 236014
2015-04-28 18:50:32 +00:00
Sanjay Patel f75ee4dc07 [x86] remove RCPPS and RSQRTPS intrinsic instruction definitions
We don't need codegen-only intrinsic instructions for the vector forms of these instructions.

This makes the reciprocal estimate instruction lowering identical to how we handle normal
square roots: (V)SQRTPS / (V)SQRTPD.

No existing regression tests fail with this patch.

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

llvm-svn: 236013
2015-04-28 18:48:45 +00:00
Sean Callanan 59721b3d3f Implemented ASTImporter support for Stmts and fixed
some bugs in the ASTImporter that this exposed:

- When importing functions, the body (if any) was
  previously ignored.  This patch ensures that the
  body is imported also.

- When a function-local Decl is imported, the first
  thing the ASTImporter does is import its context
  (via ImportDeclParts()).  This can trigger 
  importing the Decl again as part of the body of
  the function (but only once, since the function's
  Decl has been added to ImportedDecls).  This patch
  fixes that problem by extending ImportDeclParts()
  to return the imported Decl if it was imported as
  part of importing its context, and the patch adds
  ASTImporter::GetAlreadyImportedOrNull() to support
  this query.  All callers of ImportDeclParts return
  the imported version of the Decl if ImportDeclParts()
  returns it.

- When creating functions, InnerLocStart of the source
  function was re-used without importing.  This is a
  straight up bug, and this patch makes ASTImporter
  import the InnerLocStart and use the imported version.

- When importing FileIDs, the ASTImporter previously
  always tried to re-load the file for the corresponding
  CacheEntry from disk.  This doesn't work if the 
  CacheEntry corresponds to a named memory buffer.  This
  patch changes the code so that if the UniqueID for the
  cache entry is invalid (i.e., it is not a disk file)
  the whole entry is treated as if it were invalid, which
  forces an in-memory copy of the buffer.

Also added test cases, using the new support committed in
236011.

llvm-svn: 236012
2015-04-28 18:41:46 +00:00
Sean Callanan 61ea0571ac Implemented support for testing the ASTImporter's
ability to generate code that CodeGen likes.  Test
cases can use this functionality by calling

// RUN: %clang_cc1 -emit-obj -o /dev/null -ast-merge %t.1.ast -ast-merge %t.2.ast %s

llvm-svn: 236011
2015-04-28 18:24:12 +00:00
Nico Weber 20b0ce3abd Fix typo in comment.
llvm-svn: 236010
2015-04-28 18:19:18 +00:00
Eric Christopher 35a8a62125 Add a fixme to resetTargetOptions to explain why it needs to go
away.

llvm-svn: 236009
2015-04-28 18:09:05 +00:00
Dmitry Vyukov 25c94eb152 tsan: fix a bug memory access handling
We incorrectly replaced shadow slots
when the new value is not stronger than the old one.
The bug can lead to false negatives.
The bug was detected by Go race test suite:
https://github.com/golang/go/issues/10589

llvm-svn: 236008
2015-04-28 18:08:42 +00:00
Eric Christopher f4bf3779d8 Fix a [-Werror,-Winconsistent-missing-override] problem in the
NVPTX overrides.

llvm-svn: 236007
2015-04-28 18:06:27 +00:00
Jonathan Roelofs 7441136d2a Fix PR22047: ObjC: Method unavailability attribute doesn't work with overloaded methods
http://reviews.llvm.org/D9261

llvm-svn: 236006
2015-04-28 18:04:44 +00:00
Serge Pavlov 907233fd99 Combine instantiation context of field initializer with context of class.
Inclass initializer is instantiated in its own LocalInstantiationScope. It
causes problems when instantiating local classes - when instantiation scope
is searched for DeclContext of the field, the search fails. As a solution,
the instantiation scope of field initializer is combined with its outer
scope.

This patch fixes PR23194.

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

llvm-svn: 236005
2015-04-28 17:58:47 +00:00
Tom Stellard 96301d2455 R600: Fix up for AsmPrinter's OutStreamer being a unique_ptr
Fixes a crash with basically any OpenGL application using the radeonsi
driver.

Patch by: Michel Dänzer

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90176
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 236004
2015-04-28 17:37:03 +00:00
Tom Stellard 0a0fa03d5a R600/SI: Add a lower case alias for subtarget feature: +DumpCode
llc converts all feature strings to lower case, while the LLVM C API
does not, so we need a lower case alias in order to test this with llc.

llvm-svn: 236003
2015-04-28 17:37:00 +00:00
Aaron Ballman e918faadd2 Silencing a -Wuninitialized warning in a different way. This replaces r235981, but is still NFC.
llvm-svn: 236002
2015-04-28 17:34:38 +00:00
NAKAMURA Takumi 6eb00faf9d Disable clang-tools-extra/test/pp-trace/pp-trace-modules.cpp on win32 for now. Investigating.
llvm-svn: 236001
2015-04-28 17:31:36 +00:00
Justin Holewinski 3d2a976197 [NVPTX] Handle addrspacecast constant expressions in aggregate initializers
We need to track if an AddrSpaceCast expression was seen when
generating an MCExpr for a ConstantExpr.  This change introduces a
custom lowerConstant method to the NVPTX asm printer that will create
NVPTXGenericMCSymbolRefExpr nodes at the appropriate places to encode
the information that a given symbol needs to be casted to a generic
address.

llvm-svn: 236000
2015-04-28 17:18:30 +00:00
Marshall Clow 5e1441bce4 Fix some preprocessor directives that were generating warnings in the test suite.
llvm-svn: 235999
2015-04-28 16:52:30 +00:00
David Blaikie bdb4910202 [opaque pointer type] Encode the allocated type of an alloca rather than its pointer result type.
llvm-svn: 235998
2015-04-28 16:51:01 +00:00
Sanjay Patel ba55804ea3 move IR-level optimization flags into their own struct
This is a preliminary step to using the IR-level floating-point fast-math-flags in the SDAG (D8900).

In this patch, we introduce the optimization flags as their own struct. As noted in the TODO comment, 
we should eventually share this data between the IR passes and the backend.

We also switch the existing nsw / nuw / exact bit functionality of the BinaryWithFlagsSDNode class to
use the new struct.

The tradeoff is that instead of using the free but limited space of SDNode's SubclassData, we add a
data member to the subclass. This means we don't have to repeat all of the get/set methods per flag,
but we're potentially adding size to all nodes of this subclassi type.

In practice on 64-bit systems (measured on Linux and MacOS X), there is no size difference between an
SDNode and BinaryWithFlagsSDNode after this change: they're both 80 bytes. This means that we had at
least one free byte to play with due to struct alignment.

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

llvm-svn: 235997
2015-04-28 16:39:12 +00:00
Rafael Espindola a820169711 Use a std::vector to record the offsets of the sections. NFC.
llvm-svn: 235995
2015-04-28 15:26:21 +00:00
Rafael Espindola b64175076f Avoid an extra loop for computing the section size. NFC.
llvm-svn: 235994
2015-04-28 15:04:09 +00:00
Elena Demikhovsky 1f7b3644d3 Fixed crash of variable shift inst on AVX2
https://llvm.org/bugs/show_bug.cgi?id=22955

llvm-svn: 235993
2015-04-28 14:46:35 +00:00
Marshall Clow 0846f54b0e Update C++17 status; mark issues 2170, 2377, and 2408 as complete. We already do these; no code changes necessary.
llvm-svn: 235992
2015-04-28 14:26:29 +00:00
Hafiz Abid Qadeer 7f2f0ccb0a Replace sprintf with snprintf to avoid a crash.
During testing -data-list-register-values, I saw a crash here due to buffer overflow.
This commit should fix the crash. There is still problem with printing 1-byte register
in some cases that I will fix separately.

No regression on MI test cases.

llvm-svn: 235991
2015-04-28 14:16:00 +00:00
Toma Tabacu 7dea2e3982 [mips] [IAS] Do not generate redundant ORi in createLShiftOri.
Summary: If the immediate is 0, the ORi is pointless.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235990
2015-04-28 14:06:35 +00:00
Sergey Dmitrouk 842a51bad8 Reapply r235977 "[DebugInfo] Add debug locations to constant SD nodes"
[DebugInfo] Add debug locations to constant SD nodes

This adds debug location to constant nodes of Selection DAG and updates
all places that create constants to pass debug locations
(see PR13269).

Can't guarantee that all locations are correct, but in a lot of cases choice
is obvious, so most of them should be. At least all tests pass.

Tests for these changes do not cover everything, instead just check it for
SDNodes, ARM and AArch64 where it's easy to get incorrect locations on
constants.

This is not complete fix as FastISel contains workaround for wrong debug
locations, which drops locations from instructions on processing constants,
but there isn't currently a way to use debug locations from constants there
as llvm::Constant doesn't cache it (yet). Although this is a bit different
issue, not directly related to these changes.

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

llvm-svn: 235989
2015-04-28 14:05:47 +00:00
Rafael Espindola effdc7e981 Use CIE version 4 for dwarf4.
According to http://www.dwarfstd.org/doc/DWARF4.pdf appendix F the CIE
version for dwarf 4 is 4.

llvm-svn: 235988
2015-04-28 13:55:31 +00:00
Daniel Jasper 48e93f7181 Revert "[DebugInfo] Add debug locations to constant SD nodes"
This breaks a test:
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/23870

llvm-svn: 235987
2015-04-28 13:38:35 +00:00
Elena Demikhovsky 35dc8c0944 AVX-512: added intrinsics for KNL and SKX
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 235986
2015-04-28 13:28:01 +00:00
Alexey Bataev 6111469a4a [OPENMP] Fix crash on loop control vars explicitly marked as private.
It is allowed to mark loop control vars as private in 'private' or 'lastprivate' clause, so no need to assert here.

llvm-svn: 235985
2015-04-28 13:20:05 +00:00
Toma Tabacu 6114565269 [mips] [IAS] Rename the createShiftOr function to createLShiftOri. NFC.
Summary: The new name is more accurate with regard to the functionality.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235984
2015-04-28 13:16:06 +00:00
Ilia K 7f83624222 Add language option in -gdb-show command (MI)
Summary:
Add language option in -gdb-show command + test:
```
$ bin/lldb-mi ~/p/hello
[...]
b main
[...]
r
[...]
(gdb)
-gdb-show language
^done,value="c++"
(gdb)
quit
```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh, granata.enrico, jingham, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, jingham, granata.enrico, clayborg, abidh

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

llvm-svn: 235983
2015-04-28 12:51:16 +00:00
Ilia K 6e46512ec3 Don't print a type of variable in Address::Dump if it's unknown (i.e. nullptr)
Summary: This patch fixes dereferencing of nullptr in case when GetType() returns that.

Reviewers: jingham, granata.enrico, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, granata.enrico, clayborg, jingham

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

llvm-svn: 235982
2015-04-28 12:45:57 +00:00