Commit Graph

226755 Commits

Author SHA1 Message Date
Johannes Doerfert a07f0ac73f Factor out "adjustDomainDimensions" function [NFC]
llvm-svn: 265284
2016-04-04 07:50:40 +00:00
Elena Demikhovsky e99c561391 AVX-512: Truncating store for i1 vectors
Implemented truncstore for KNL and skylake-avx512.
Covered vectors from v2i1 to v64i1. We save the value in bits (not in bytes) - v32i1 is saved in 4 bytes.

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

llvm-svn: 265283
2016-04-04 07:17:47 +00:00
Duncan P. N. Exon Smith 8e65f8ddfd ValueMapper: Remove old FIXMEs; almost NFC
Remove a few old FIXMEs from the original commit of the Metadata/Value
split in r223802.  These are commented out assertions to the effect that
calls between mapValue and mapMetadata never return nullptr.

(The only behaviour change is that Mapper::mapSimpleMetadata memoizes
the nullptr return.)

When I originally rewrote the mapping code, I thought we could be
stricter in the new metadata hierarchy and never return nullptr when
RF_NullMapMissingGlobalValues was off.  It's still not entirely clear to
me why these assertions failed (a few months ago, I had a theory that I
forgot to write down, but that's helping no one).

Understood or not, I no longer see how these commented-out assertions
would be useful.  I'm relegating them to the annals of source control
before making significant changes to ValueMapper.cpp.

llvm-svn: 265282
2016-04-04 04:59:56 +00:00
Davide Italiano a017306063 [DebugInfo] Fix tests in Assembler/
Each DISubprogram with isDefinition : true must
belong to a compile unit.

llvm-svn: 265281
2016-04-04 02:11:34 +00:00
Johannes Doerfert d5edbd61a1 [FIX] Do not create a SCoP in the presence of infinite loops
If a loop has no exiting blocks the region covering we use during
  schedule genertion might not cover that loop properly. For now we bail
  out as we would not optimize these loops anyway.

llvm-svn: 265280
2016-04-03 23:09:06 +00:00
Duncan P. N. Exon Smith fef609f15e IR: Lazily create ReplaceableMetadataImpl on MDNode
RAUW support on MDNode usually requires an extra allocation for
ReplaceableMetadataImpl.  This is only strictly necessary if there are
tracking references to the MDNode.  Make the construction of
ReplaceableMetadataImpl lazy, so that we don't get allocations if we
don't need them.

Since MDNode::isResolved now checks MDNode::isTemporary and
MDNode::NumUnresolved instead of whether a ReplaceableMetadataImpl is
allocated, the internal changes are intrusive (at various internal
checkpoints, isResolved now has a different answer).

However, there should be no real functionality change here; just
slightly lazier allocation behaviour.  The external semantics should be
identical.

llvm-svn: 265279
2016-04-03 21:23:52 +00:00
Duncan P. N. Exon Smith bd088744be IR: Make MDNode::Context private, NFC
llvm-svn: 265278
2016-04-03 21:10:00 +00:00
Amaury Sechet 7c2883cf85 Various style fix in Core.h/Core.cpp . NFC
llvm-svn: 265277
2016-04-03 21:06:04 +00:00
Duncan P. N. Exon Smith 756e1c3db4 ValueMapper: Disallow metadata mapping recursion through mapValue
This adds an assertion to maintain the property from r265273.  When
Mapper::mapSimpleMetadata calls Mapper::mapValue, it should not find its
way back to mapMetadataImpl.  This guarantees that mapSimpleMetadata is
not involved in any recursion.

Since Mapper::mapValue calls out to arbitrary materializers, we need to
save a bit on the ValueMap to make this assertion effective.

There should be no functionality change here.  This co-recursion should
already have been impossible.

llvm-svn: 265276
2016-04-03 20:54:51 +00:00
Duncan P. N. Exon Smith a997856b3d Work around MSVC failure from r265273
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19726

llvm-svn: 265275
2016-04-03 20:42:21 +00:00
Simon Pilgrim 0edd3d771a [X86] Removed duplicate code.
llvm-svn: 265274
2016-04-03 20:40:35 +00:00
Duncan P. N. Exon Smith c6065e3a25 ValueMapper: Avoid recursion in mapSimplifiedMetadata, NFC
The main change is to delay materializing GlobalValue initializers from
Mapper::mapValue until Mapper::~Mapper.  This effectively removes all
recursion from mapSimplifiedMetadata, as promised in r265270.
mapSimplifiedMetadata calls mapValue for ConstantAsMetadata nodes to
find the mapped constant, and now it shouldn't be possible for mapValue
to indirectly re-invoke mapMetadata.  I'll add an assertion to that
effect in a follow-up (separated so that the assertion can easily be
reverted independently, if it comes to that).

This a step toward a broader goal: converting Mapper::mapMetadataImpl
from a recursive to an iterative algorithm.

When a BlockAddress points at a BasicBlock inside an unmaterialized
function body, we need to delay it until the function body is
materialized in Mapper::~Mapper.  This commit creates a temporary
BasicBlock and returns a new BlockAddress, then RAUWs the BasicBlock
once it is known.  This situation should be extremely rare since a
BlockAddress is usually used from within the function it's referencing
(and BlockAddress itself is rare).

There should be no observable functionality change.

llvm-svn: 265273
2016-04-03 20:17:45 +00:00
Tobias Grosser 151ae32dba Revert "[FIX] Do not create a SCoP in the presence of infinite loops"
This reverts commit r265260, as it caused the following 'make check-polly'
failures:

    Polly :: ScopDetect/index_from_unpredictable_loop.ll
    Polly :: ScopInfo/multiple_exiting_blocks.ll
    Polly :: ScopInfo/multiple_exiting_blocks_two_loop.ll
    Polly :: ScopInfo/schedule-const-post-dominator-walk-2.ll
    Polly :: ScopInfo/schedule-const-post-dominator-walk.ll
    Polly :: ScopInfo/switch-5.ll

llvm-svn: 265272
2016-04-03 19:36:52 +00:00
Peter Zotov 8efe38a1e2 [CodeGenPrepare] Fix r265264 (again).
Don't require TLI for SinkCmpExpression, like it wasn't before
r265264.

llvm-svn: 265271
2016-04-03 19:32:13 +00:00
Duncan P. N. Exon Smith ae8bd4bd11 ValueMapper: Split out mapSimpleMetadata, NFC
Split out a helper for mapping metadata without operands.  This is any
metadata that is not an MDNode, and any MDNode where the answer is known
without looking at operands.

Through some weird twists, this function is co-recursive:

    mapSimpleMetadata
    => MapValue
    => materializeInitFor
    => linkFunctionBody
    => RemapInstructions
    => MapMetadata
    => mapSimpleMetadata

I plan to break the recursion in a follow-up.

llvm-svn: 265270
2016-04-03 19:31:01 +00:00
Kuba Brecka d0e83a6eb2 [sanitizer] Make AtosSymbolizer more resilient when symbolicating a zero address
llvm-svn: 265269
2016-04-03 19:13:03 +00:00
Duncan P. N. Exon Smith 829dc87a68 ValueMapper: Introduce Mapper helper class, NFC
Remove a bunch of boilerplate from ValueMapper.cpp by using a new
file-local class called Mapper.

llvm-svn: 265268
2016-04-03 19:06:24 +00:00
Simon Pilgrim d74f6e22f2 [X86][SSE] Refreshed MOVMSK sign bit tests
llvm-svn: 265267
2016-04-03 18:59:42 +00:00
Simon Pilgrim cd0dfc93eb [X86][SSE] Support for MOVMSK signbit extraction instructions
Add support for lowering with the MOVMSK instruction to extract vector element signbits to a GPR.

This is an early step towards more optimal handling of vector comparison results.

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

llvm-svn: 265266
2016-04-03 18:22:03 +00:00
Peter Zotov f87e550e89 [CodeGenPrepare] Fix r265264.
The case where there was no TargetLowering was not handled,
leading to null pointer dereferences.

llvm-svn: 265265
2016-04-03 17:11:53 +00:00
Peter Zotov 0b6d7bc682 [CodeGenPrepare] Avoid sinking soft-FP comparisons
Sinking comparisons in CGP can undo the job of hoisting them done
earlier by LICM, and soft-FP makes this an expensive mistake.

A common pattern that produces floating point comparisons uniform
over a loop is an explicit check for division by zero. If the divisor
is hoisted out of the loop, the comparison can also be, but hoisting
the function that unwinds is never legal, since it may cause side
effects in the loop body prior to the unwinding to not be executed.

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

llvm-svn: 265264
2016-04-03 16:36:17 +00:00
Simon Pilgrim 20d1d4f045 [X86] Tidied up X86ISD instruction nodes. NFCI.
Tidied up comments, stripped trailing whitespace, split apart nodes that aren't related.

No change in ordering although there is definitely some scope for it.

llvm-svn: 265263
2016-04-03 14:14:32 +00:00
Peter Zotov 0218d0f383 Mark some FP intrinsics as safe to speculatively execute
Floating point intrinsics in LLVM are generally not speculatively
executed, since most of them are defined to behave the same as libm
functions, which set errno.

However, the only error that can happen  when executing ceil, floor,
nearbyint, rint and round libm functions per POSIX.1-2001 is -ERANGE,
and that requires the maximum value of the exponent to be smaller
than  the number of mantissa bits, which is not the case with any of
the floating point types supported by LLVM.

The trunc and copysign functions never set errno per per POSIX.1-2001.

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

llvm-svn: 265262
2016-04-03 12:30:46 +00:00
Johannes Doerfert 2075b5d2a1 [FIX] Do not create two SAI objects for exit PHIs
If an exit PHI is written and also read in the SCoP we should not create two
  SAI objects but only one. As the read is only modeled to ensure OpenMP code
  generation knows about it we can simply use the EXIT_PHI MemoryKind for both
  accesses.

llvm-svn: 265261
2016-04-03 11:16:00 +00:00
Johannes Doerfert 7dcceb82e9 [FIX] Do not create a SCoP in the presence of infinite loops
If a loop has no exiting blocks the region covering we use during
  schedule genertion might not cover that loop properly. For now we bail
  out as we would not optimize these loops anyway.

llvm-svn: 265260
2016-04-03 11:12:39 +00:00
Elena Demikhovsky 5e426f7356 AVX-512: Load and Extended Load for i1 vectors
Implemented load+{sign|zero}_extend for i1 vectors
Fixed failures in i1 vector load.
Covered loading of v2i1, v4i1, v8i1, v16i1, v32i1, v64i1 vectors for KNL and SKX.

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

llvm-svn: 265259
2016-04-03 08:41:12 +00:00
Davide Italiano 842fa53026 [LTO] Implement -disable-verify, which disables bitcode verification.
So, there are some cases when the IR Linker produces a broken
module (which doesn't pass the verifier) and we end up asserting
inside the verifier. I think it's always a bug producing a module
which does not pass the verifier but there are some cases in which
people can live with the broken module (e.g. if only DebugInfo
metadata are broken). The gold plugin has something similar.

This commit is motivated by a situation I found in the
wild. It seems that somebody else discovered it independently
and reported in PR24923.

llvm-svn: 265258
2016-04-03 03:39:09 +00:00
Akira Hatanaka 6bdfe01a20 Fix test case committed in r265197.
The test was failing on some release build because the basic block names
I was expecting weren't printed.

llvm-svn: 265257
2016-04-03 03:36:22 +00:00
Davide Italiano 88dbd3b1cf [LTO] Add a test to ensure we reject negative opt level.
We already got this right, but it never hurts adding another
test, in case we'll change the handling in the future, to ensure
we don't break it.

llvm-svn: 265256
2016-04-03 03:12:00 +00:00
Davide Italiano 8848d44e46 [LTO] Reject invalid optimization levels.
llvm-svn: 265255
2016-04-03 02:41:15 +00:00
Davide Italiano 887d76c392 [LTO] Fix -save-temps in case -o is not specified.
Currently we create a file called .lto.bc. In UNIX,
ls(1) by default doesn't show up files starting with
a dot, as they're (only by convention) hidden.
This makes the output of -save-temps a little bit
hard to find. Use "a.out.lto.bc" instead if the
output file is not specified.

While here, change an existing -save-temps test to
exercise this more interesting behaviour.

llvm-svn: 265254
2016-04-03 02:16:56 +00:00
Davide Italiano d4f5a059e0 [SimplifyLibCalls] Garbage collect dead code.
We already skip optimizations if the return value
of printf() is used, so CI->use_empty() is always
true.

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

llvm-svn: 265253
2016-04-03 01:46:52 +00:00
Vedant Kumar f27d227409 [c-index-test] Fix leak in print_completion_result, NFC
llvm-svn: 265252
2016-04-03 00:54:46 +00:00
Jacques Pienaar 796975d311 [lanai] Fix for LanaiDelaySlotFiller and LanaiMCInstLower.cpp
Summary:
* Fix to stop delay slot filler from inserting SP modifying instructions in the newly expanded call/return instructions.
* In LowerSymbol the outermost type was not LanaiMCExpr if there was a binary expression
* Remove printExpr in LanaiInstPrinter

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 265251
2016-04-03 00:49:27 +00:00
Davide Italiano c4965009bd [ELF] Prefer 'auto' over explicit type for consistency.
llvm-svn: 265250
2016-04-02 23:47:54 +00:00
Zoran Jovanovic 2b7cc5a4ae [mips][microMIPS] Revert commits r264245 and r264248.
Commit r264245 was the reason for failing tests in LLVM test suite.
Commit r264248 depends on the first one.

llvm-svn: 265249
2016-04-02 23:06:13 +00:00
Simon Pilgrim b2e837d875 [X86][SSE] Added 1024-bit vector comparison tests
More examples of PR22603, poor vector splitting for AVX512F targets as well as missing uses of PACKSS/MOVMSK

llvm-svn: 265248
2016-04-02 21:33:09 +00:00
Simon Pilgrim 8fd7d852d5 [X86][AVX512] Added AVX512 comparison tests
llvm-svn: 265247
2016-04-02 21:24:42 +00:00
Ed Schouten 988b827992 Provide support for Binutils' --no-dynamic-linker option.
GNU ld seems to write a PT_INTERP header into executables containing a
default (read: bogus) value if --dynamic-linker flag is not provided.
LLD is different in the sense that it omits it unless --dynamic-linker
is provided, which seems fair.

Binutils 2.26 added a new flag, --no-dynamic-linker, that can be used to
generate binaries without PT_INTERP. Let's go ahead and also add this
flag to LLD, so that we can invoke the linker in a portable way.

Reviewed by:	ruiu
Differential Revision:	http://reviews.llvm.org/D18723

llvm-svn: 265246
2016-04-02 20:58:02 +00:00
Rui Ueyama 12dff23951 Simplify. NFC.
llvm-svn: 265242
2016-04-02 19:36:36 +00:00
Rui Ueyama 24d0d2f917 Merge two `if`s.
llvm-svn: 265241
2016-04-02 19:31:01 +00:00
Saleem Abdulrasool 85b43639b1 AArch64: support .cpu directive
Add support for the AArch64 .cpu directive.  This is a slightly involved
directive since the parameter is actually a variable encoded string.  The
general structure is:

  <cpu>[[+-]<feature>]*

We now map some of the supported string names for features for internal
representation of feature flags.  If we encounter one which we do not support,
bail out as we cannot validate the assembly any longer.

Resolves PR27010.

llvm-svn: 265240
2016-04-02 19:29:52 +00:00
Rui Ueyama 8fe7ce5903 Variable names should start with uppercase letters.
llvm-svn: 265239
2016-04-02 19:15:26 +00:00
Nico Weber d8ff0eedbb clang-cl: Don't skip i_group flags other than -include when building pchs.
Before this change, e.g. -isystem flags in front of the /FI corresponding to the
pch file would be incorrectly ignored.

llvm-svn: 265238
2016-04-02 19:10:07 +00:00
Rui Ueyama 7e71c61a7a Rename a variable. NFC.
We had variables MB and Mb in this function. Rename of one them.

llvm-svn: 265237
2016-04-02 19:09:07 +00:00
Rui Ueyama d1aa97b5c2 Do not return early.
Early return in this context is a bit confusing, so avoid doing it.

llvm-svn: 265236
2016-04-02 18:52:23 +00:00
Rui Ueyama 1fc5d48877 Move code to initialize LLVM to one place.
llvm-svn: 265235
2016-04-02 18:18:44 +00:00
Rui Ueyama bfc1d9d976 Remove DefinedElf class.
DefinedElf was a superclass of DefinedRegular and SharedSymbol classes
and represented the notion of defined symbols created for ELF symbols.

It turned out that we didn't use that class often. We had only two
occurrences of dyn_cast'ing to DefinedElf, and both were easily
rewritten without it.

The class was also a bit confusing. The concept of "created for ELF
symbol" is orthogonal to defined/undefined types. However, we had
two distinct classes, DefinedElf and UndefinedElf.

This patch simply removes the class. Now the class hierarchy is one
level shallower.

llvm-svn: 265234
2016-04-02 18:06:18 +00:00
Duncan P. N. Exon Smith 6d72d166dc Linker: Split mapUnneededSubprograms into two; almost NFC
Split the loop through compile units in mapUnneededSubprograms in two.
First, visit imported entities to ensure that we've visited all need
subprograms.  Second, visit subprograms, and drop the ones we don't
need.

Hypothetically this protects against a subprogram from one compile unit
being referenced from an imported entity in a different compile unit.  I
don't think that's valid IR (a debug info expert could confirm), but I
think the refactor makes the code more clear.

llvm-svn: 265233
2016-04-02 17:54:01 +00:00
Duncan P. N. Exon Smith 751114b39d Remove redundant assertion after cast, NFC
llvm-svn: 265232
2016-04-02 17:41:52 +00:00