Eugene Zelenko [Mon, 24 Apr 2017 23:21:38 +0000 (23:21 +0000)]
[Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 301275
Hans Wennborg [Mon, 24 Apr 2017 23:16:49 +0000 (23:16 +0000)]
Revert r301089 "[builtins] Implement emulated TLS on Windows."
This broke the self-host build on Windows (PR32777).
Original commit message:
> [builtins] Implement emulated TLS on Windows.
>
> Summary:
> LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows.
>
> Reviewers: chh, howard.hinnant
>
> Reviewed By: chh
>
> Subscribers: mgorny, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D30787
llvm-svn: 301274
Sean Callanan [Mon, 24 Apr 2017 23:14:04 +0000 (23:14 +0000)]
[Expression parser] Return both types and variables
Many times a user wants to access a type when there's a variable of
the same name, or a variable when there's a type of the same name.
Depending on the precise context, currently the expression parser
can fail to resolve one or the other.
This is because ClangExpressionDeclMap has logic to limit the
amount of information it searches, and that logic sometimes cuts
down the search prematurely. This patch removes some of those early
exits.
In that sense, this patch trades performance (early exit is faster)
for correctness.
I've also included two new test cases showing examples of this
behavior – as well as modifying an existing test case that gets it
wrong.
llvm-svn: 301273
Reid Kleckner [Mon, 24 Apr 2017 23:13:47 +0000 (23:13 +0000)]
[asan] Fix Windows global dead stripping tests
Pass /Gw to clang-cl which is equivalent to -fdata-sections. This is now
necessary.
llvm-svn: 301272
Richard Smith [Mon, 24 Apr 2017 23:12:30 +0000 (23:12 +0000)]
[modules ts] Diagnose 'export' declarations outside of a module interface.
llvm-svn: 301271
Matt Arsenault [Mon, 24 Apr 2017 23:02:57 +0000 (23:02 +0000)]
InferAddressSpaces: Remove redundant assert
This is just asserting all the operations are handled in the
switch, which the unreachable already handles.
llvm-svn: 301270
Sanjay Patel [Mon, 24 Apr 2017 22:42:34 +0000 (22:42 +0000)]
[ARM, x86] add more vector tests for bool math; NFC
I'm proposing a fold for increment-of-sexted-bool in:
https://reviews.llvm.org/D31944
...so we need to know what happens in more cases like these.
llvm-svn: 301269
Reid Kleckner [Mon, 24 Apr 2017 22:26:46 +0000 (22:26 +0000)]
[git-llvm] Remove CR from middle of svn propget output
llvm-svn: 301268
Reid Kleckner [Mon, 24 Apr 2017 22:25:02 +0000 (22:25 +0000)]
Make getSlotAttributes return an AttributeSet instead of a wrapper list
Remove the temporary, poorly named getSlotSet method which did the same
thing. Also remove getSlotNode, which is a hold-over from when we were
dealing with AttributeSetNode* instead of AttributeSet.
llvm-svn: 301267
Siddharth Bhat [Mon, 24 Apr 2017 22:23:12 +0000 (22:23 +0000)]
[Polly] [DependenceInfo] change WAR generation, Read will not block Read
Earlier, the call to buildFlow was:
WAR = buildFlow(Write, Read, MustWrite, Schedule).
This meant that Read could block another Read, since must-sources can
block each other.
Fixed the call to buildFlow to correctly compute Read. The resulting
code needs to do some ISL juggling to get the output we want.
Bug report: https://bugs.llvm.org/show_bug.cgi?id=32623
Reviewers: Meinersbur
Tags: #polly
Differential Revision: https://reviews.llvm.org/D32011
llvm-svn: 301266
Rafael Espindola [Mon, 24 Apr 2017 22:20:22 +0000 (22:20 +0000)]
Mark a test as requiring a shell.
llvm-svn: 301265
Rui Ueyama [Mon, 24 Apr 2017 22:20:03 +0000 (22:20 +0000)]
Handle _LINK_ env string as command line parameters.
"_LINK_" environment varaible should be appended to the command line.
https://msdn.microsoft.com/en-us/library/6y6t9esh.aspx
Fixes https://bugs.llvm.org/show_bug.cgi?id=32756
llvm-svn: 301264
Sean Callanan [Mon, 24 Apr 2017 22:11:10 +0000 (22:11 +0000)]
[DWARF] Fix lookup in the abstract origins of inlined blocks/functions
LLDB uses clang::DeclContexts for lookups, and variables get put into
the DeclContext for their abstract origin. (The abstract origin is a
DWARF pointer that indicates the unique definition of inlined code.)
When the expression parser is looking for variables, it locates the
DeclContext for the current context. This needs to be done carefully,
though, e.g.:
__attribute__ ((always_inline)) void f(int a) {
{
int b = a * 2;
}
}
void g() {
f(3);
}
Here, if we're stopped in the inlined copy of f, we have to find the
DeclContext corresponding to the definition of f – its abstract
origin. Clang doesn't allow multiple functions with the same name and
arguments to exist. It also means that any variables we see must be
placed in the appropriate DeclContext.
[Bug 1]: When stopped in an inline block, the function
GetDeclContextDIEContainingDIE for that block doesn't properly
construct a DeclContext for the abstract origin for inlined
subroutines. That means we get duplicated function DeclContexts, but
function arguments only get put in the abstract origin's DeclContext,
and as a result when we try to look for them in nested contexts they
aren't found.
[Bug 2]: When stopped in an inline block, the DWARF (for space
reasons) doesn't explicitly point to the abstract origin for that
block. This means that the function GetClangDeclContextForDIE returns
a different DeclContext for each place the block is inlined. However,
any variables defined in the block have abstract origins, so they
will only get placed in the DeclContext for their abstract origin.
In this fix, I've introduced a test covering both of these issues,
and fixed them.
Bug 1 could be resolved simply by making sure we look up the abstract
origin for inlined functions when looking up their DeclContexts on
behalf of nested blocks.
For Bug 2, I've implemented an algorithm that makes the DeclContext
for a block be the containing DeclContext for the closest entity we
would find during lookup that has an abstract origin pointer. That
means that in the following situation:
{ // block 1
int a;
{ // block 2
int b;
}
}
if we looked up the DeclContext for block 2, we'd find the block
containing the abstract origin of b, and lookup would proceed
correctly because we'd see b and a. However, in the situation
{ // block 1
int a;
{ // block 2
}
}
since there isn't anything to look up in block 2, we can't determine
its abstract origin (and there is no such pointer in the DWARF for
blocks). However, we can walk up the parent chain and find a, and its
abstract origin lives in the abstract origin of block 1. So we simply
say that the DeclContext for block 2 is the same as the DeclContext
for block 1, which contains a. Lookups will return the same results.
Thanks to Jim Ingham for review and suggestions.
Differential revision: https://reviews.llvm.org/D32375
llvm-svn: 301263
Reid Kleckner [Mon, 24 Apr 2017 22:09:08 +0000 (22:09 +0000)]
[git-llvm] Make `push` work on CRLF files with svn:eol-style=native
Summary:
`git apply` on Windows doesn't work for files that SVN checks out as
CRLF. There is no way to force SVN to check everything out with Unix
line endings on Windows. Files with svn:eol-style=native will always
come out with CRLF, breaking `git apply`, which wants Unix line endings.
My workaround is to list all files with this property set in the change,
and run `dos2unix` on them. SVN doesn't commit a massive line ending
change because the svn:eol-style property indicates that these are text
files.
Tested on r301245.
Reviewers: zturner, jlebar
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32452
llvm-svn: 301262
Bruno Cardoso Lopes [Mon, 24 Apr 2017 21:58:13 +0000 (21:58 +0000)]
[Modules] Fix test to wipe out the cache before using it
This should appease bots:
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_check/35914
rdar://problem/
31796737
llvm-svn: 301261
Sanjay Patel [Mon, 24 Apr 2017 21:52:39 +0000 (21:52 +0000)]
[InstSimplify] use ConstantRange to simplify more and-of-icmps
We can simplify (and (icmp X, C1), (icmp X, C2)) to one of the icmps in many cases.
I had to check some of these with Alive to prove to myself it's right, but everything
seems to check out. Eg, the code in instcombine was completely ignoring predicates with
mismatched signedness.
Handling or-of-icmps would be a follow-up step.
Differential Revision: https://reviews.llvm.org/D32143
llvm-svn: 301260
Rafael Espindola [Mon, 24 Apr 2017 21:44:20 +0000 (21:44 +0000)]
Remove DefaultSoName.
We can just use the existing SoName member variable. It now initially
contains what was in DefaultSoName and is modified if the .so has an
actual soname.
llvm-svn: 301259
Simon Pilgrim [Mon, 24 Apr 2017 21:43:21 +0000 (21:43 +0000)]
[DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI.
llvm-svn: 301258
Evgeniy Stepanov [Mon, 24 Apr 2017 21:27:47 +0000 (21:27 +0000)]
[cfi] Fix wrong CMake condition for WIN32.
llvm-svn: 301257
Evgeniy Stepanov [Mon, 24 Apr 2017 21:27:45 +0000 (21:27 +0000)]
[asan] Remove asanwrapper from Android test harness.
It is only necessary for pre-L and creates problems on newer builds.
llvm-svn: 301256
Matt Arsenault [Mon, 24 Apr 2017 21:08:32 +0000 (21:08 +0000)]
AMDGPU: Slightly simplify prolog reserved register handling
Rely on MachineRegisterInfo's knowledge of used physical
registers.
Move flat_scratch initialization earlier, so the uses are visible
when making these decisions.
This will make it easier to add another reserved register
at the end for the stack pointer rather than handling another
special case.
llvm-svn: 301254
Galina Kistanova [Mon, 24 Apr 2017 21:06:29 +0000 (21:06 +0000)]
Cosmetic change.
llvm-svn: 301253
Saleem Abdulrasool [Mon, 24 Apr 2017 21:05:05 +0000 (21:05 +0000)]
ProfileData: clean up some stale declarations (NFC)
These were removed in SVN r300381. Remove the declarations.
llvm-svn: 301252
Artem Dergachev [Mon, 24 Apr 2017 20:55:07 +0000 (20:55 +0000)]
[analyzer] Improve subscripting null arrays for catching null dereferences.
Array-to-pointer cast now works correctly when the pointer to the array
is concrete, eg. null, which allows further symbolic calculations involving
such values.
Inlined defensive checks are now detected correctly when the resulting null
symbol is being array-subscripted before dereference.
Differential Revision: https://reviews.llvm.org/D32291
llvm-svn: 301251
Vedant Kumar [Mon, 24 Apr 2017 20:54:36 +0000 (20:54 +0000)]
Remove a dead field. NFC.
Suggested by Adam Folwarczny!
llvm-svn: 301250
Vedant Kumar [Mon, 24 Apr 2017 20:52:04 +0000 (20:52 +0000)]
[Coverage] Avoid null deref in skipRegionMappingForDecl (fixes PR32761)
Patch by Adam Folwarczny!
Differential Revision: https://reviews.llvm.org/D32406
llvm-svn: 301249
Galina Kistanova [Mon, 24 Apr 2017 20:48:40 +0000 (20:48 +0000)]
Small addition on how to add a builder.
llvm-svn: 301248
Artem Tamazov [Mon, 24 Apr 2017 20:42:27 +0000 (20:42 +0000)]
[AMDGPU][mc][tests][NFC] Bulk ISA tests: update for Gfx7/Gfx8, add for Gfx9.
llvm-svn: 301247
George Karpenkov [Mon, 24 Apr 2017 20:38:56 +0000 (20:38 +0000)]
Specify a target explicitly in libfuzzer driver flag test
llvm-svn: 301246
Reid Kleckner [Mon, 24 Apr 2017 20:38:30 +0000 (20:38 +0000)]
[Bitcode] Refactor attribute group writing to avoid getSlotAttributes
Summary:
That API creates a temporary AttributeList to carry an index and a
single AttributeSet. We need to carry the index in addition to the set,
because that is how attribute groups are currently encoded.
NFC
Reviewers: pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32262
llvm-svn: 301245
Teresa Johnson [Mon, 24 Apr 2017 20:30:42 +0000 (20:30 +0000)]
Update profile during memory instrinsic optimization
Summary:
Ensure that the new merge BB (which contains the rest of the original BB
after the mem op being optimized) gets a profile frequency, in case
there are additional mem ops later in the BB. Otherwise they get skipped
as the merge BB looks cold.
Reviewers: davidxl, xur
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32447
llvm-svn: 301244
Evgeniy Stepanov [Mon, 24 Apr 2017 20:25:39 +0000 (20:25 +0000)]
[asan] Use posix strerror_r interceptor on android.
This fixes a regression in r297315.
llvm-svn: 301243
Matt Arsenault [Mon, 24 Apr 2017 20:25:01 +0000 (20:25 +0000)]
Revert "StructurizeCFG: Directly invert cmp instructions"
This reverts commit r300732. This breaks a few tests.
I think the problem is related to adding more uses of
the condition that don't yet exist at this point.
llvm-svn: 301242
Davide Italiano [Mon, 24 Apr 2017 20:17:38 +0000 (20:17 +0000)]
[LoopUnroll] Remove spurious newline.
Eli pointed out in the review, but I didn't squash the two commits
correctly. Pointy-hat to me.
llvm-svn: 301241
Frederich Munch [Mon, 24 Apr 2017 20:16:01 +0000 (20:16 +0000)]
Revert "Refactor DynamicLibrary so searching for a symbol will have a defined order"
The i686-mingw32-RA-on-linux bot is still having errors.
This reverts commit r301236.
llvm-svn: 301240
Davide Italiano [Mon, 24 Apr 2017 20:14:11 +0000 (20:14 +0000)]
[LoopUnroll] Don't try to unroll non canonical loops.
The current Loop Unroll implementation works with loops having a
single latch that contains a conditional branch to a block outside
the loop (the other successor is, by defition of latch, the header).
If this precondition doesn't hold, avoid unrolling the loop as
the code is not ready to handle such circumstances.
Differential Revision: https://reviews.llvm.org/D32261
llvm-svn: 301239
Sanjoy Das [Mon, 24 Apr 2017 20:12:10 +0000 (20:12 +0000)]
[LIR] Obey non-integral pointer semantics
Summary: See http://llvm.org/docs/LangRef.html#non-integral-pointer-type
Reviewers: haicheng
Reviewed By: haicheng
Subscribers: mcrosier, mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D32196
llvm-svn: 301238
Saleem Abdulrasool [Mon, 24 Apr 2017 20:01:03 +0000 (20:01 +0000)]
Avoid unnecessary copies in some for loops
Use constant references rather than `const auto` which will cause the
copy constructor. These particular cases cause issues for the swift
compiler.
llvm-svn: 301237
Frederich Munch [Mon, 24 Apr 2017 19:55:16 +0000 (19:55 +0000)]
Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called.
Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:
JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -> NULL // called ucrt.dll, getenv
Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.
Reviewers: chapuni, v.g.vassilev, lhames
Reviewed By: lhames
Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits
Differential Revision: https://reviews.llvm.org/D30107
llvm-svn: 301236
Evgeniy Stepanov [Mon, 24 Apr 2017 19:52:51 +0000 (19:52 +0000)]
[cfi] Disable ThinLTO + CFI tests on Windows.
PR32770.
llvm-svn: 301235
Krzysztof Parzyszek [Mon, 24 Apr 2017 19:51:12 +0000 (19:51 +0000)]
Move value type list from TargetRegisterClass to TargetRegisterInfo
Differential Revision: https://reviews.llvm.org/D31937
llvm-svn: 301234
Carlo Bertolli [Mon, 24 Apr 2017 19:50:35 +0000 (19:50 +0000)]
Revert r301223
llvm-svn: 301233
Krzysztof Parzyszek [Mon, 24 Apr 2017 19:48:51 +0000 (19:48 +0000)]
Revert r301231: Accidentally committed stale files
I forgot to commit local changes before commit.
llvm-svn: 301232
Krzysztof Parzyszek [Mon, 24 Apr 2017 19:43:45 +0000 (19:43 +0000)]
Move value type list from TargetRegisterClass to TargetRegisterInfo
Differential Revision: https://reviews.llvm.org/D31937
llvm-svn: 301231
Matt Arsenault [Mon, 24 Apr 2017 19:40:59 +0000 (19:40 +0000)]
AMDGPU: Select scratch mubuf offsets when pointer is a constant
In call sequence setups, there may not be a frame index base
and the pointer is a constant offset from the frame
pointer / scratch wave offset register.
llvm-svn: 301230
Matt Arsenault [Mon, 24 Apr 2017 19:40:51 +0000 (19:40 +0000)]
AMDGPU: Set StackGrowsUp in MCAsmInfo
Not sure what this does though.
llvm-svn: 301229
Stanislav Mekhanoshin [Mon, 24 Apr 2017 19:37:54 +0000 (19:37 +0000)]
[AMDGPU] Merge M0 initializations
Merges equivalent initializations of M0 and hoists them into a common
dominator block. Technically the same code can be used with any
register, physical or virtual.
Differential Revision: https://reviews.llvm.org/D32279
llvm-svn: 301228
Piotr Padlewski [Mon, 24 Apr 2017 19:37:17 +0000 (19:37 +0000)]
Handle invariant.group.barrier in BasicAA
Summary:
llvm.invariant.group.barrier returns pointer that mustalias
pointer it takes. It can't be marked with `returned` attribute,
because it would be remove easily. The other reason is that
only Alias Analysis can know about this, because if any other
pass would know it, then the result would be replaced with it's
argument, which would be invalid.
We can think about returned pointer as something that mustalias, but
it doesn't have to be bitwise the same as the argument.
Reviewers: dberlin, chandlerc, hfinkel, sanjoy
Subscribers: reames, nlewycky, rsmith, anna, amharc
Differential Revision: https://reviews.llvm.org/D31585
llvm-svn: 301227
Evgeniy Stepanov [Mon, 24 Apr 2017 19:34:13 +0000 (19:34 +0000)]
[asan] Let the frontend disable gc-sections optimization for asan globals.
Also extend -asan-globals-live-support flag to all binary formats.
llvm-svn: 301226
Evgeniy Stepanov [Mon, 24 Apr 2017 19:34:12 +0000 (19:34 +0000)]
[asan] Disable ASan global-GC depending on the target and compiler flags.
llvm-svn: 301225
Artem Dergachev [Mon, 24 Apr 2017 19:30:33 +0000 (19:30 +0000)]
[analyzer] Improve suppression for inlined defensive checks before operator &.
Null dereferences are suppressed if the lvalue was constrained to 0 for the
first time inside a sub-function that was inlined during analysis, because
such constraint is a valid defensive check that does not, by itself,
indicate that null pointer case is anyhow special for the caller.
If further operations on the lvalue are performed, the symbolic lvalue is
collapsed to concrete null pointer, and we need to track where does the null
pointer come from.
Improve such tracking for lvalue operations involving operator &.
rdar://problem/
27876009
Differential Revision: https://reviews.llvm.org/D31982
llvm-svn: 301224
Carlo Bertolli [Mon, 24 Apr 2017 19:26:11 +0000 (19:26 +0000)]
[OpenMP] Initial implementation of code generation for pragma 'distribute parallel for' on host
https://reviews.llvm.org/D29508
This patch makes the following additions:
1. It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation.
2. It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses.
It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code.
Looking forward to comments.
llvm-svn: 301223
Mandeep Singh Grang [Mon, 24 Apr 2017 19:20:45 +0000 (19:20 +0000)]
[SimplifyCFG] Fix for non-determinism in codegen
Summary: This patch fixes issues in codegen uncovered due to https://reviews.llvm.org/D26718
Reviewers: majnemer, chenli, davide
Reviewed By: davide
Subscribers: davide, arsenm, llvm-commits
Differential Revision: https://reviews.llvm.org/D26726
llvm-svn: 301222
Krzysztof Parzyszek [Mon, 24 Apr 2017 18:55:33 +0000 (18:55 +0000)]
Move size and alignment information of regclass to TargetRegisterInfo
1. RegisterClass::getSize() is split into two functions:
- TargetRegisterInfo::getRegSizeInBits(const TargetRegisterClass &RC) const;
- TargetRegisterInfo::getSpillSize(const TargetRegisterClass &RC) const;
2. RegisterClass::getAlignment() is replaced by:
- TargetRegisterInfo::getSpillAlignment(const TargetRegisterClass &RC) const;
This will allow making those values depend on subtarget features in the
future.
Differential Revision: https://reviews.llvm.org/D31783
llvm-svn: 301221
Dimitry Andric [Mon, 24 Apr 2017 18:54:48 +0000 (18:54 +0000)]
Don't test setting sticky bits on files for modern BSDs
Summary: In rL297945, jhenderson added methods for setting permissions
to sys::fs, but some of the unittests that attempt to set sticky bits
(01000) on files fail on modern BSDs, such as FreeBSD, NetBSD and
OpenBSD. This is because those systems do not allow regular users to
set sticky bits on files, only on directories. Fix it by disabling
these particular tests on modern BSDs.
Reviewers: emaste, brad, jhenderson
Reviewed By: jhenderson
Subscribers: joerg, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D32120
llvm-svn: 301220
Adrian Prantl [Mon, 24 Apr 2017 18:45:59 +0000 (18:45 +0000)]
Don't emit CFI instructions at the end of a function
When functions are terminated by unreachable instructions, the last
instruction might trigger a CFI instruction to be generated. However,
emitting it would be be illegal since the function (and thus the FDE
the CFI is in) has already ended with the previous instruction.
Darwin's dwarfdump --verify --eh-frame complains about this and the
specification supports this.
Relevant bits from the DWARF 5 standard (6.4 Call Frame Information):
"[The] address_range [field in an FDE]: The number of bytes of
program instructions described by this entry."
"Row creation instructions: [...]
The new location value is always greater than the current one."
The first quotation implies that a CFI cannot describe a target
address outside of the enclosing FDE's range.
rdar://problem/
26244988
Differential Revision: https://reviews.llvm.org/D32246
llvm-svn: 301219
Matthias Braun [Mon, 24 Apr 2017 18:41:00 +0000 (18:41 +0000)]
Pragma: Fix DebugOverflowStack() resulting in endless loop.
Drive-by fix (noticed while working on https://reviews.llvm.org/D32205):
DebugOverflowStack() is supposed to provoke a stack overflow, however
LLVM was smart enough to use the red-zone and fold the load into a tail
jump on x86_64 optimizing this to an endless loop instead of a stack
overflow.
llvm-svn: 301218
George Karpenkov [Mon, 24 Apr 2017 18:39:52 +0000 (18:39 +0000)]
Updates documentation for a syntax sugar libfuzzer flag,
as implemented in https://reviews.llvm.org/D32193
llvm-svn: 301217
George Karpenkov [Mon, 24 Apr 2017 18:36:31 +0000 (18:36 +0000)]
Remove erroneous driver test for -fsanitize=fuzzer flag
libfuzzer is not available on all platforms, and hence we can not always
rely that it was compiled.
llvm-svn: 301216
Yaxun Liu [Mon, 24 Apr 2017 18:26:27 +0000 (18:26 +0000)]
CodeGen: Add a hook for getFenceOperandTy
Currently the operand type for ATOMIC_FENCE assumes value type of a pointer in address space 0.
This is fine for most targets. However for amdgcn target, the size of pointer in address space 0
depends on triple environment. For amdgiz environment, it is 64 bit but for other environment it is
32 bit. On the other hand, amdgcn target expects 32 bit fence operands independent of the target
triple environment. Therefore a hook is need in target lowering for getting the fence operand type.
This patch has no effect on targets other than amdgcn.
Differential Revision: https://reviews.llvm.org/D32186
llvm-svn: 301215
Evgeniy Stepanov [Mon, 24 Apr 2017 18:25:07 +0000 (18:25 +0000)]
Revert "Compute safety information in a much finer granularity."
Use-after-free in llvm::isGuaranteedToExecute.
llvm-svn: 301214
Sanjay Patel [Mon, 24 Apr 2017 18:24:36 +0000 (18:24 +0000)]
[InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombine
This is a straight cut and paste, but there's a bigger problem: if this
fold exists for simplifyOr, there should be a DeMorganized version for
simplifyAnd. But more than that, we have a patchwork of ad hoc logic
optimizations in InstCombine. There should be some structure to ensure
that we're not missing sibling folds across and/or/xor.
llvm-svn: 301213
George Karpenkov [Mon, 24 Apr 2017 18:23:24 +0000 (18:23 +0000)]
Flag -fsanitize=fuzzer to enable libfuzzer
Previously, adding libfuzzer to a project was a multi-step procedure,
involving libfuzzer compilation, linking the library, and specifying
coverage flags.
With this change,libfuzzer can be enabled by adding a single
-fsanitize=fuzzer flag instead.
llvm-svn: 301212
Matthias Braun [Mon, 24 Apr 2017 18:15:00 +0000 (18:15 +0000)]
X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC
Re-Commit of r300922 and r300923 with less aggressive assert (see
discussion at the end of https://reviews.llvm.org/D32205)
X86RegisterInfo::eliminateFrameIndex() and
X86FrameLowering::getFrameIndexReference() both had logic to compute the
base register. This consolidates the code.
Also use MachineInstr::isReturn instead of manually enumerating tail
call instructions (return instructions were not included in the previous
list because they never reference frame indexes).
Differential Revision: https://reviews.llvm.org/D32206
llvm-svn: 301211
Adrian Prantl [Mon, 24 Apr 2017 18:11:42 +0000 (18:11 +0000)]
Use DW_OP_stack_value when reconstructing variable values with arithmetic.
When the location description of a source variable involves arithmetic
on the value itself, it needs to be marked with DW_OP_stack_value since it
is not describing the variable's location, but rather its value.
This is a follow-up to r297971 and fixes the source testcase quoted in
the comment in debuginfo-dce.ll.
rdar://problem/
30725338
This reapplies r301093 without modifications.
llvm-svn: 301210
Adrian Prantl [Mon, 24 Apr 2017 18:11:38 +0000 (18:11 +0000)]
Add a testcase for DIExpression(DW_OP_stack_value)
and relax the assertion that prohibited its emission.
This fixes the assertion failure uncovered by r301093.
llvm-svn: 301209
Matt Arsenault [Mon, 24 Apr 2017 18:05:16 +0000 (18:05 +0000)]
AMDGPU: Add StackPtr and FramePtr registers to MFI
These will be necessary for setting up call sequences.
llvm-svn: 301208
Shoaib Meenai [Mon, 24 Apr 2017 18:02:11 +0000 (18:02 +0000)]
[ELF] Account for R_386_TLS_LDO_32 addend
This relocation type has an implicit addend. Account for it when
processing the relocation. Add an offset to an existing test to ensure
it gets processed correctly.
Fixes PR32634.
Differential Revision: https://reviews.llvm.org/D32336
llvm-svn: 301207
Matt Arsenault [Mon, 24 Apr 2017 17:49:13 +0000 (17:49 +0000)]
AMDGPU: Move trap lowering to DAG
Fixes traps in any block besides the entry block,
and fixes depending on a live-in physical register
by using a virtual register copy.
Also happens to stop emitting a nop in the case
debug trap is not supported.
llvm-svn: 301206
Davide Italiano [Mon, 24 Apr 2017 17:48:44 +0000 (17:48 +0000)]
[DomPrinter] Add a way to programmatically dump a dot representation.
Differential Revision: https://reviews.llvm.org/D32145
llvm-svn: 301205
Zachary Turner [Mon, 24 Apr 2017 17:47:52 +0000 (17:47 +0000)]
[llvm-pdbdump] Merge functionality of graphical and text dumpers.
The *real* difference between these two was that
a) The "graphical" dumper could recurse, while the text one could
not.
b) The "text" dumper could display nested types and functions,
while the graphical one could not.
Merge these two so that there is only one dumper that can recurse
arbitrarily deep and optionally display nested types or not.
llvm-svn: 301204
Zachary Turner [Mon, 24 Apr 2017 17:47:24 +0000 (17:47 +0000)]
[llvm-pdbdump] Re-write the record layout code to be more resilient.
This reworks the way virtual bases are handled, and also the way
padding is detected across multiple levels of aggregates, producing
a much more accurate result.
llvm-svn: 301203
Craig Topper [Mon, 24 Apr 2017 17:39:35 +0000 (17:39 +0000)]
[Docs] Correct the path to the clang-format-diff.py script to include the clang-format directory.
llvm-svn: 301202
Craig Topper [Mon, 24 Apr 2017 17:37:10 +0000 (17:37 +0000)]
[APInt] Simplify the zext and sext methods
This replaces a hand written copy loop with a call to memcpy for both zext and sext.
For sext, it replaces multiple if/else blocks propagating sign information forward. Now we just do a copy, a sign extension on the last copied word, a memset, and clearUnusedBits.
Differential Revision: https://reviews.llvm.org/D32417
llvm-svn: 301201
George Karpenkov [Mon, 24 Apr 2017 17:28:32 +0000 (17:28 +0000)]
Testing commit credentials
llvm-svn: 301200
Matt Arsenault [Mon, 24 Apr 2017 17:24:37 +0000 (17:24 +0000)]
InstCombine: Fix assert when reassociating fsub with undef
There is logic to track the expected number of instructions
produced. It thought in this case an instruction would
be necessary to negate the result, but here it folded
into a ConstantExpr fneg when the non-undef value operand
was cancelled out by the second fsub.
I'm not sure why we don't fold constant FP ops with undef currently,
but I think that would also avoid this problem.
llvm-svn: 301199
Craig Topper [Mon, 24 Apr 2017 17:18:47 +0000 (17:18 +0000)]
[APInt] Add ashrInPlace method and rewrite ashr to make a copy and then call ashrInPlace.
This patch adds an in place version of ashr to match lshr and shl which were recently added.
I've tried to make this similar to the lshr code with additions to handle the sign extension. I've also tried to do this with less if checks than the current ashr code by sign extending the original result to a word boundary before doing any of the shifting. This removes a lot of the complexity of determining where to fill in sign bits after the shifting.
Differential Revision: https://reviews.llvm.org/D32415
llvm-svn: 301198
Nicolai Haehnle [Mon, 24 Apr 2017 17:17:36 +0000 (17:17 +0000)]
AMDGPU: Move v_readlane lane select from VGPR to SGPR
Summary:
Fix a compiler bug when the lane select happens to end up in a VGPR.
Clarify the semantic of the corresponding intrinsic to be that of
the corresponding GLSL: the lane select must be uniform across a
wave front, otherwise results are undefined.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D32343
llvm-svn: 301197
Xin Tong [Mon, 24 Apr 2017 17:12:22 +0000 (17:12 +0000)]
Compute safety information in a much finer granularity.
Summary:
Instead of keeping a variable indicating whether there are early exits
in the loop. We keep all the early exits. This improves LICM's ability to
move instructions out of the loop based on is-guaranteed-to-execute.
I am going to update compilation time as well soon.
Reviewers: hfinkel, sanjoy, efriedma, mkuper
Reviewed By: hfinkel
Subscribers: llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D32433
llvm-svn: 301196
Nicolai Haehnle [Mon, 24 Apr 2017 17:08:43 +0000 (17:08 +0000)]
InstCombine/AMDGPU: Fix constant folding of llvm.amdgcn.{icmp,fcmp}
Summary:
The return value of these intrinsics should always have 0 bits for
inactive threads. This means that when all arguments are constant
and the comparison evaluates to true, the intrinsic should return
the current exec mask.
Fixes some GL_ARB_shader_ballot tests.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D32344
llvm-svn: 301195
Igor Breger [Mon, 24 Apr 2017 17:05:52 +0000 (17:05 +0000)]
[GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.
Summary: [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.
Reviewers: zvi, t.p.northover, guyblank
Reviewed By: t.p.northover
Subscribers: dberris, rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D32288
llvm-svn: 301194
Simon Pilgrim [Mon, 24 Apr 2017 17:05:14 +0000 (17:05 +0000)]
[DAGCombiner] Updated bswap byte offset variable names to be more descriptive. NFC
As discussed on D32039, use MaskByteOffset to describe the variable and also pull out repeated getOpcode() calls.
llvm-svn: 301193
Craig Topper [Mon, 24 Apr 2017 17:00:22 +0000 (17:00 +0000)]
[APInt] Fix repeated word in comments. NFC
llvm-svn: 301192
Nicolai Haehnle [Mon, 24 Apr 2017 16:53:52 +0000 (16:53 +0000)]
AMDGPU: Fix crash when scheduling non-memory SMRD instructions
Summary: Fixes piglit spec/arb_shader_clock/execution/*
Reviewers: arsenm
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D32345
llvm-svn: 301191
Kuba Mracek [Mon, 24 Apr 2017 16:48:30 +0000 (16:48 +0000)]
[tsan] Include __tsan_external_* API from a header file instead of declaring them manually. NFC.
Differential Revision: https://reviews.llvm.org/D32384
llvm-svn: 301190
Kuba Mracek [Mon, 24 Apr 2017 16:42:29 +0000 (16:42 +0000)]
[tsan] Remove the extra word "object" from description of external races
Differential Revision: https://reviews.llvm.org/D32383
llvm-svn: 301189
Haojian Wu [Mon, 24 Apr 2017 16:41:00 +0000 (16:41 +0000)]
[clang-tidy] Some Cleanups for performance-faster-string-find check.
NFC
llvm-svn: 301188
Nirav Dave [Mon, 24 Apr 2017 15:37:20 +0000 (15:37 +0000)]
[SDAG] Teach Chain Analysis about BaseIndexOffset addressing.
While we use BaseIndexOffset in FindBetterNeighborChains to
appropriately realize they're almost the same address and should be
improved concurrently we do not use it in isAlias using the non-index
understanding FindBaseOffset instead. Adding a BaseIndexOffset check
in isAlias like should allow indexed stores to be merged.
FindBaseOffset to be excised in subsequent patch.
Reviewers: jyknight, aditya_nandakumar, bogner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31987
llvm-svn: 301187
Pavel Labath [Mon, 24 Apr 2017 15:23:21 +0000 (15:23 +0000)]
Update two android XFAILS
- XFAIL on TestNoreturnUnwind on all architectures
- TestStaticVariables fails with clang-3.8 as well
llvm-svn: 301186
Aaron Ballman [Mon, 24 Apr 2017 14:57:09 +0000 (14:57 +0000)]
Extend readability-container-size-empty to add comparisons to empty-state objects.
Patch by Josh Zimmerman.
llvm-svn: 301185
Kostya Kortchinsky [Mon, 24 Apr 2017 14:53:38 +0000 (14:53 +0000)]
[sanitizer] Cache SizeClassForTransferBatch in the 32-bit local cache
Summary:
`SizeClassForTransferBatch` is expensive and is called for every `CreateBatch`
and `DestroyBatch`. Caching it means `kNumClasses` calls in `InitCache`
instead. This should be a performance gain if more than `kNumClasses / 2`
batches are created and destroyed during the lifetime of the local cache.
I have chosen to fully remove the function and putting the code in `InitCache`,
which is a debatable choice.
In single threaded benchmarks leveraging primary backed allocations, this turns
out to be a sizeable gain in performances (greater than 5%). In multithreaded
benchmarks leveraging everything, it is less significant but still an
improvement (about 1%).
Reviewers: kcc, dvyukov, alekseyshl
Reviewed By: dvyukov
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D32365
llvm-svn: 301184
Argyrios Kyrtzidis [Mon, 24 Apr 2017 14:52:00 +0000 (14:52 +0000)]
[index] If the 'external_source_symbol' attribute indicates 'Swift' as the language then report it accordingly
llvm-svn: 301183
Daniel Jasper [Mon, 24 Apr 2017 14:28:49 +0000 (14:28 +0000)]
clang-format: Fix bad corner case in formatting of function types.
Before:
std::function<
LoooooooooooongTemplatedType<SomeType>*(
LooooooooooooooooooooongType
type)>
function;
After:
std::function<
LoooooooooooongTemplatedType<
SomeType>*(
LooooooooooooooooongType type)>
function;
clang-format generally avoids having lines like "SomeType>*(" as they
lead to parameter lists that don't belong together to be aligned. However, in
case it is better than the alternative, which can even be violating the column
limit.
llvm-svn: 301182
Simon Pilgrim [Mon, 24 Apr 2017 14:26:30 +0000 (14:26 +0000)]
[X86][AVX] Add scheduling latency/throughput tests for missing AVX1 instructions
Had to split btver2/znver1 checks as only btver2 suppresses zeroupper
llvm-svn: 301181
Alex Lorenz [Mon, 24 Apr 2017 14:04:58 +0000 (14:04 +0000)]
[index] The relation between the declarations in template specializations
that 'override' declarations in the base template should be recorded
This can be used for improved "go to definition" feature in Xcode.
rdar://
31604739
Differential Revision: https://reviews.llvm.org/D32020
llvm-svn: 301180
Pavel Labath [Mon, 24 Apr 2017 13:34:35 +0000 (13:34 +0000)]
Fix the new SocketAddressTest on Windows
we need to call WSAStartup before we can use getaddrinfo.
llvm-svn: 301179
Piotr Padlewski [Mon, 24 Apr 2017 12:58:43 +0000 (12:58 +0000)]
[Devirtualization] Emit invariant.group loads with empty group md
Summary:
As discussed here
http://lists.llvm.org/pipermail/llvm-dev/2017-January/109332.html
having different groups doesn't solve the problem entirly.
Reviewers: rjmccall, rsmith
Subscribers: amharc, cfe-commits
Differential Revision: https://reviews.llvm.org/D32110
llvm-svn: 301178
Jonas Paulsson [Mon, 24 Apr 2017 12:40:28 +0000 (12:40 +0000)]
[SystemZ] Update kill-flag in splitMove().
EarlierMI needs to clear the kill flag on the first operand in case of a store.
Review: Ulrich Weigand
llvm-svn: 301177
Renato Golin [Mon, 24 Apr 2017 12:37:11 +0000 (12:37 +0000)]
[DWARF] Move test to x86 directory
llvm-svn: 301176
Philip Pfaffe [Mon, 24 Apr 2017 11:54:37 +0000 (11:54 +0000)]
[RegionInfo] Fix dangling references created by moving RegionInfo objects
Summary: Region objects capture the address of the creating RegionInfo instance. Because the RegionInfo class is movable, moving a RegionInfo object creates dangling references. This patch fixes these references by walking the Regions post-move, and updating references to the new parent.
Reviewers: Meinersbur, grosser
Reviewed By: Meinersbur, grosser
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31719
llvm-svn: 301175