Commit Graph

68118 Commits

Author SHA1 Message Date
Adam Nemet 370d0877f6 Set FMF for -ffp-contract=fast
With this, FMF(contract) becomes an alternative way to express the request to
contract.

These are currently only propagated for FMul, FAdd and FSub.  The rest will be
added as more FMFs are hooked up for this.

This is toward fixing PR25721.

Differential Revision: https://reviews.llvm.org/D31168

llvm-svn: 299469
2017-04-04 21:18:30 +00:00
Matthias Gehre ddae2516b8 [clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)
Summary:
The new test case was crashing before. Now it passes
as expected.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D31441

llvm-svn: 299465
2017-04-04 20:11:13 +00:00
Dominic Chen 08f943c563 [analyzer] Add new Z3 constraint manager backend
Summary: Implement new Z3 constraint manager backend.

Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D28952

llvm-svn: 299463
2017-04-04 19:52:25 +00:00
Coby Tayree b76fb84032 [fixup][X86][inline-asm] Add support for MS 'EVEN' directive
refining tested targets resolution, to amend failures caused by rL299454

llvm-svn: 299459
2017-04-04 19:20:21 +00:00
Coby Tayree b186493cc8 [X86][inline-asm] Add support for MS 'EVEN' directive
MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'.
This patch include the (small, simple) changes need to allow it.

llvm-side:
https://reviews.llvm.org/D27417

Differential Revision: https://reviews.llvm.org/D27418

llvm-svn: 299454
2017-04-04 17:58:28 +00:00
Anastasia Stulova 297908da5b [Bug 25404] Fix crash on typedef in OpenCL 2.0
Fixed the assertion due to absence of source location for
implicitly defined types (using addImplicitTypedef()).
During Sema checks the source location is being expected
and therefore an assertion is triggered.

The change is not specific to OpenCL. But it is particularly
common for OpenCL types to be declared implicitly in Clang
to support the mode without the standard header.

Differential Revision: https://reviews.llvm.org/D31397

llvm-svn: 299447
2017-04-04 16:50:46 +00:00
Jin-Gu Kang e7cdcdea73 Preserve vec3 type.
Summary: Preserve vec3 type with CodeGen option.

Reviewers: Anastasia, bruno

Reviewed By: Anastasia

Subscribers: bruno, ahatanak, cfe-commits

Differential Revision: https://reviews.llvm.org/D30810

llvm-svn: 299445
2017-04-04 16:40:25 +00:00
Michael Zuckerman 13bcf4944a Fix problem with test.
llvm-svn: 299442
2017-04-04 15:44:06 +00:00
Michael Zuckerman 755a13db3d [X86][Clang] Converting __mm{|256|512}_movm_epi{8|16|32|64} LLVMIR call into generic intrinsics.
This patch is a part two of two reviews, one for the clang and the other for LLVM. 
In this patch, I covered the clang side, by introducing the intrinsic to the front end. 
This is done by creating a generic replacement.

Differential Revision: https://reviews.llvm.org/D31394a

llvm-svn: 299431
2017-04-04 13:29:53 +00:00
Craig Topper 451eedd3b6 [X86] Remove some code that tries to disable HLE feature. This feature flag was removed from the backend.
llvm-svn: 299416
2017-04-04 06:38:44 +00:00
Galina Kistanova 53ddd72595 Modules/builtins.m requires shell.
llvm-svn: 299410
2017-04-04 02:50:40 +00:00
Craig Topper 01bba17819 Recommit r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.'
The bot didn't recover after the revert. So it looks like this wasn't the issue.

llvm-svn: 299397
2017-04-03 22:59:30 +00:00
Gabor Horvath 3b392bb8d8 Revert r299355 "[ASTImporter] Fix for importing unnamed structs"
It breaks windows bots. 

llvm-svn: 299386
2017-04-03 21:06:45 +00:00
Craig Topper 27b71e5b1b Revert r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.' to see if recovers a fuzzer bot.
llvm-svn: 299382
2017-04-03 19:43:47 +00:00
Eric Fiselier bee782bb92 [coroutines] Fix rebuilding of implicit and dependent coroutine statements.
Summary:
Certain implicitly generated coroutine statements, such as the calls to 'return_value()' or `return_void()` or `get_return_object_on_allocation_failure()`, cannot be built until the promise type is no longer dependent. This means they are not built until after the coroutine body statement has been transformed.

