Commit Graph

214968 Commits

Author SHA1 Message Date
Sanjoy Das 71fe81fd25 [FunctionAttrs] Add handling for operand bundles
Summary:
Teach the FunctionAttrs to do the right thing for IR with operand
bundles.

Reviewers: reames, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 252387
2015-11-07 01:56:00 +00:00
Sanjoy Das 436e2397f8 [FunctionAttrs] Fix an iterator wraparound bug
Summary:
This change fixes an iterator wraparound bug in
`determinePointerReadAttrs`.

Ideally, ++'ing off the `end()` of an iplist should result in a failed
assert, but currently iplist seems to silently wrap to the head of the
list on `end()++`.  This is why the bad behavior is difficult to
demonstrate.

Reviewers: chandlerc, reames

Subscribers: llvm-commits

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

llvm-svn: 252386
2015-11-07 01:55:53 +00:00
Evgeniy Stepanov 906c872db9 Cleanup: move visibility/linkage attributes to the first declaration.
This change moves visibility attributes from out-of-class method
definitions to in-class declaration. This is needed for a switch to
attribute((internal_linkage)) (see http://reviews.llvm.org/D13925)
which can only appear on the first declaration.

This change does not touch istream/ostream/streambuf. They are
handled separately in http://reviews.llvm.org/D14409.

llvm-svn: 252385
2015-11-07 01:22:13 +00:00
Zachary Turner 37a0fc483b Remove a debug print statement.
llvm-svn: 252384
2015-11-07 01:12:53 +00:00
Joseph Tremoulet f748c8937e [WinEH] Update exception pointer registers
Summary:
The CLR's personality routine passes these in rdx/edx, not rax/eax.

Make getExceptionPointerRegister a virtual method parameterized by
personality function to allow making this distinction.

Similarly make getExceptionSelectorRegister a virtual method parameterized
by personality function, for symmetry.


Reviewers: pgavlin, majnemer, rnk

Subscribers: jyknight, dsanders, llvm-commits

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

llvm-svn: 252383
2015-11-07 01:11:31 +00:00
Zachary Turner c22811bbcc Python 3 - Use __bool__() instead of __nonzero__() for truthiness.
Python has a complicated mechanism of checking an objects truthity.
This involves a number of steps, which end with calling two private
methods on an object (if they are implemented).  In Python 2 these
two methods are `__nonzero__` and `__len__`, and in Python 3 they
are `__bool__` and `__len__`.  Because we *also* define a __len__
method for certain iterable types, this was triggering a situation
in Python 3 where `__nonzero__` wasn't defined, so it was calling
`__len__`, which was returning 0 (for example an SBDebugger with
no targets), and as a result the truthosity was determined to be
False.

We fix this by correctly using ` __bool__` for Python 3, and leave
the behavior under Python 2 unchanged.

Note that this fix is only implemented in the SWIG generation
python script, and not the SWIG generation shell script.  Someone
more familiar than me with shell scripts will need to fix them
to support this for Python 3 if desired.

llvm-svn: 252382
2015-11-07 01:08:25 +00:00
Zachary Turner 8d13fab183 Python 3 - Don't use unbuffered I/O in text mode.
This is unsupported in Python 3.  This could also have been fixed
by using "wb" instead of "w", but it doesn't seem like writing the
session log absolutely *needs* to be unbuffered.

llvm-svn: 252381
2015-11-07 01:08:15 +00:00
Duncan P. N. Exon Smith 68fa1a2411 Reapply "ADT: Require explicit ilist iterator/pointer conversions"
This reverts commit r252373, reapplying r252372 now that I've updated
clang-tools-extra.  Original commit message follows.

ADT: Require explicit ilist iterator/pointer conversions

Disallow implicit conversions between ilist iterators and element
points.  Explicit conversions still work of course.

This is the first step toward removing the undefined behaviour in
`ilist` and `iplist`:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091115.html

The motivation for removing the implicit iterators is that I came across
real bugs (that were *really* getting lucky).  More details and some
brief discussion later in that thread:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091617.html

Note: if you have out-of-tree code, it should be fairly easy to revert
this patch downstream while you update your out-of-tree call sites.
Note that these conversions are occasionally latent bugs (that may
happen to "work" now, but only because of getting lucky with UB;
follow-ups will change your luck).  When they are valid, I suggest using
`->getIterator()` to go from pointer to iterator, and `&*` to go from
iterator to pointer.

llvm-svn: 252380
2015-11-07 00:59:29 +00:00
Duncan P. N. Exon Smith 5717ecba8e examples: Remove implicit ilist iterator conversions, NFC
llvm-svn: 252379
2015-11-07 00:55:46 +00:00
Duncan P. N. Exon Smith 33e43ca608 lldb/ADT: Remove implicit ilist iterator conversions, NFC
Remove implicit ilist iterator conversions before reapplying r252372
(which will disallow them).

llvm-svn: 252378
2015-11-07 00:54:13 +00:00
David Majnemer eafa28a0d9 [InstCombine] Teach FoldPHIArgZextsIntoPHI about EHPads
FoldPHIArgZextsIntoPHI cannot insert an instruction after the PHI if
there is an EHPad in the BB.  Doing so would result in an instruction
inserted after a terminator.

llvm-svn: 252377
2015-11-07 00:52:53 +00:00
Akira Hatanaka 48684b073e Use regex in test case.
This is a follow-up to r252369.

llvm-svn: 252376
2015-11-07 00:48:18 +00:00
Michael Kruse 0651480b97 Fix non-affine region dominance of implicitely stored values
After loop versioning, a dominance check of a non-affine subregion's
exit node causes the dominance check to always fail on any block in the
subregion if it shares the same exit block with the scop. The
subregion's exit block has become polly_merge_new_and_old, which also
receives the control flow of the generated code. This would cause that
any value for implicit stores is assumed to be not from the scop.

We check dominance with the generated exit node instead.

This fixes llvm.org/PR25438

llvm-svn: 252375
2015-11-07 00:36:50 +00:00
Eugene Zelenko 26f34fb6df Fix some Clang-tidy warnings and formatting in recently added code.
Fixed Clang-tidy warnings:

* modernize-use-override;
* modernize-use-nullptr;
* modernize-use-default;
* readability-simplify-boolean-expr.

llvm-svn: 252374
2015-11-07 00:28:50 +00:00
Duncan P. N. Exon Smith ba60247a11 Revert "ADT: Require explicit ilist iterator/pointer conversions"
This reverts commit r252372.  Apparently I missed clang-tools-extra.
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/2534/steps/build/logs/stdio

llvm-svn: 252373
2015-11-07 00:09:14 +00:00
Duncan P. N. Exon Smith 0ed037ba4c ADT: Require explicit ilist iterator/pointer conversions
Disallow implicit conversions between ilist iterators and element
points.  Explicit conversions still work of course.

This is the first step toward removing the undefined behaviour in
`ilist` and `iplist`:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091115.html

The motivation for removing the implicit iterators is that I came across
real bugs (that were *really* getting lucky).  More details and some
brief discussion later in that thread:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091617.html

Note: if you have out-of-tree code, it should be fairly easy to revert
this patch downstream while you update your out-of-tree call sites.
Note that these conversions are occasionally latent bugs (that may
happen to "work" now, but only because of getting lucky with UB;
follow-ups will change your luck).  When they are valid, I suggest using
`->getIterator()` to go from pointer to iterator, and `&*` to go from
iterator to pointer.

llvm-svn: 252372
2015-11-07 00:02:32 +00:00
Duncan P. N. Exon Smith 83c4b68720 ADT: Remove last implicit ilist iterator conversions, NFC
Some implicit ilist iterator conversions have crept back into Analysis,
Transforms, Hexagon, and llvm-stress.  This removes them.

I'll commit a patch immediately after this to disallow them (in a
separate patch so that it's easy to revert if necessary).

llvm-svn: 252371
2015-11-07 00:01:16 +00:00
David Majnemer 27f2447fb3 [InstCombine] Don't insert an instruction after a terminator
We tried to insert a cast of a phi in a block whose terminator is an
EHPad.  This is invalid.  Do not attempt the transform in these
circumstances.

llvm-svn: 252370
2015-11-06 23:59:23 +00:00
Akira Hatanaka c866762272 Add support for function attribute 'not_tail_called'.
This attribute is used to prevent tail-call optimizations to the marked
function. For example, in the following piece of code, foo1 will not be
tail-call optimized: 

int __attribute__((not_tail_called)) foo1(int);

int foo2(int a) {
  return foo1(a); // Tail-call optimization is not performed.
}

The attribute has effect only on statically bound calls. It has no
effect on indirect calls. Also, virtual functions and objective-c
methods cannot be marked as 'not_tail_called'.

rdar://problem/22667622

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

llvm-svn: 252369
2015-11-06 23:56:15 +00:00
Akira Hatanaka 5cfcce12eb Add 'notail' marker for call instructions.
This marker prevents optimization passes from adding 'tail' or
'musttail' markers to a call. Is is used to prevent tail call
optimization from being performed on the call.

rdar://problem/22667622

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

llvm-svn: 252368
2015-11-06 23:55:38 +00:00
Pawel Bylica 6e680b2be7 Revert r252366: [Support] Use GetTempDir to get the temporary dir path on Windows.
llvm-svn: 252367
2015-11-06 23:44:23 +00:00
Pawel Bylica b43221439c [Support] Use GetTempDir to get the temporary dir path on Windows.
Summary:
In general GetTempDir follows the same logic as the replaced code: checks env variables TMP, TEMP, USERPROFILE in order. However, it also perform other checks like making separators native (\), making the path absolute, etc.

This change fixes FileSystemTest.CreateDir unittest that had been failing when run from Unix-like shell on Windows (Unix-like path separator (/) used in env variables).

Reviewers: chapuni, rafael, aaron.ballman

Subscribers: rafael, llvm-commits

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

llvm-svn: 252366
2015-11-06 23:21:49 +00:00
Chris Bieneman 472d937db7 [CMake] Need to filter ${arch}/*.c builtins as well as ${arch}/*.S builtins.
This was broken in r248542 when I refactored this to support builtins where ${arch} didn't match the directory prefix (i.e. armv7s).

llvm-svn: 252365
2015-11-06 23:19:29 +00:00
Ahmed Bougacha cf49b523a0 [AArch64][FastISel] Don't even try to select vector icmps.
We used to try to constant-fold them to i32 immediates.
Given that fast-isel doesn't otherwise support vNi1, when selecting
the result users, we'd fallback to SDAG anyway.
However, if the users were in another block, we'd insert broken
cross-class copies (GPR32 to FPR64).

Give up, let SDAG agree with itself on a vNi1 legalization strategy.

llvm-svn: 252364
2015-11-06 23:16:53 +00:00
Ahmed Bougacha b49eb3ab4b [X86] Fold (trunc (i32 (zextload i16))) into vbroadcast.
When matching non-LSB-extracting truncating broadcasts, we now insert
the necessary SRL. If the scalar resulted from a load, the SRL will be
folded into it, creating a narrower, offset, load.

However, i16 loads aren't Desirable, so we get i16->i32 zextloads.
We already catch i16 aextloads; catch these as well.

llvm-svn: 252363
2015-11-06 23:16:48 +00:00
Ahmed Bougacha 05a0514b12 [X86] SRL non-LSB extracts when folding to truncating broadcasts.
Now that we recognize this, we can support it instead of bailing out.
That is, we can fold:
  (v8i16 (shufflevector
    (v8i16 (bitcast (v4i32 (build_vector X, Y, ...)))),
    <1,1,...,1>))
into:
  (v8i16 (vbroadcast (i16 (trunc (srl Y, 16)))))

llvm-svn: 252362
2015-11-06 23:16:43 +00:00
Ahmed Bougacha 68614a36d1 [X86] Don't fold non-LSB extracts into truncating broadcasts.
We used to incorrectly assume that the offset we're extracting from
was a multiple of the element size. So, we'd fold:
  (v8i16 (shufflevector
    (v8i16 (bitcast (v4i32 (build_vector X, Y, ...)))),
    <1,1,...,1>))
into:
  (v8i16 (vbroadcast (i16 (trunc Y))))
whereas we should have extracted the higher bits from X.

Instead, bail out if the assumption doesn't hold.

llvm-svn: 252361
2015-11-06 23:16:38 +00:00
Duncan P. N. Exon Smith b126f6b6c8 StaticAnalyzer: Remove implicit ilist iterator conversions, NFC
Remove implicit ilist iterator conversions from clangStaticAnalyzer.

llvm-svn: 252360
2015-11-06 23:04:58 +00:00
Alexey Samsonov edf18d20a0 [ASan] Add two new functions to DLL thunk.
llvm-svn: 252359
2015-11-06 23:04:00 +00:00
Duncan P. N. Exon Smith 9f5260ab13 CodeGen: Remove implicit ilist iterator conversions, NFC
Make ilist iterator conversions explicit in clangCodeGen.  Eventually
I'll remove them everywhere.

llvm-svn: 252358
2015-11-06 23:00:41 +00:00
Duncan P. N. Exon Smith b8f58b53dd polly/ADT: Remove implicit ilist iterator conversions, NFC
Remove all the implicit ilist iterator conversions from polly, in
preparation for making them illegal in ADT.  There was one oddity I came
across: at line 95 of lib/CodeGen/LoopGenerators.cpp, there was a
post-increment `Builder.GetInsertPoint()++`.

Since it was a no-op, I removed it, but I admit I wonder if it might be
a bug (both before and after this change)?  Perhaps it should be a
pre-increment?

llvm-svn: 252357
2015-11-06 22:56:54 +00:00
Jim Ingham 0fcdac363c Make the language specifier to "break set" actually filter the names by their language. So for
instance:

break set -l c++ -r Name

will only break on C++ symbols that match Name, not ObjC or plain C symbols.  This also works
for "break set -n" and there are SB API's to pass this as well.

llvm-svn: 252356
2015-11-06 22:48:59 +00:00
Jim Ingham 569aaf9e1a Another optimization to keep down gdb-remote traffic. If we have suspended a thread while
running, don't request the thread status when deciding why we stopped.

llvm-svn: 252355
2015-11-06 22:45:57 +00:00
Sean Callanan 3b0dfe5a89 Fixed another issue with wrong case in #import.
llvm-svn: 252354
2015-11-06 22:43:55 +00:00
Chaoren Lin c0a55539e0 Fix Linux tests after r252348.
llvm-svn: 252353
2015-11-06 22:30:30 +00:00
Rafael Espindola ea7a1e9092 Round up the memsize of PT_TLS.
This is cleaner than computing relocations as if we had done it.

While at it, keep a single Phdr variable instead of multiple fields of it.

llvm-svn: 252352
2015-11-06 22:14:44 +00:00
Sean Callanan 8121b3f684 Fixed a problem where a test case referred to a
wrongly-capitalized header.

llvm-svn: 252351
2015-11-06 22:05:47 +00:00
Evgeniy Stepanov 65da7bc392 Allow deque to handle incomplete types.
Allow deque and deque::iterator instantiation with incomplete element
type. This is an ABI breaking change, and it is only enabled if
LIBCXX_ABI_VERSION >= 2 or LIBCXX_ABI_UNSTABLE=ON.

llvm-svn: 252350
2015-11-06 22:02:29 +00:00
Tom Stellard 05691a678e DAGCombiner: Check shouldReduceLoadWidth before combining (and (load), x) -> extload
Reviewers: resistor, arsenm

Subscribers: llvm-commits

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

llvm-svn: 252349
2015-11-06 21:58:37 +00:00
Zachary Turner e73a0601bd Python 3 - Port use of string.maketrans and don't use sets.Set.
`sets.Set` has been deprecated in favor of `set` since 2.6, and
`string.maketrans` has to be special cased.  In Python 3 there
is `str.maketrans`, `bytes.maketrans`, and `bytearray.maketrans`
and you have to choose the correct one.  So we need to introduce
a runtime version check at this site.

llvm-svn: 252348
2015-11-06 21:37:33 +00:00
Zachary Turner 5821f79714 Python 3 - Use the exec function, not the exec statement.
exec statement is gone in Python 3, this version works in both.

llvm-svn: 252347
2015-11-06 21:37:21 +00:00
Zachary Turner 059e52c44c Python 3 - Fix some issues with class / instance variables in unittest2.
Explanation from a Python wizard (not me) about why this exhibited
different behavior under Python 2 and Python 3.

    `cmp` is a builtin_function_or_method in Python 2.7, which doesn't
    have a __get__ and doesn't qualify as a "descriptor".  Your lambda is a
    regular function which qualifies as a descriptor whose __get__ method
    returns a bound instance.

His suggested fix was to write

    sortTestMethodsUsing = staticmethod(cmp_)

However, I don't think `sortTestMethodsUsing` (or any of the other fields
of `TestLoader`) should be class attributes anyway.  They are all accessed
through self, so they should be instance attributes.  So the fix employed
here is to convert them to instance attributes.

Differential Revision: http://reviews.llvm.org/D14453
Reviewed By: Todd Fiala

llvm-svn: 252346
2015-11-06 21:37:07 +00:00
Dan Gohman 3cb66c85b9 [WebAssembly] Use more explicit types in testcases.
llvm-svn: 252345
2015-11-06 21:32:42 +00:00
Dan Gohman 8d456e4200 [WebAssembly] Add more explicit pushes to the tests.
llvm-svn: 252344
2015-11-06 21:26:50 +00:00
David Majnemer 7204cff0a1 [InstCombine] Don't RAUW tokens with undef
Let SimplifyCFG remove unreachable BBs which define token instructions.

llvm-svn: 252343
2015-11-06 21:26:32 +00:00
Davide Italiano d9f87b4642 [SimplifyLibCalls] Don't hardcode the function name.
llvm-svn: 252342
2015-11-06 21:05:07 +00:00
Quentin Colombet 9a8efc08d3 [ShrinkWrapping] Teach shrink-wrapping how to analyze RegMask.
Previously we were conservatively assuming that RegMask operands clobber
callee saved registers.

llvm-svn: 252341
2015-11-06 21:00:13 +00:00
Matthias Braun 9198c671e8 MachineScheduler: Add regpressure information to debug dump
llvm-svn: 252340
2015-11-06 20:59:02 +00:00
Tom Stellard 41b7e63040 AMDGPU/SI: Refactor VOP[12C] tablegen definitions
Summary:
Pass the VOPProfile object all the through to *_m multiclasses.  This will
allow us to do more simplifications in the future.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 252339
2015-11-06 20:56:18 +00:00
Jonathan Peyton 70bda912fb Fix for zero chunk size
Setting dynamic schedule with chunk size 0 via omp_set_schedule(dynamic,0)
and then using "schedule (runtime)" causes infinite loop because for the 
chunked dynamic schedule we didn't correct zero chunk to the default (1).

llvm-svn: 252338
2015-11-06 20:32:44 +00:00