Commit Graph

257215 Commits

Author SHA1 Message Date
Vedant Kumar 2b9f48afdd [ubsan] Use the nicer nullability diagnostic handlers
This is a follow-up to r297700 (Add a nullability sanitizer).

It addresses some FIXME's re: using nullability-specific diagnostic
handlers from compiler-rt, now that the necessary handlers exist.

check-ubsan test updates to follow.

llvm-svn: 297750
2017-03-14 16:48:29 +00:00
Vedant Kumar c5d628400f [ubsan] Add nullability handlers to interface file
llvm-svn: 297749
2017-03-14 16:36:03 +00:00
Vedant Kumar f2d04e628d [ubsan] Add diagnostic handlers for nullability errors
Add 'nullability_arg' and 'nullability_return' diagnostic handlers, and
also add a TypeCheckKind for null assignments to _Nonnull. With this in
place, we can update clang to use the nicer handlers for nullability
diagnostics.

The alternative to this approach is to update the existing 'nonnull_arg'
and 'nonnull_return' handlers to accept a boolean parameter. However,
versioning the existing handlers would cause code size bloat, and the
complexity cost of introducing new handlers into the runtime is low.

I will add tests for this, and all of -fsanitize=nullability, into
check-ubsan once the clang side of the changes is in.

llvm-svn: 297748
2017-03-14 16:32:27 +00:00
Sanjay Patel 1c8c6a457d [InstCombine] consolidate rem tests and update checks; NFC
llvm-svn: 297747
2017-03-14 16:27:46 +00:00
Sanjay Patel 9deec85c34 [InstCombine] regenerate checks; NFC
llvm-svn: 297746
2017-03-14 16:16:40 +00:00
Krzysztof Parzyszek 9416abbc4a [Hexagon] Fix a condition in HexagonEarlyIfConv.cpp
This fixes llvm.org/PR32265.

llvm-svn: 297745
2017-03-14 15:21:33 +00:00
Saleem Abdulrasool 01cf8d3348 DarwinParser: include limits
In debug mode, we have assertions that the values do not exceed the
limits of the type holding them.  In order to account for the type being
derived from the AddressSpace and thus a typedef, we use
`std::numeric_limits`.  Include the appropriate header.

Thanks to Marshal Clow for pointing out the missing include!

llvm-svn: 297744
2017-03-14 15:17:55 +00:00
Pavel Labath bb114f84e7 Fix flakyness in TestCompletion
One of the file name templates was occasionally generating the name
"fooa***", which conflicted with the one of the tests expectation that
there is only one item beginning with "fooa".

There doesn't seem to be a good reason for using random file templates
here, so just switch to a fixed set of files to increase
reproducibility.

llvm-svn: 297743
2017-03-14 14:58:31 +00:00
Artyom Skrobov 2de256642b Fix typo in comment
llvm-svn: 297742
2017-03-14 14:13:19 +00:00
Simon Pilgrim 3a196cbc4f [X86] Add extra BITREVERSE tests
Test on 32-bit and 64-bit targets.

Add bitreverse tests for i64, i32 and i16

llvm-svn: 297741
2017-03-14 14:03:16 +00:00
Gil Rapaport 28d0f8ddf7 [LV] Refactor cross-iteration phi's back-patching; NFC
This patch refactors the PHisToFix loop as follows:

- The loop itself now resides in its own method.
- The new method iterates on scalar-loop's header; the PHIsToFix map formerly
  propagated as an output parameter and filled during phi widening is removed.
- The code handling reductions is moved into its own method, similar to the
  existing fixFirstOrderRecurrence().

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

llvm-svn: 297740
2017-03-14 13:50:47 +00:00
Oliver Stannard 6ee22c41f8 [ARM] Diagnose ARM MOVT without :lower16: or :upper16: expression
This instruction was missing from the list of opcodes that we check, so we were
hitting an llvm_unreachable in ARMMCCodeEmitter.cpp for the ARM MOVT
instruction, rather than the diagnostic that is emitted for the other MOVW/MOVT
instructions.