This patch fixes an issue where these statements would never be built for coroutine templates.

It also fixes a small issue where diagnostics about `get_return_object_on_allocation_failure()` were incorrectly suppressed. 

Reviewers: rsmith, majnemer, GorNishanov, aaron.ballman

Reviewed By: GorNishanov

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31487

llvm-svn: 299380
2017-04-03 19:21:00 +00:00
Davide Italiano 7a3b69d096 [TargetInfo] Use llvm::alignOf() instead of rewriting it. NFCI.
llvm-svn: 299364
2017-04-03 16:51:39 +00:00
Alex Lorenz 348c144d50 Enhance -Wshadow to warn when shadowing typedefs or type aliases
Enhance -Wshadow to emit a warning when typedefs or type aliases are shadowed.

Fixes bug https://bugs.llvm.org//show_bug.cgi?id=28676.

Patch by Ahmed Asadi.

Differential Revision: https://reviews.llvm.org/D31235

llvm-svn: 299363
2017-04-03 16:43:21 +00:00
Gabor Horvath 3d2c10d941 [ASTImporter] Fix for importing unnamed structs
Patch by Peter Szecsi!

Differential Revision: https://reviews.llvm.org/D30876

llvm-svn: 299355
2017-04-03 11:57:11 +00:00
Gabor Horvath 5558ba2d82 [ASTImporter] Lookup SearchName instead of Name
When the SearchName is already calculated we should use that for the lookup.

Patch by Peter Szecsi!

Differential Revision: https://reviews.llvm.org/D30877

llvm-svn: 299354
2017-04-03 09:30:20 +00:00
Craig Topper bf82498301 [AVX-512] Fix a couple more intrinsic macros I missed in r299346.
llvm-svn: 299347
2017-04-03 03:51:57 +00:00
Craig Topper ac9959eb53 [AVX-512] Fix some intrinsic macros that use the wrong macro parameter names and don't have parentheses around them.
Thanks to Matthew Barr for reporting this issue.

