Mike Aizatsky [Thu, 21 Apr 2016 22:00:13 +0000 (22:00 +0000)]
Fixed flag description
Summary:
asan-use-after-return control feature we call use-after-return or
stack-use-after-return.
Reviewers: kcc, aizatsky, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19284
llvm-svn: 267064
Rafael Espindola [Thu, 21 Apr 2016 21:44:25 +0000 (21:44 +0000)]
Internalize linkonce_odr more often.
Since there is a copy in every translation unit that uses them, they can
be omitted from the symbol table if the address is not significant.
This still doesn't catch as many cases as the gold plugin. The
difference is that we check canBeOmittedFromSymbolTable in each file and
use lazy loading which limits what it can do. Gold checks it in the merged file.
I think the correct way of getting the same results as gold is just to
cache in the IR the result of canBeOmittedFromSymbolTable.
llvm-svn: 267063
Artem Belevich [Thu, 21 Apr 2016 21:40:27 +0000 (21:40 +0000)]
[CUDA] removed unneeded __nvvm_reflect_anchor()
Since r265060 LLVM infers correct __nvvm_reflect attributes, so
explicit declaration of __nvvm_reflect() is no longer needed.
Differential Revision: http://reviews.llvm.org/D19074
llvm-svn: 267062
Amaury Sechet [Thu, 21 Apr 2016 21:36:11 +0000 (21:36 +0000)]
Remove various warnings. NFC
llvm-svn: 267061
Derek Bruening [Thu, 21 Apr 2016 21:32:25 +0000 (21:32 +0000)]
[esan] EfficiencySanitizer base runtime library
Summary:
Adds the initial version of a runtime library for the new
EfficiencySanitizer ("esan") family of tools. The library includes:
+ Slowpath code via callouts from the compiler instrumentation for
each memory access.
+ Registration of atexit() to call finalization code.
+ Runtime option flags controlled by the environment variable
ESAN_OPTIONS. The common sanitizer flags are supported such as
verbosity and log_path.
+ An initial simple test.
Still TODO: common code for libc interceptors and shadow memory mapping,
and tool-specific code for shadow state updating.
Reviewers: eugenis, vitalybuka, aizatsky, filcab
Subscribers: filcab, vkalintiris, kubabrecka, llvm-commits, zhaoqin, kcc
Differential Revision: http://reviews.llvm.org/D19168
llvm-svn: 267060
Derek Bruening [Thu, 21 Apr 2016 21:32:04 +0000 (21:32 +0000)]
[esan] EfficiencySanitizer driver flags
Summary:
Adds a framework to enable the instrumentation pass for the new
EfficiencySanitizer ("esan") family of tools. Adds a flag for esan's
cache fragmentation tool via -fsanitize=efficiency-cache-frag.
Adds appropriate tests for the new flag.
Reviewers: eugenis, vitalybuka, aizatsky, filcab
Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc
Differential Revision: http://reviews.llvm.org/D19169
llvm-svn: 267059
Derek Bruening [Thu, 21 Apr 2016 21:30:22 +0000 (21:30 +0000)]
[esan] EfficiencySanitizer instrumentation pass
Summary:
Adds an instrumentation pass for the new EfficiencySanitizer ("esan")
performance tuning family of tools. Multiple tools will be supported
within the same framework. Preliminary support for a cache fragmentation
tool is included here.
The shared instrumentation includes:
+ Turn mem{set,cpy,move} instrinsics into library calls.
+ Slowpath instrumentation of loads and stores via callouts to
the runtime library.
+ Fastpath instrumentation will be per-tool.
+ Which memory accesses to ignore will be per-tool.
Reviewers: eugenis, vitalybuka, aizatsky, filcab
Subscribers: filcab, vkalintiris, pcc, silvas, llvm-commits, zhaoqin, kcc
Differential Revision: http://reviews.llvm.org/D19167
llvm-svn: 267058
Amaury Sechet [Thu, 21 Apr 2016 21:29:10 +0000 (21:29 +0000)]
Add utility function to manipulate attributes on CallSite. NFC
Summary: As per title. This will help work on the C API.
Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19173
llvm-svn: 267057
Kevin Enderby [Thu, 21 Apr 2016 21:20:40 +0000 (21:20 +0000)]
Fix a typo in an error message. Caught by Sean Silva!
llvm-svn: 267056
Vedant Kumar [Thu, 21 Apr 2016 21:07:25 +0000 (21:07 +0000)]
[ProfileData] Report errors from InstrProfSymtab::create
InstrProfSymtab::create can fail with instrprof_error::malformed, but
this error is silently dropped. Propagate the error up to the caller so
we fail early.
Eventually, I'd like to transition ProfileData over to the new Error
class so we can't ignore hard failures like this.
llvm-svn: 267055
Richard Trieu [Thu, 21 Apr 2016 21:04:55 +0000 (21:04 +0000)]
Split interesting warnings off from -Wfloat-conversion
Restructure the implict floating point to integer conversions so that
interesting sub-groups are under different flags. Breakdown of warnings:
No warning:
Exact conversions from floating point to integer:
int x = 10.0;
int x = 1e10;
-Wliteral-conversion - Floating point literal to integer with rounding:
int x = 5.5;
int x = -3.4;
-Wfloat-conversion - All conversions not covered by the above two:
int x = GetFloat();
int x = 5.5 + 3.5;
-Wfloat-zero-conversion - The expression converted has a non-zero floating
point value that gets converted to a zero integer value, excluded the cases
falling under -Wliteral-conversion. Subset of -Wfloat-conversion.
int x = 1.0 / 2.0;
-Wfloat-overflow-conversion - The floating point value is outside the range
of the integer type, exluding cases from -Wliteral conversion. Subset of
-Wfloat-conversion.
char x = 500;
char x = -1000;
-Wfloat-bool-conversion - Any conversion of a floating point type to bool.
Subset of -Wfloat-conversion.
if (GetFloat()) {}
bool x = 5.0;
-Wfloat-bool-constant-conversion - Conversion of a compile time evaluatable
floating point value to bool. Subset of -Wfloat-bool-conversion.
bool x = 1.0;
bool x = 4.0 / 20.0;
Also add EvaluateAsFloat to Sema, which is similar to EvaluateAsInt, but for
floating point values.
llvm-svn: 267054
Sanjay Patel [Thu, 21 Apr 2016 21:02:25 +0000 (21:02 +0000)]
add tests for disguised fabs/fneg
llvm-svn: 267053
Quentin Colombet [Thu, 21 Apr 2016 21:01:13 +0000 (21:01 +0000)]
[MachineBasicBlock] Make the pass argument truly mandatory when
splitting edges.
MachineBasicBlock::SplitCriticalEdges will crash if a nullptr would have
been passed for the Pass argument. Do not allow that by turning this
argument into a reference.
The alternative would have been to make the Pass a truly optional
argument, but although this is easy to do, I was afraid users using it
like this would not be aware the livness information, dominator tree and
such would silently be broken.
llvm-svn: 267052
Sanjay Patel [Thu, 21 Apr 2016 20:58:58 +0000 (20:58 +0000)]
use FileCheck; add test for disguised fabs
llvm-svn: 267051
Zachary Turner [Thu, 21 Apr 2016 20:58:41 +0000 (20:58 +0000)]
Add natvis visualizers for endian types.
This allows ulittle* and ubig* types to be visualized properly
in VS.
Differential Revision: http://reviews.llvm.org/D19339
Reviewed By: Aaron Ballman
llvm-svn: 267050
Zachary Turner [Thu, 21 Apr 2016 20:58:35 +0000 (20:58 +0000)]
Refactor raw pdb dumper into library
PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the
parsing of this code into DebugInfoPDB and makes the dumper use this.
This is achieved by implementing the skeleton of RawPdbSession, the
non-DIA counterpart to the existing PDB read interface. None of the type /
source file / etc information is accessible yet, so this implementation is
not yet close to achieving parity with the DIA counterpart, but the
RawSession class simply holds a reference to a PDBFile class which handles
parsing the file format. Additionally a PDBStream class is introduced
which allows accessing the bytes of a particular stream in a PDB file.
Differential Revision: http://reviews.llvm.org/D19343
Reviewed By: majnemer
llvm-svn: 267049
Ryan Brown [Thu, 21 Apr 2016 20:57:28 +0000 (20:57 +0000)]
Update Go OS Plugin for newer runtimes.
Differential Revision: http://reviews.llvm.org/D19273
llvm-svn: 267048
Rui Ueyama [Thu, 21 Apr 2016 20:50:15 +0000 (20:50 +0000)]
Remove SymPair and instead use two DefinedRegulars instead.
I noticed that I was looking for the definition of SymPair when hacking
the Writer, only to find that it is just a pair of DefinedRegular symbols.
I don't think it provides more values than the cost of using brainpower
to memorize the type. I didn't roll back r266317, which introduced SymPair,
because the patch removes code repetitions. I ported that change to new
code.
llvm-svn: 267047
Quentin Colombet [Thu, 21 Apr 2016 20:46:27 +0000 (20:46 +0000)]
[MachineBasicBlock] Refactor SplitCriticalEdge to expose a query API.
Introduce canSplitCriticalEdge, so that clients can now query whether or
not a critical edge can be split without actually needing to split it.
This may be useful when gathering information for cost models for
instance.
llvm-svn: 267046
Rafael Espindola [Thu, 21 Apr 2016 20:35:25 +0000 (20:35 +0000)]
Start adding support for internalizing shared libraries.
llvm-svn: 267045
Rui Ueyama [Thu, 21 Apr 2016 20:30:00 +0000 (20:30 +0000)]
ELF: Change the return type of getSectionOrder.
Also changed the function name and added comments.
llvm-svn: 267044
Kevin Enderby [Thu, 21 Apr 2016 20:29:49 +0000 (20:29 +0000)]
hange the variable name big_size to BigSize. Caught by Rafael EspĂndola!
llvm-svn: 267043
Andrew Kaylor [Thu, 21 Apr 2016 20:09:35 +0000 (20:09 +0000)]
Zero-initialize members of the CpuHashInfoTy structure for AsmParser
llvm-svn: 267042
Lang Hames [Thu, 21 Apr 2016 20:08:06 +0000 (20:08 +0000)]
[RuntimeDyld] Fix conservative over-allocation of memory for common symbols.
The previous allocation code was over-estimating the amount of memory required.
No test case: we don't currently have a good way to detect conervative
over-allocation.
llvm-svn: 267041
Nico Weber [Thu, 21 Apr 2016 19:59:10 +0000 (19:59 +0000)]
clang-cl: Don't assert on using /Yc with non-source files, PR27450
Move phase handling after input type validation.
llvm-svn: 267040
JF Bastien [Thu, 21 Apr 2016 19:53:39 +0000 (19:53 +0000)]
NFC: fix copy / paste comment
llvm-svn: 267039
Krzysztof Parzyszek [Thu, 21 Apr 2016 19:49:53 +0000 (19:49 +0000)]
[Hexagon] Properly recognize register alt names
llvm-svn: 267038
Kevin Enderby [Thu, 21 Apr 2016 19:49:29 +0000 (19:49 +0000)]
Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non-existent section.
Showed up in running on a large binary with the missing section. I could create a fake
test case if anyone really wants but the fix is pretty obvious.
rdar://
25837034
llvm-svn: 267037
JF Bastien [Thu, 21 Apr 2016 19:41:48 +0000 (19:41 +0000)]
NFC: fix nonsensical comment
llvm-svn: 267036
Sanjoy Das [Thu, 21 Apr 2016 19:26:45 +0000 (19:26 +0000)]
Folding compares with unescaped allocations
Summary:
If we know that the pointer allocated within a function does not escape,
we can fold away comparisons that are done with global pointers
Patch by Anna Thomas!
Reviewers: reames, majnemer, sanjoy
Subscribers: mgrang, mcrosier, majnemer, llvm-commits
Differential Revision: http://reviews.llvm.org/D19276
llvm-svn: 267035
Krzysztof Parzyszek [Thu, 21 Apr 2016 18:56:45 +0000 (18:56 +0000)]
[Hexagon] Expand handling of the small-data/bss section
llvm-svn: 267034
Quentin Colombet [Thu, 21 Apr 2016 18:34:43 +0000 (18:34 +0000)]
[RegisterBankInfo] Change the API for the verify methods.
Return bool instead of void so that it is natural to put the calls into
asserts.
llvm-svn: 267033
Saleem Abdulrasool [Thu, 21 Apr 2016 18:29:13 +0000 (18:29 +0000)]
ELF: support -- version of discard-{all,locals}
GNU ld and gold only support the discard-all and discard-locals with two dashes.
Retain the compatibility with the one dash spelling, but also accept the two
dashed form.
llvm-svn: 267032
Saleem Abdulrasool [Thu, 21 Apr 2016 18:29:09 +0000 (18:29 +0000)]
ELF: alias `--no-copy-dt-needed-entries` to `--no-add-needed`
`--add-needed` and `--no-add-needed` have been deprecated due to the similarity
of their spelling to `--as-needed` and `--no-as-needed`. They have been renamed
to `--copy-dt-needed-entries` and `--no-copy-dt-needed-entries`.
llvm-svn: 267031
Matt Arsenault [Thu, 21 Apr 2016 18:21:54 +0000 (18:21 +0000)]
AMDGPU: Fix debug name of pass to better match
I get this wrong every time I try to debug this.
llvm-svn: 267030
Matt Arsenault [Thu, 21 Apr 2016 18:19:11 +0000 (18:19 +0000)]
LegalizeDAG: Move unaligned load/store expansion to TLI
When custom lowered, this is not called if the store is custom
lowered. Move it to be a utility function so targets can
easily expand unaligned accesses when custom lowering.
llvm-svn: 267029
Evgeniy Stepanov [Thu, 21 Apr 2016 18:18:09 +0000 (18:18 +0000)]
[asan] Mark strdup test as unsupported on arm/linux.
llvm-svn: 267028
Etienne Bergeron [Thu, 21 Apr 2016 18:15:35 +0000 (18:15 +0000)]
[clang-tidy] Fix broken build bot.
Summary:
There is a build bot that doesn't support 'constexpr'.
```
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe /nologo /TP /DWIN32 /D_WINDOWS /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -Itools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\include -Itools\clang\include -Iinclude -ID:\buildslave\clang-x64-ninja-win7\llvm\include -UNDEBUG /EHs-c- /GR- /showIncludes -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Fotools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\SuspiciousStringCompareCheck.cpp.obj /Fdtools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\ /FS -c D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C2144: syntax error : 'char' should be preceded by ';'
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ninja: build stopped: subcommand failed.
program finished with exit code 1
```
Reviewers: alexfh, sbenza
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19379
llvm-svn: 267027
Eugene Zelenko [Thu, 21 Apr 2016 18:13:09 +0000 (18:13 +0000)]
[Release Notes] Mention Clang-tidy misc-string-constructor and misc-suspicious-string-compare checks.
Fix excessive line in misc-string-constructor documentation.
llvm-svn: 267026
Quentin Colombet [Thu, 21 Apr 2016 18:09:34 +0000 (18:09 +0000)]
[RegisterBankInfo] Change the representation of the partial mappings.
Instead of holding a mask, hold two value: the start index and the
length of the mapping. This is a more compact representation, although
less powerful. That being said, arbitrary masks would not have worked
for the generic so do not allow them in the first place.
llvm-svn: 267025
Matt Arsenault [Thu, 21 Apr 2016 18:03:06 +0000 (18:03 +0000)]
DAGCombiner: Reduce 64-bit BFE pattern to pattern on 32-bit component
If the extracted bits are restricted to the upper half or lower half,
this can be truncated.
llvm-svn: 267024
Philip Reames [Thu, 21 Apr 2016 17:59:40 +0000 (17:59 +0000)]
[instcombine][unordered] Extend load(select) transform to handle unordered loads
llvm-svn: 267023
Andrew Kaylor [Thu, 21 Apr 2016 17:58:54 +0000 (17:58 +0000)]
Initial implementation of optimization bisect support.
This patch implements a optimization bisect feature, which will allow optimizations to be selectively disabled at compile time in order to track down test failures that are caused by incorrect optimizations.
The bisection is enabled using a new command line option (-opt-bisect-limit). Individual passes that may be skipped call the OptBisect object (via an LLVMContext) to see if they should be skipped based on the bisect limit. A finer level of control (disabling individual transformations) can be managed through an addition OptBisect method, but this is not yet used.
The skip checking in this implementation is based on (and replaces) the skipOptnoneFunction check. Where that check was being called, a new call has been inserted in its place which checks the bisect limit and the optnone attribute. A new function call has been added for module and SCC passes that behaves in a similar way.
Differential Revision: http://reviews.llvm.org/D19172
llvm-svn: 267022
Nicolai Haehnle [Thu, 21 Apr 2016 17:48:02 +0000 (17:48 +0000)]
Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly
Summary:
IntrReadWriteArgMem simply becomes IntrArgMemOnly.
So there are fewer intrinsic properties that express their orthogonality
better, and correspond more closely to the corresponding IR attributes.
Suggested by: Philip Reames
Reviewers: joker.eph, reames, tstellarAMD
Subscribers: jholewinski, arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D19291
llvm-svn: 267021
Davide Italiano [Thu, 21 Apr 2016 17:46:38 +0000 (17:46 +0000)]
[LTO] Discard names for values that are not global by default.
Rafael reported on the mailing list that this reduces peak memory
usage while linking llvm-as by 15%. It makes sense to make it
the default, and introduce an inverse knob -lto-no-discard-value-names
for those who want to restore the old behavior.
llvm-svn: 267020
Philip Reames [Thu, 21 Apr 2016 17:45:05 +0000 (17:45 +0000)]
[unordered] unordered loads from null are still unreachable
llvm-svn: 267019
Rafael Espindola [Thu, 21 Apr 2016 17:37:11 +0000 (17:37 +0000)]
Reduce templating. NFC.
llvm-svn: 267018
Marcin Koscielnicki [Thu, 21 Apr 2016 17:36:05 +0000 (17:36 +0000)]
[PowerPC] [SSP] Fix stack guard load for 32-bit.
r266809 incorrectly used LD to load the stack guard, it should be LWZ.
Differential Revision: http://reviews.llvm.org/D19358
llvm-svn: 267017
Adam Nemet [Thu, 21 Apr 2016 17:33:22 +0000 (17:33 +0000)]
[LoopUtils] Fix typo in comment
llvm-svn: 267016
Adam Nemet [Thu, 21 Apr 2016 17:33:20 +0000 (17:33 +0000)]
[LoopUtils] Add asserts to findStringMetadataForLoop. NFC
These ensure that operand array has at least one element and it is the
self-reference.
llvm-svn: 267015
Adam Nemet [Thu, 21 Apr 2016 17:33:17 +0000 (17:33 +0000)]
[LoopUtils] Move def of findStringMetadataForLoop to LoopUtils.cpp. NFC
The decl is in LoopUtils.h. I think that this was added to
LoopVersioningLICM.cpp by mistake.
llvm-svn: 267014
Adam Nemet [Thu, 21 Apr 2016 17:33:12 +0000 (17:33 +0000)]
[LoopUtils] Rename {check->find}StringMetadata{Into->For}Loop. NFC
"Into" was misleading. I am also planning to use this helper to look
for loop metadata and return the argument, so find seems like a better
name.
llvm-svn: 267013
Rafael Espindola [Thu, 21 Apr 2016 17:30:24 +0000 (17:30 +0000)]
Delete the needsPlt target hook.
It can be made redundant with getRelExpr.
llvm-svn: 267012
Etienne Bergeron [Thu, 21 Apr 2016 17:28:08 +0000 (17:28 +0000)]
[clang-tidy] New checker to detect suspicious string constructor.
Summary:
Checker to validate string constructor parameters.
A common mistake is to swap parameter for the fill-constructor.
```
std::string str('x', 4);
std::string str('4', x);
```
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19146
llvm-svn: 267011
Eugene Zelenko [Thu, 21 Apr 2016 17:27:04 +0000 (17:27 +0000)]
Fix builds broken in r267008.
llvm-svn: 267010
Etienne Bergeron [Thu, 21 Apr 2016 17:19:36 +0000 (17:19 +0000)]
[clang-tidy] Add new checker for comparison with runtime string functions.
Summary:
This checker is validating suspicious usage of string compare functions.
Example:
```
if (strcmp(...)) // Implicitly compare to zero
if (!strcmp(...)) // Won't warn
if (strcmp(...) != 0) // Won't warn
```
This patch was checked over large amount of code.
There is three checks:
[*] Implicit comparator to zero (coding-style, many warnings found),
[*] Suspicious implicit cast to non-integral (bugs!?, almost none found),
[*] Comparison to suspicious constant (bugs!?, found two cases),
Example:
[[https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c |
https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c]]
```
else if(strcmp(id, "select") == 0)
{
array->array[i].key1 = 25;
}
else if(strcmp(id, "sk") == 28) // BUG!?
{
array->array[i].key1 = 20;
}
```
Reviewers: alexfh
Subscribers: Eugene.Zelenko, cfe-commits
Differential Revision: http://reviews.llvm.org/D18703
llvm-svn: 267009
Eugene Zelenko [Thu, 21 Apr 2016 17:14:10 +0000 (17:14 +0000)]
Fix Clang-tidy misc-unused-using-decls and Include What You Use warnings.
Differential revision: http://reviews.llvm.org/D19348
llvm-svn: 267008
Davide Italiano [Thu, 21 Apr 2016 17:11:39 +0000 (17:11 +0000)]
[LTO] An interesting case which shows up how we handle common symbols.
The gold plugin logic for common symbols is a little bit convoluted
as the plugin API has not an explicit way to update the alignment.
In gold, then, we need to keep the bitcode symbol @a around because
that's the only way to get the alignment right in the final object.
In lld, this is not true. We already have all the informations we
need about common symbols (size/alignment) so we don't have to
keep the existing symbol and pass it to the mover.
llvm-svn: 267007
Philip Reames [Thu, 21 Apr 2016 17:03:33 +0000 (17:03 +0000)]
[instcombine][unordered] Implement *-load forwarding for unordered atomics
This builds on 266999 which made FindAvailableValue do the right thing. Tests included show the newly enabled transforms and those which disabled either due to conservatism or correctness requirements.
llvm-svn: 267006
Rafael Espindola [Thu, 21 Apr 2016 16:59:25 +0000 (16:59 +0000)]
Don't recompute getRelExpr. NFC.
llvm-svn: 267005
Amjad Aboud [Thu, 21 Apr 2016 16:58:49 +0000 (16:58 +0000)]
Fixed Dwarf debug info emission to skip DILexicalBlockFile entries.
Before this fix, DILexicalBlockFile entries were skipped only in some cases and were not in other cases.
Differential Revision: http://reviews.llvm.org/D18724
llvm-svn: 267004
Etienne Bergeron [Thu, 21 Apr 2016 16:57:56 +0000 (16:57 +0000)]
[clang-tidy] Cleanup some ast-matchers and lift some to utils.
Summary:
Little cleanup to lift-out and to remove some frequently used
ast-matchers.
Some of theses matchers are candidates to be lifted to ASTMatchers.h.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19200
llvm-svn: 267003
Rafael Espindola [Thu, 21 Apr 2016 16:57:32 +0000 (16:57 +0000)]
Moves needsPlt to Writer.cpp.
It was only used there.
llvm-svn: 267002
Saleem Abdulrasool [Thu, 21 Apr 2016 16:56:02 +0000 (16:56 +0000)]
API: fix a -Wunused-variable warning
expr_log is only conditionally used via preprocessing. Ensure that we guard the
definition accordingly. NFC.
llvm-svn: 267001
Saleem Abdulrasool [Thu, 21 Apr 2016 16:55:58 +0000 (16:55 +0000)]
Host: fix some -Wformat-pedantic warnings
Add explicit casts for function pointer to void * for %p conversion. NFC.
llvm-svn: 267000
Philip Reames [Thu, 21 Apr 2016 16:51:08 +0000 (16:51 +0000)]
[unordered] Add tests and conservative handling in support of future changes [NFCI]
This change adds a couple of test cases to make sure FindAvailableLoadedValue does the right thing. At the moment, the code added is dead, but separating it makes follow on changes far more obvious.
llvm-svn: 266999
Chad Rosier [Thu, 21 Apr 2016 16:18:02 +0000 (16:18 +0000)]
Address Philip's post-commit feedback for r266987. NFC.
llvm-svn: 266998
Philip Reames [Thu, 21 Apr 2016 16:15:19 +0000 (16:15 +0000)]
Minor comment cleanup [NFC]
llvm-svn: 266997
Rafael Espindola [Thu, 21 Apr 2016 15:51:28 +0000 (15:51 +0000)]
Fix test to run everywhere.
Because of X86 instead of x86 is was masked as unsupported everywhere.
llvm-svn: 266996
Rafael Espindola [Thu, 21 Apr 2016 14:56:33 +0000 (14:56 +0000)]
Fix recursive -only-needed.
We were assuming that only linkonce_odr GVs were lazy linked.
llvm-svn: 266995
Kuba Brecka [Thu, 21 Apr 2016 14:49:25 +0000 (14:49 +0000)]
[tsan] Rename ReportThread->pid to ReportThread->os_id
The field "pid" in ReportThread is used to store the OS-provided thread ID (pthread_self or gettid). The name "pid" suggests it's a process ID, which it isn't. Let's rename it.
Differential Revision: http://reviews.llvm.org/D19365
llvm-svn: 266994
Renato Golin [Thu, 21 Apr 2016 14:40:06 +0000 (14:40 +0000)]
[x86] Force mixes asm syntax test to check for x86
llvm-svn: 266993
Alexander Kornienko [Thu, 21 Apr 2016 14:39:12 +0000 (14:39 +0000)]
[Clang-tidy] Fix for crash in modernize-raw-string-literal check
Summary:
Clang-tidy modernize-raw-string-literal check crashes on run-time assert while it is evaluating compiler predefined identifiers such as
- __FUNCTION__
- __func__
- __PRETTY_FUNCTION__
Check is asserting because it cannot find opening quote for such string literal. It occurs only on debug build config.
I think that it would be good to prune such cases by crossing off predefined expressions - there is no need to evaluate such matches.
Reviewers: LegalizeAdulthood, alexfh
Subscribers: cfe-commits
Patch by Marek Jenda!
Differential Revision: http://reviews.llvm.org/D19331
llvm-svn: 266992
Kuba Brecka [Thu, 21 Apr 2016 14:38:41 +0000 (14:38 +0000)]
[sanitizer] Use pthread_threadid_np as thread ID on OS X
Let's use pthread_threadid_np which returns a more reasonable ID than pthread_self (which is actually a stack pointer). The numbers from pthread_threadid_np are already used in other tools, e.g. in LLDB, and often appear in logs, so it's much more useful than pthread_self.
Differential Revision: http://reviews.llvm.org/D18951
llvm-svn: 266991
Zoran Jovanovic [Thu, 21 Apr 2016 14:32:12 +0000 (14:32 +0000)]
[mips][microMIPS] Implement ldpc instruction
Differential Revision: http://reviews.llvm.org/D15009
llvm-svn: 266990
Krzysztof Parzyszek [Thu, 21 Apr 2016 14:30:04 +0000 (14:30 +0000)]
[Hexagon] Define architecture version macros for hexagonv55
llvm-svn: 266989
Zoran Jovanovic [Thu, 21 Apr 2016 14:09:35 +0000 (14:09 +0000)]
[mips][microMIPS] Add R_MICROMIPS_PC19_S2 relocation
Differential Revision: http://reviews.llvm.org/D14915
llvm-svn: 266988
Chad Rosier [Thu, 21 Apr 2016 14:04:54 +0000 (14:04 +0000)]
Refactor implied condition logic from ValueTracking directly into CmpInst. NFC.
Differential Revision: http://reviews.llvm.org/D19330
llvm-svn: 266987
Aaron Ballman [Thu, 21 Apr 2016 13:51:07 +0000 (13:51 +0000)]
Clarify memory ownership semantics; NFC.
Patch by Clement Courbet
llvm-svn: 266986
Zoran Jovanovic [Thu, 21 Apr 2016 13:43:26 +0000 (13:43 +0000)]
[mips][microMIPS] Add R_MICROMIPS_PC26_S1 relocation
Differential Revision: http://reviews.llvm.org/D14822
llvm-svn: 266985
Sam Kolton [Thu, 21 Apr 2016 13:14:24 +0000 (13:14 +0000)]
[AMDGPU] Assembler: prevent parseDPPCtrlOps from eating invalid tokens
Reviewers: nhaustov, tstellarAMD
Subscribers: arsenm
Differential Revision: http://reviews.llvm.org/D19317
llvm-svn: 266984
Michael Zuckerman [Thu, 21 Apr 2016 12:47:27 +0000 (12:47 +0000)]
[Clang][AVX512][BuiltIn] Adding intrinsics of VGATHER{DPS|DPD} , VPGATHER{QD|QQ|DD|DQ} and VGATHERPF{0|1}{DPS|QPS|DPD|QPD} instruction set .
Differential Revision: http://reviews.llvm.org/D19224
llvm-svn: 266983
Rafael Espindola [Thu, 21 Apr 2016 12:21:06 +0000 (12:21 +0000)]
Use llvm::CachedHash.
llvm-svn: 266982
Rafael Espindola [Thu, 21 Apr 2016 12:16:21 +0000 (12:16 +0000)]
Add a CachedHash structure.
A DenseMap doesn't store the hashes, so it needs to recompute them when
the table is resized.
In some applications the hashing cost is noticeable. That is the case
for example in lld for symbol names (StringRef).
This patch adds a templated structure that can wraps any value that can
go in a DenseMap and caches the hash.
llvm-svn: 266981
Zlatko Buljan [Thu, 21 Apr 2016 11:32:40 +0000 (11:32 +0000)]
[mips][microMIPS] Implement TLBP, TLBR, TLBWI and TLBWR instructions
Differential Revision: http://reviews.llvm.org/D18855
llvm-svn: 266980
George Rimar [Thu, 21 Apr 2016 11:28:11 +0000 (11:28 +0000)]
[ELF] - Make LinkerScript::getSectionOrder private. NFC.
llvm-svn: 266979
George Rimar [Thu, 21 Apr 2016 11:21:48 +0000 (11:21 +0000)]
[ELF] - Use ArrayRef instead of std::vector& for LinkerScript module. NFC.
llvm-svn: 266978
Zlatko Buljan [Thu, 21 Apr 2016 11:01:51 +0000 (11:01 +0000)]
[mips][microMIPS] Implement LL, SC, MOVEP, ROTR, ROTRV and SYSCALL instructions and add tests for LWM32 and SWM32
Differential Revision: http://reviews.llvm.org/D19150
llvm-svn: 266977
Denis Zobnin [Thu, 21 Apr 2016 10:59:18 +0000 (10:59 +0000)]
Correctly parse GCC-style asm line following MS-style asm line.
Quit parsing MS-style inline assembly if the following statement has GCC style.
Enables compilation of code like
void f() {
__asm mov ebx, ecx
__asm__("movl %ecx, %edx");
}
Differential Revision: http://reviews.llvm.org/D18652
llvm-svn: 266976
Benjamin Kramer [Thu, 21 Apr 2016 10:46:14 +0000 (10:46 +0000)]
Back out the test case for r266973 for now.
It breaks on windows, need to investigate. It's not testing the
important part of that change anyways.
llvm-svn: 266975
George Rimar [Thu, 21 Apr 2016 10:22:02 +0000 (10:22 +0000)]
[ELF] - Get rid of SectionOrder array.
SectionOrder vector was a part of LinkerScript class.
It can be removed because Commands vector contains the
same information and SectiorOrder is just a subset.
Differential revision: http://reviews.llvm.org/D19171
llvm-svn: 266974
Benjamin Kramer [Thu, 21 Apr 2016 10:18:18 +0000 (10:18 +0000)]
[Tooling] Inject -resource-dir instead of overwriting argv[0].
This allows using a different standard library (the one from argv[0] in
the compilation database) with the correct builtins.
Differential Revision: http://reviews.llvm.org/D19356
llvm-svn: 266973
Andrey Turetskiy [Thu, 21 Apr 2016 10:16:48 +0000 (10:16 +0000)]
Compilation for Intel MCU (Part 1/3)
Add -miamcu option which:
* Sets IAMCU triple
* Sets IAMCU ABI
* Enforces static compilation
Differential Revision: http://reviews.llvm.org/D18398
llvm-svn: 266972
Evgeny Astigeevich [Thu, 21 Apr 2016 09:36:49 +0000 (09:36 +0000)]
Updated a test not to produce an empty s-file.
llvm-svn: 266971
Haojian Wu [Thu, 21 Apr 2016 09:16:32 +0000 (09:16 +0000)]
Fix cast compiler warning message in include-fixer.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19323
llvm-svn: 266970
Evgeny Astigeevich [Thu, 21 Apr 2016 08:54:08 +0000 (08:54 +0000)]
[AArch64][CodeGen] Fix of PR27158: incorrect peephole optimization in AArch64InstrInfo::optimizeCompareInstr
AArch64InstrInfo::optimizeCompareInstr has bug PR27158 which causes generation of incorrect code.
A compare instruction is substituted with another instruction which does not
produce the same flags as the original compare instruction.
This patch contains:
1. Fix of the bug.
2. A regression test in MIR.
3. A new test to check that SUBS is replaced by SUB.
Differential Revision: http://reviews.llvm.org/D18838
llvm-svn: 266969
Craig Topper [Thu, 21 Apr 2016 07:30:06 +0000 (07:30 +0000)]
[AVX512] Add CTTZ support for v8i64 and v16i32 vectors.
llvm-svn: 266968
Craig Topper [Thu, 21 Apr 2016 07:30:03 +0000 (07:30 +0000)]
[X86] Fix vector-tzcnt-512 test to disable CDI while enabling BWI for one of the runs. Update check patterns accordingly.
llvm-svn: 266967
Craig Topper [Thu, 21 Apr 2016 07:29:59 +0000 (07:29 +0000)]
Fix test command line to explicitly disable CDI instructions for one test.
llvm-svn: 266966
Mehdi Amini [Thu, 21 Apr 2016 06:43:45 +0000 (06:43 +0000)]
CachePruning: early exit if no path supplied
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266965