Differential revision: https://reviews.llvm.org/D30936

llvm-svn: 297739
2017-03-14 13:50:10 +00:00
Artyom Skrobov 283316b5c0 De-duplicate the two implementations of ARMBaseInstrInfo::isProfitableToIfCvt() [NFC]
Reviewers: congh, rengolin

Subscribers: aemerson, llvm-commits

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

llvm-svn: 297738
2017-03-14 13:38:45 +00:00
Ayal Zaks 928ec40584 [LV] Refactor Cost Model's selectVectorizationFactor(); NFC
Refactoring Cost Model's selectVectorizationFactor() so that it handles only the
selection of the best VF from a pre-computed range of candidate VF's, extracting
early-exit criteria and the computation of a MaxVF upper-bound to other methods,
all driven by a newly introduced LoopVectorizationPlanner.

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

llvm-svn: 297737
2017-03-14 13:07:04 +00:00
Simon Pilgrim e1a72a936f [X86][MMX] Update FIXME comment. NFCI.
llvm-svn: 297736
2017-03-14 12:13:41 +00:00
George Rimar a2a1ef1abc [ELF] - Move members of LinkerScript to LinkerScriptBase. NFC.
That moves all members that s possible to move for now (all which
does not depend on ELFT templating).

After that change LinkerScript contains only 8 methods in total,
and I believe it is possible to move them all after tweaking other
parts of linker. And we will be able to have single class for 
linkerscript at the end.

llvm-svn: 297735
2017-03-14 12:03:34 +00:00
George Rimar 23e6a02450 [ELF] - Remove unnecessary template #6. NFC.
llvm-svn: 297734
2017-03-14 11:31:28 +00:00
Daniel Berlin 43dab5a5fb Make PredIteratorCache size() logically const. Do not require copying predecessors to get size.
Summary:
Every single benchmark i can run, on large and small cfgs, fully
connected, etc, across 3 different platforms (x86, arm., and PPC) says
that the current pred iterator cache is a losing proposition.

I can't find a case where it's faster than just walking preds, and in some cases, it's 5-10% slower.

This is due to copying the preds.
It also degrades into copying the entire cfg.

The one operation that is occasionally faster is the cached size.
This makes that operation faster by not relying on having the copies available.

I'm not even sure that is faster enough to be worth it. I, again, have
trouble finding cases where this takes long enough in a pass to be
worth caching compared to a million other things they could cache or
improve.

My suggestion:
We next remove the get() interface.
We do stronger benchmarking of size().
We probably end up killing this entire cache.
/

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits, trentxintong

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

llvm-svn: 297733
2017-03-14 11:25:45 +00:00
George Rimar f7f0d08827 [ELF] - Remove unnecessary template #5. NFC.
llvm-svn: 297732
2017-03-14 11:23:33 +00:00
James Henderson b5ecceff0c Test commit.
llvm-svn: 297731
2017-03-14 10:51:14 +00:00
Krasimir Georgiev 18f4aedae8 Add more clang-format changes to the 5.0 release notes
llvm-svn: 297730
2017-03-14 10:34:39 +00:00
Benjamin Kramer babcbddae0 [CodeGen] Fix -Wreorder warning.
llvm-svn: 297729
2017-03-14 10:29:47 +00:00
Filipe Cabecinhas 51c5396de8 Some ASan bots (AArch64 at least) use SEGV for a unit test error instead of SIGBUS
llvm-svn: 297728
2017-03-14 10:26:37 +00:00
George Rimar d83ce1b49d [ELF] - Devirtualize LinkerScriptBase::getOutputSectionSize. NFC.
It does not use ELFT templates so can be non-virtual.

llvm-svn: 297727
2017-03-14 10:24:47 +00:00
Tobias Grosser 335b6bf208 Fix typos in ADCE comments
llvm-svn: 297726
2017-03-14 10:18:11 +00:00
George Rimar 851dc1e84d [ELF] - Devirtualize LinkerScriptBase::getOutputSection
It does not use ELFT templates so can be non-virtual.