llvm-svn: 299346
2017-04-03 03:41:29 +00:00
Craig Topper ce272ae2c5 [X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.
Fixes PR32491.

llvm-svn: 299321
2017-04-02 03:02:53 +00:00
Faisal Vali d143a0c2de [NFC, Scoped Enum] Convert Sema::ExpressionEvaluationContext into a scoped Enum
- also replace direct equality checks against the ConstantEvaluated enumerator  with isConstantEvaluted(), in anticipation of adding finer granularity to the various ConstantEvaluated contexts and reinstating certain restrictions on where lambda expressions can occur in C++17.

- update the clang tablegen backend that uses these Enumerators, and add the relevant scope where needed.

llvm-svn: 299316
2017-04-01 21:30:49 +00:00
Davide Italiano 1a3665bb82 [Driver] Don't crash on invalid values of -mrelocation-model=.
This is handled in a similar way we handle invalid -mcode-model.

PR: 31840
llvm-svn: 299315
2017-04-01 21:07:07 +00:00
Benjamin Kramer 9851cb76e2 [ObjC++] Use the correct EH personality in GNU mode
Previously, it would just always use the ObjC DWARF personality, even with SjLj
or SEH exceptions.

Patch by Jonathan Schleifer, test case by me.

llvm-svn: 299306
2017-04-01 17:59:01 +00:00
Gor Nishanov 63b6df4f05 [coroutines] Add cleanup for compiler injected objects/allocations in coroutine body
Summary:
* Use pushCleanup to emit freeing coroutine memory on normal and EH exits.
* Surround emitted code with CodeGenFunction::RunCleanupsScope.

Reviewers: rsmith, rnk, EricWF

Reviewed By: rnk

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31460

llvm-svn: 299281
2017-04-01 00:22:47 +00:00
Teresa Johnson b637cb07ed [ThinLTO] Handle -emit-llvm* in ThinLTO backends
Summary:
Use PreCodeGenModuleHook to invoke the correct writer when emitting LLVM
IR, returning false to skip codegen from within thinBackend.

Reviewers: pcc, mehdi_amini

Subscribers: Prazek, cfe-commits

Differential Revision: https://reviews.llvm.org/D31534

llvm-svn: 299274
2017-03-31 22:35:47 +00:00
Brad Smith 3f2b1d741e Add/update PIE defaults for OpenBSD.
llvm-svn: 299269
2017-03-31 22:13:17 +00:00
Craig Topper f771f79b2f [Sema][X86] Update immediate check for gather/scatter prefetch instructions to match the _MM_HINT_T0/T1 constant definitions
Our _MM_HINT_T0/T1 constant values are 3/2 which matches gcc, but not icc or Intel documentation. Interestingly gcc had this same bug on their implementation of the gather/scatter builtins at one point too.

Fixes PR32411.

llvm-svn: 299233
2017-03-31 17:22:30 +00:00
Petar Jovanovic 9b8b9e81dd [mips][msa] Range adjustment for ldi_b builtin function operand
Reasoning behind this change was allowing the function to accept all values
from range [-128, 255] since all of them can be encoded in an 8bit wide
value.
This differs from the prior state where only range [-128, 127] was accepted,
where values were assumed to be signed, whereas now the actual
interpretation of the immediate is deferred to the consumer as required.

Patch by Stefan Maksimovic.

Differential Revision: https://reviews.llvm.org/D31082

llvm-svn: 299229
2017-03-31 16:16:43 +00:00
Alex Lorenz 7d7e1e0218 [Modules][PCH] Serialize #pragma pack
This patch serializes the state of #pragma pack. It preserves the state of the
pragma from a PCH/from modules in a file that uses that PCH/those modules.

rdar://21359084

Differential Revision: https://reviews.llvm.org/D31241

llvm-svn: 299226
2017-03-31 15:36:21 +00:00
Teresa Johnson 3cfab4b934 Add back test for r299152
I am hoping the bot failures are addressed by using cc1 for the ThinLTO
backend invocations as well.

llvm-svn: 299217
2017-03-31 13:48:18 +00:00
Daniel Jasper 1dbc2105dc clang-format: Fix post-commit review comment of r299204, use Style.isCpp().
Also, while at it, s/IsCpp/isCpp/ so that it follows LLVM style.

llvm-svn: 299214
2017-03-31 13:30:24 +00:00
Hans Wennborg 9d7df75c9c clang-format vs plugin support for Visual Studio 2017
With the release of Visual Studio 2017, we need to at the very least
claim support for it in the current manifest file. With the changes
introducted in this patch we can install the extension again, but a
warning message will be shown stating that it's not supported
(https://twitter.com/parsley72/status/846558416751411200).

To get the rid of the warning more work is necessary, as VS 2017 changed
some things about extensions, see more here:
https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-migrate-extensibility-projects-to-visual-studio-2017.
While working on those changes, it has been suggested in the
mail list that this first patch is integrated in the meantime.

Patch by Hugo Puhlmann!

Differential Revision: https://reviews.llvm.org/D31522

llvm-svn: 299210
2017-03-31 12:50:42 +00:00
Daniel Jasper 72b3357f2d clang-format: [JavaScript] Ignore QT keywords.
llvm-svn: 299204
2017-03-31 12:04:37 +00:00
Simon Pilgrim 750bde62dd Spelling mistakes in comments. NFCI.
llvm-svn: 299198
2017-03-31 11:00:53 +00:00
Simon Pilgrim 71a165d192 Strip trailing whitespace
llvm-svn: 299193
2017-03-31 10:40:56 +00:00
Egor Churaev ba8b84d7fb [OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args
Summary:
"kernel_arg_type_qual" metadata should contain const/volatile/restrict
tags only for pointer types to match the corresponding requirement of
the OpenCL specification.

OpenCL 2.0 spec 5.9.3 Kernel Object Queries:

CL_KERNEL_ARG_TYPE_VOLATILE is returned if the argument is a pointer
and the referenced type is declared with the volatile qualifier.
[...]
Similarly, CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a
pointer and the referenced type is declared with the restrict or const
qualifier.
[...]
CL_KERNEL_ARG_TYPE_RESTRICT will be returned if the pointer type is
marked restrict.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

Differential Revision: https://reviews.llvm.org/D31321

llvm-svn: 299192
2017-03-31 10:14:52 +00:00
Benjamin Kramer 2a7d39dfe8 [msan] Turn off lifetime markers even when use after scope checking is on.
Since r299174 use after scope checking is on by default. Even though
msan doesn't check for use after scope it gets confused by the lifetime
markers emitted for it, making unit tests fail. This is covered by
ninja check-msan.

llvm-svn: 299191
2017-03-31 09:19:25 +00:00
Teresa Johnson adeae05f2d Revert test added in r299152
Removing the test until I can figure out how to get the ThinLTO backend
invocation of clang to use the correct target.

llvm-svn: 299181
2017-03-31 04:29:07 +00:00
Teresa Johnson 163e4992b7 Add target-cpu
Sigh, another follow-on fix needed for test in r299152 causing bot
failures. We also need the target-cpu for the ThinLTO BE clang
invocation.

llvm-svn: 299178
2017-03-31 03:49:52 +00:00
Teresa Johnson 0c835d21c0 Add more target triples to test
Third and hopefully final fix to test for r299152 that is causing bot
failures: make sure the target triple specified for the ThinLTO backend
clang invocations as well.

llvm-svn: 299176
2017-03-31 03:27:47 +00:00
Kuba Mracek b26f857612 [asan] Turn -fsanitize-address-use-after-scope on by default [clang part]
AddressSanitizer has an optional compile-time flag, -fsanitize-address-use-after-scope, which enables detection of use-after-scope bugs. We'd like to have this feature on by default, because it is already very well tested, it's used in several projects already (LLVM automatically enables it when using -DLLVM_USE_SANITIZER=Address), it's low overhead and there are no known issues or incompatibilities.

This patch enables use-after-scope by default via the Clang driver, where we set true as the default value for AsanUseAfterScope. This also causes the lifetime markers to be generated whenever fsanitize=address is used. This has some nice consequences, e.g. we now have line numbers for all local variables.

Differential Revision: https://reviews.llvm.org/D31479

llvm-svn: 299174
2017-03-31 03:00:09 +00:00
Teresa Johnson fcb8989d72 Fix new compile command in test
My previous attempt to fix bot failures from r299152 didn't add the
necessary option to get bitcode out of the cc1 step.

llvm-svn: 299173
2017-03-31 02:55:31 +00:00
Teresa Johnson ae9c74280c Add triple to new test
Attempt to fix bot errors from r299152 by using clang_cc1 and specifying
target triple to compile step.

llvm-svn: 299170
2017-03-31 02:36:47 +00:00
Teresa Johnson 5ed6c10761 [ThinLTO] Set up lto::Config properly for codegen in ThinLTO backends
Summary:
This involved refactoring out pieces of
EmitAssemblyHelper::CreateTargetMachine for use in runThinLTOBackend.

Subsumes D31114.

Reviewers: mehdi_amini, pcc

Subscribers: Prazek, cfe-commits

Differential Revision: https://reviews.llvm.org/D31508

llvm-svn: 299152
2017-03-31 02:05:15 +00:00
Eric Christopher 27e147e471 Update x86-64 ABI link with the one from linuxbase.org since the other
seems to be down.

llvm-svn: 299151
2017-03-31 01:59:40 +00:00
Eric Christopher 0d2c56a5c0 Fix typo, defind -> defined.
llvm-svn: 299148
2017-03-31 01:45:39 +00:00
Dean Michael Berris ac7a2f97d4 fixup: use CHECK for non-atttribute sets
llvm-svn: 299127
2017-03-30 22:46:49 +00:00
Dean Michael Berris 504fc2262a [XRay][clang] Fix the -fxray-instruction-threshold flag processing
Summary:
The refactoring introduced a regression in the flag processing for
-fxray-instruction-threshold which causes it to not get passed properly.
This change should restore the previous behaviour.

Reviewers: rnk, pelikan

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31491

llvm-svn: 299126
2017-03-30 22:46:45 +00:00