llvm-svn: 297725
2017-03-14 10:15:53 +00:00
Oliver Stannard 062041113f [ValueTracking] Out of range shifts might be undef
If it is possible for the RHS of a shift operation to be greater than or equal
to the bit-width, then the result might be undef, and we can't report any known
bits.

In some cases, this was allowing a transformation in instcombine which widened
an undef value from i1 to i32, increasing the range of values that a function
could return.

Differential revision: https://reviews.llvm.org/D30781

llvm-svn: 297724
2017-03-14 10:13:17 +00:00
George Rimar d0bee506a0 [ELF] - Simplify LinkerScriptBase::getDot(). NFC.
That makes it not dependent on virtual call,
keeping logic the same.

llvm-svn: 297723
2017-03-14 10:05:43 +00:00
George Rimar 0c1c8085bc [ELF] - Move ThreadBssOffset and Dot to LinkerScriptBase. NFC.
One more step to combine LinkerScript and LinkerScriptBase.

llvm-svn: 297722
2017-03-14 10:00:19 +00:00
Sylvestre Ledru 72e3fa7e2c describe the recent changes in clang-format in the 5.0 release notes
llvm-svn: 297721
2017-03-14 09:43:55 +00:00
George Rimar e21c3af7e9 [ELF] - Remove unnecessary template #4. NFC.
OutputSectionFactory has no ELFT templates anymore.

llvm-svn: 297720
2017-03-14 09:30:25 +00:00
George Rimar 09268b7b1e [ELF] - Remove unnecessary template #3. NFC.
llvm-svn: 297719
2017-03-14 09:25:03 +00:00
George Rimar f08b592390 [ELF] - Remove unnecessary template #2. NFC.
llvm-svn: 297718
2017-03-14 09:19:34 +00:00
George Rimar 788fe38f99 [ELF] - Remove unnecessary template. NFC.
llvm-svn: 297717
2017-03-14 09:14:28 +00:00
Sam Parker 916b1ba617 [ARM] Move SMULW[B|T] isel to DAG Combine
Create nodes for smulwb and smulwt and move their selection from
DAGToDAG to DAG combine. smlawb and smlawt can then be selected
using tablegen. Added some helper functions to detect shift patterns
as well as a wrapper around SimplifyDemandBits. Added a couple of
extra tests.

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

llvm-svn: 297716
2017-03-14 09:13:22 +00:00
Oren Ben Simhon fe34c5e429 Disable Callee Saved Registers
Each Calling convention (CC) defines a static list of registers that should be preserved by a callee function. All other registers should be saved by the caller.
Some CCs use additional condition: If the register is used for passing/returning arguments – the caller needs to save it - even if it is part of the Callee Saved Registers (CSR) list.
The current LLVM implementation doesn’t support it. It will save a register if it is part of the static CSR list and will not care if the register is passed/returned by the callee.
The solution is to dynamically allocate the CSR lists (Only for these CCs). The lists will be updated with actual registers that should be saved by the callee.
Since we need the allocated lists to live as long as the function exists, the list should reside inside the Machine Register Info (MRI) which is a property of the Machine Function and managed by it (and has the same life span).
The lists should be saved in the MRI and populated upon LowerCall and LowerFormalArguments.
The patch will also assist to implement future no_caller_saved_regsiters attribute intended for interrupt handler CC.

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

llvm-svn: 297715
2017-03-14 09:09:26 +00:00
George Rimar 2d2621090d [ELF] - Step to combine LinkerScript and LinkerScriptBase
We can move all not templated functionality to LinkerScriptBase.
Patch do that for hasPhdrsCommands() and shows how it helps to detemplate
things in other places.

Probably we should be able to merge these 2 classes into single one after such steps.
Even if not, it still looks as reasonable cleanup for me.

Differential revision: https://reviews.llvm.org/D30895

llvm-svn: 297714
2017-03-14 09:03:53 +00:00
Eugene Leviant 5784e96f5c [ELF] Fix LMA offset calculation
Differential revision: https://reviews.llvm.org/D30832

llvm-svn: 297713
2017-03-14 08:57:09 +00:00
Eugene Leviant 30c1b436ad [ELF] Fix crash when .eh_frame(_hdr) is discarded
lld crashes when .eh_frame or .eh_frame_hdr section is discarded
in linker script and there is no PHDRS directive.

Differential revision: https://reviews.llvm.org/D30885

llvm-svn: 297712
2017-03-14 08:49:09 +00:00
Eugene Leviant 2968547997 [ELF] Fix error reporting for synthetic sections
Synthetic sections don't belong to any input file, but still they
are input sections. Whenever problem occurs with relocations in
these sections lld crashes in error reporting, trying to print
input file name.

Differential revision: https://reviews.llvm.org/D30889

llvm-svn: 297711
2017-03-14 08:33:45 +00:00
Tobias Grosser d614b3e6bd Preserve the isl-noexceptions.h C++ bindings when updating isl
The bindings currently need to be generated manually, as they are not yet
part of the official isl distribution. Hence, we keep them across updates
assuming they only need to be updated when new functions or functionality
should be exposed.

llvm-svn: 297710
2017-03-14 07:46:28 +00:00
Tobias Grosser 9c19a0e16a Add back header file that was accidentally dropped in previous update
llvm-svn: 297709
2017-03-14 07:39:05 +00:00
Tobias Grosser 593ebdfbd1 Update to isl-0.18-369-g5e613c6
This is a regular maintenance update.

llvm-svn: 297708
2017-03-14 07:33:26 +00:00
Craig Topper 7a5ee1c5ed [AVX-512] Use iPTR instead of i64 in patterns for extract_subvector/insert_subvector index.
llvm-svn: 297707
2017-03-14 06:40:04 +00:00
Craig Topper b0a82eaea6 [AVX-512] Add test cases that demonstrate some patterns that don't work correctly in 32-bit mode. NFC
llvm-svn: 297706
2017-03-14 06:40:00 +00:00
Jonas Paulsson a48ea231c0 [TargetTransformInfo] getIntrinsicInstrCost() scalarization estimation improved
getIntrinsicInstrCost() used to only compute scalarization cost based on types.
This patch improves this so that the actual arguments are checked when they are
available, in order to handle only unique non-constant operands.

Tests updates:

Analysis/CostModel/X86/arith-fp.ll
Transforms/LoopVectorize/AArch64/interleaved_cost.ll
Transforms/LoopVectorize/ARM/interleaved_cost.ll

The improvement in getOperandsScalarizationOverhead() to differentiate on
constants made it necessary to update the interleaved_cost.ll tests even
though they do not relate to intrinsics.

Review: Hal Finkel
https://reviews.llvm.org/D29540

llvm-svn: 297705
2017-03-14 06:35:36 +00:00
Craig Topper 9d50e187cd [AVX-512] Pre-emptively fix more places in fastisel where we might copy a VK1 register into a AH/BH/CH/DH register.
llvm-svn: 297704
2017-03-14 04:18:25 +00:00
Bruno Cardoso Lopes 704c8a929b Fix cmake to find the compiler-rt libs on darwin
Followup for r297553, which left darwin in a broken state
http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan_build/3812

rdar://problem/31011980

llvm-svn: 297703
2017-03-14 04:12:29 +00:00
Akira Hatanaka ff8534b896 [CodeGen][ObjC] Fix a bug where the type of an ivar wasn't encoded
correctly.

This fixes PR30413.

Patch by David Lobron.

llvm-svn: 297702
2017-03-14 04:00:52 +00:00
Jason Molenda b9d9ac49eb update.
llvm-svn: 297701
2017-03-14 03:28:27 +00:00