Commit Graph

210029 Commits

Author SHA1 Message Date
Johannes Doerfert
90db75ed24 Runtime error check elimination
Hoist runtime checks in the loop nest if they guard an "error" like event.
  Such events are recognized as blocks with an unreachable terminator or a call
  to the ubsan function that deals with out of bound accesses. Other "error"
  events can be added easily.

  We will ignore these blocks when we detect/model/optmize and code generate SCoPs
  but we will make sure that they would not have been executed using the assumption
  framework.

llvm-svn: 247310
2015-09-10 17:51:27 +00:00
Philip Reames
053701399d [SimplifyCFG] Use known bits to eliminate dead switch defaults
This is a follow up to http://reviews.llvm.org/D11995 implementing the suggestion by Hans.

If we know some of the bits of the value being switched on, we know that the maximum number of unique cases covers the unknown bits. This allows to eliminate switch defaults for large integers (i32) when most bits in the value are known.

Note that I had to make the transform contingent on not having any dead cases. This is conservatively correct with the old code, but required for the new code since we might have a dead case which varies one of the known bits. Counting that towards our number of covering cases would be bad.  If we do have dead cases, we'll eliminate them first, then revisit the possibly dead default.

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

llvm-svn: 247309
2015-09-10 17:44:47 +00:00
Chris Bieneman
a5478698bf [CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.
llvm-svn: 247308
2015-09-10 17:28:51 +00:00
Artem Belevich
da1851ca58 [CUDA] Allow trivial constructors as initializer for __shared__ variables.
Differential Revision: http://reviews.llvm.org/D12739

llvm-svn: 247307
2015-09-10 17:26:58 +00:00
Chris Bieneman
170fd9cb6e [CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overridden
llvm-svn: 247306
2015-09-10 17:23:32 +00:00
Jordan Rose
3d75297056 [CMake] Fix Xcode build with LLVM_ENABLE_OBJLIB.
This amends chapuni's r246156 to handle an Xcode quirk, one even called out
in the CMake documentation:

    Some native build systems may not like targets that have only object files,
    so consider adding at least one real source file to any target that
    references $<TARGET_OBJECTS:objlib>.

I've limited the scope of this hack to Xcode for now.

llvm-svn: 247305
2015-09-10 17:18:51 +00:00
Adrian Prantl
d209500fd5 Debug Info: Allow a DIModule to appear as the scope of other entities.
llvm-svn: 247304
2015-09-10 17:13:58 +00:00
Adrian Prantl
54a3457fe1 Debug Info: Remove an unnecessary debug type visitor.
Thanks to dblaikie for spotting this.

llvm-svn: 247303
2015-09-10 17:13:31 +00:00
Hans Wennborg
7eb5464bc5 Re-commit r247218: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
This never broke the build; it was the LLVM side, r247216, that caused problems.

llvm-svn: 247302
2015-09-10 17:07:54 +00:00
Philip Reames
fba81bc076 [docs][PerformanceTips] Add text on allocas and alignment
This summarizes two recent llvm-dev discussions.  Most of the text provided by David Chisnall and Benoit Belley with minor editting by me.  

llvm-svn: 247301
2015-09-10 17:03:10 +00:00
Kostya Serebryany
a938bcb89a [libFuzzer] add two more variants of FuzzerDriver for convenience
llvm-svn: 247300
2015-09-10 16:57:57 +00:00
Joseph Tremoulet
f3aff31401 [WinEH] Fix single-block cleanup coloring
Summary:
The coloring code in WinEHPrepare queues cleanuprets' successors with the
correct color (the parent one) when it sees their cleanuppad, and so later
when iterating successors knows to skip processing cleanuprets since
they've already been queued.  This latter check was incorrectly under an
'else' condition and so inadvertently was not kicking in for single-block
cleanups.  This change sinks the check out of the 'else' to fix the bug.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: llvm-commits

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

llvm-svn: 247299
2015-09-10 16:51:25 +00:00
Hans Wennborg
aa15bffa1f Re-commit r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes"
Except the changes that defined virtual destructors as =default, because that
ran into problems with GCC 4.7 and overriding methods that weren't noexcept.

llvm-svn: 247298
2015-09-10 16:49:58 +00:00
Alexander Kornienko
7532d3e93d [clang-tidy] Add misc-sizeof-container check to find sizeof() uses on stl
containers.

Summary:
sizeof(some_std_string) is likely to be an error. This check finds this
pattern and suggests using .size() instead.

Reviewers: djasper, klimek, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 247297
2015-09-10 16:37:46 +00:00
Steven Wu
e3b1f2b765 Fix an undefined behavior introduces in r247234
llvm-svn: 247296
2015-09-10 16:32:28 +00:00
Sanjay Patel
9361d35525 80-cols; NFC
llvm-svn: 247295
2015-09-10 16:31:19 +00:00
Sanjay Patel
f4b34b76d4 use range-based for loop; NFCI
llvm-svn: 247294
2015-09-10 16:25:38 +00:00
Sanjay Patel
5e7bd91891 use range-based for loop; NFCI
llvm-svn: 247293
2015-09-10 16:15:21 +00:00
Vedant Kumar
1abc48ee58 [Bitcode] Add xfail test for PR24755 (uselistorder)
This test stresses verify-uselistorder. PR24755 is caused by our
ignoring uses when they occur in the function personality slot, the
prologue data slot, or the prefix data slot.

llvm-svn: 247292
2015-09-10 16:02:24 +00:00
Johannes Doerfert
f4fa9879fb [FIX] Do not assume only one loop can be left at a time
llvm-svn: 247291
2015-09-10 15:53:59 +00:00
Rafael Espindola
0a2e211ace Create a PT_LOAD program header for the start of the file.
With this a trivial dynamic program works with the musl dynamic linker:

LD_LIBRARY_PATH=.  ~/musl/lib/libc.so ./t

llvm-svn: 247290
2015-09-10 15:41:34 +00:00
Johannes Doerfert
b68cffb5df Allow general loops with one latch
As we do not rely on ScalarEvolution any more we do not need to get
  the backedge taken count. Additionally, our domain generation handles
  everything that is affine and has one latch and our ScopDetection will
  over-approximate everything else.

  This change will therefor allow loops with:
    - one latch
    - exiting conditions that are affine

  Additionally, it will not check for structured control flow anymore.
  Hence, loops and conditionals are not necessarily single entry single
  exit regions any more.

Differential Version: http://reviews.llvm.org/D12758

llvm-svn: 247289
2015-09-10 15:27:46 +00:00
Michael Kruse
d868b5d509 Merge TempScopInfo into ScopInfo
The TempScopInfo (-polly-analyze-ir) pass is removed and its work taken
over by ScopInfo (-polly-scops). Several tests depend on
-polly-analyze-ir and use -polly-scops instead which for the moment
prints the output of both passes. This again is not expected by some
other tests, especially those with negative searches, which have been
adapted.

Differential Version: http://reviews.llvm.org/D12694

llvm-svn: 247288
2015-09-10 15:25:24 +00:00
Sanjay Patel
59661459f1 fix typo; NFC
llvm-svn: 247287
2015-09-10 15:14:34 +00:00
Aaron Ballman
47ebc1660d Properly close documentation /code blocks with /endcode.
llvm-svn: 247286
2015-09-10 15:13:22 +00:00
Michael Kruse
9cc1b9d31e Clean-up unit tests
Remove redundant flags and duplicate invocations of the same test.

llvm-svn: 247285
2015-09-10 14:42:09 +00:00
Bruce Mitchener
809b860bd3 Build Plugin/JITLoader/GDB on all platforms.
Summary:
We currently link to this on all platforms, so don't need to re-include
it into the LLDB_USED_LIBS. Also don't need to special case building
it for every supported platform.

Reviewers: clayborg, labath

Subscribers: lldb-commits

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

llvm-svn: 247284
2015-09-10 14:28:49 +00:00
Alex Lorenz
0153e59935 Fix PR 24724 - The implicit register verifier shouldn't assume certain operand
order.

The implicit register verifier in the MIR parser should only check if the
instruction's default implicit operands are present in the instruction. It
should not check the order in which they occur.

llvm-svn: 247283
2015-09-10 14:04:34 +00:00
Alexander Kornienko
3285f1b850 [clang-tidy] add_new_check.py improvements: add doc file, refer it from .h
+ some console logging and minor cleanups.

llvm-svn: 247282
2015-09-10 13:56:39 +00:00
Rafael Espindola
7915b9eb42 Cleaning up LLVM IR mode for Emacs.
I've made a range of improvements to the Emacs mode for LLVM IR.

Most importantly, it changes llvm-mode to inherit from prog-mode. This
means llvm-mode will be treated as a normal programming mode in Emacs,
so many Emacs features will just work. prog-mode is new to Emacs 24,
so I've added an alias to ensure compatibility with Emacs 23 too.

I've changed the mode definition to use define-derived-mode. This
saves us needing to set up local variables ourselves, and saves us
needing to define llvm-mode-map, llvm-mode-abbrev-table,
llvm-mode-map.

I've removed the keybindings to tab-to-tab-stop, center-line and
center-paragraph. This shouldn't be llvm-mode's responsibility, and
the code didn't actually work anyway (since `(not llvm-mode-map)`
always evaluated to `t`, the keybindings were never executed).

I've simplified the syntax-table definition, it's equivalent (e.g. `"`
is treated as string delimiter by default in Emacs). I've added `.` as
a symbol constituent, so functions like `llvm.memset.p0i8.i32` are
recognised as a single symbol. I've also changed `%` to be a symbol
constituent, so users can move between words or symbols at their
choice, rather than conflating the two.

I've fixed regexp for types, which incorrect used `symbol` instead of
`symbols` as an argument to `regexp-opt`. This was causing incorrect
highlighting on lines like `call void @foovoid`.

I've removed string and comment highlighting from
`llvm-font-lock-keywords`. This is already handled by the
syntax-table.

Finally, I've removed the reference to jasmin. That project is long
abandoned and the link 404s. For reference, I've found an old copy of
the project here:
https://github.com/stevej/emacs/blob/master/vendor/jasmin/jasmin.el

Patch by Wilfred Hughes!

llvm-svn: 247281
2015-09-10 13:44:28 +00:00
Johannes Doerfert
32ae76e7f9 [NFC] Remove obsolete arguments
Remove some arguments that survived the recent changes but are not
  used any more.

llvm-svn: 247280
2015-09-10 13:12:02 +00:00
Johannes Doerfert
5b9ff8b667 Replace ScalarEvolution based domain generation
This patch replaces the last legacy part of the domain generation, namely the
ScalarEvolution part that was used to obtain loop bounds. We now iterate over
the loops in the region and propagate the back edge condition to the header
blocks. Afterwards we propagate the new information once through the whole
region. In this process we simply ignore unbounded parts of the domain and
thereby assume the absence of infinite loops.

  + This patch already identified a couple of broken unit tests we had for
    years.
  + We allow more loops already and the step to multiple exit and multiple back
    edges is minimal.
  + It allows to model the overflow checks properly as we actually visit
    every block in the SCoP and know where which condition is evaluated.
  - It is currently not compatible with modulo constraints in the
    domain.

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

llvm-svn: 247279
2015-09-10 13:00:06 +00:00
Johannes Doerfert
171f07ed71 Disable support for modulo expressions
The support for modulo expressions is not comlete and makes the new
  domain generation harder. As the currently broken domain generation
  needs to be replaced, we will first swap in the new, fixed domain
  generation and make it compatible with the modulo expressions later.

llvm-svn: 247278
2015-09-10 12:56:46 +00:00
Igor Breger
86be1c5caf AVX-512: Changed nidx parameter in extractf64/32 intrinsic from i8 to i32 according to the Intel Spec
Differential Revision: http://reviews.llvm.org/D12752

llvm-svn: 247277
2015-09-10 12:55:54 +00:00
Igor Breger
7f69a99c54 AVX512: Implemented encoding and intrinsics for
vextracti64x4 ,vextracti64x2, vextracti32x8, vextracti32x4, vextractf64x4, vextractf64x2, vextractf32x8, vextractf32x4
Added tests for intrinsics and encoding.

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

llvm-svn: 247276
2015-09-10 12:54:54 +00:00
Aaron Ballman
e11ce62707 Silencing C4141 warnings that were introduced en masse because __forceinline cannot be combined with inline in MSVC without triggering this diagnostic. This is safe to disable because clang will catch instances of the issue with -Wduplicate-decl-specifier, so we are not losing diagnostic coverage.
llvm-svn: 247275
2015-09-10 12:53:40 +00:00
Michael Kruse
7bf3944d23 Merge TempScopInfo.{cpp|h} into ScopInfo.{cpp|h}
This prepares for a series of patches that merges TempScopInfo into ScopInfo to
reduce Polly's code complexity. Only ScopInfo.{cpp|h} will be left thereafter.
Moving the code of TempScopInfo in one commit makes the mains diffs simpler to
understand.

In detail, merging the following classes is planned:
TempScopInfo into ScopInfo
TempScop into Scop
IRAccess into MemoryAccess

Only moving code, no functional changes intended.

Differential Version: http://reviews.llvm.org/D12693

llvm-svn: 247274
2015-09-10 12:46:52 +00:00
Alexey Bataev
6a43c00ebd [OPENMP] Generate threadprivates as TLS variables by default.
If target supports TLS all threadprivates are generated as TLS. If target does not support TLS, use runtime calls for proper codegen of threadprivate variables.

llvm-svn: 247273
2015-09-10 12:06:58 +00:00
Benjamin Kramer
8f870499ab [FileCheck] Use range-based for loops. NFC.
llvm-svn: 247272
2015-09-10 11:59:55 +00:00
Jakub Kuderski
58ea4eeb9e There is a trunc(lshr (zext A), Cst) optimization in InstCombineCasts that
removes cast by performing the lshr on smaller types. However, currently there
is no trunc(lshr (sext A), Cst) variant.
This patch add such optimization by transforming trunc(lshr (sext A), Cst)
to ashr A, Cst.

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

llvm-svn: 247271
2015-09-10 11:31:20 +00:00
Alexey Bataev
5852e42949 [OPENMP] Fix test incompatibility with Windows.
llvm-svn: 247270
2015-09-10 11:31:04 +00:00
Chandler Carruth
233edd20a7 [ADT] Rewrite the StringRef::find implementation to be simpler, clearer,
and tremendously less reliant on the optimizer to fix things.

The code is always necessarily looking for the entire length of the
string when doing the equality tests in this find implementation, but it
previously was needlessly re-checking the size each time among other
annoyances.

By writing this so simply an ddirectly in terms of memcmp, it also is
about 8x faster in a debug build, which in turn makes FileCheck about 2x
faster in 'ninja check-llvm'. This saves about 8% of the time for
FileCheck-heavy parts of the test suite like the x86 backend tests.

llvm-svn: 247269
2015-09-10 11:17:49 +00:00
Alexey Bataev
e19facb9bc [OPENMP] Fix test incompatibility with Windows codegen.
llvm-svn: 247268
2015-09-10 11:09:46 +00:00
Tamas Berghammer
bb97321003 Fix crash in lldb-server caused by an API change in LLVM
llvm-svn: 247267
2015-09-10 11:08:41 +00:00
Alexander Kornienko
a24501b2e1 [clang-tidy] Renamed tests files to be closer to the check names.
llvm-svn: 247266
2015-09-10 10:58:38 +00:00
Silviu Baranga
df9ce8408a [DAGCombine] Truncate BUILD_VECTOR operators if necessary when constant folding vectors
Summary:
The BUILD_VECTOR node will truncate its operators to match the
type. We need to take this into account when constant folding -
we need to perform a truncation before constant folding the elements.
This is because the upper bits can change the result, depending on
the operation type (for example this is the case for min/max).

This change also adds a regression test.

Reviewers: jmolloy

Subscribers: jmolloy, llvm-commits

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

llvm-svn: 247265
2015-09-10 10:34:34 +00:00
James Molloy
d47634d781 Enable GlobalsAA by default
This can give significant improvements to alias analysis in some situations, and improves its testing coverage in all situations.

llvm-svn: 247264
2015-09-10 10:22:20 +00:00
James Molloy
efbba72cb2 Add GlobalsAA as preserved to a bunch of transforms
GlobalsAA must by definition be preserved in function passes, but the passmanager doesn't know that. Make each pass explicitly preserve GlobalsAA.

llvm-svn: 247263
2015-09-10 10:22:12 +00:00
Ewan Crawford
7dc7771cd5 New RenderScript command to break on all kernels
Patch adds a command to RenderScript plugin allowing users to automatically set breakpoints on every RS kernel.

Command syntax is 'language renderscript kernel breakpoint all <enable/disable>.'
Enable sets breakpoints on all currently loaded kernels, and any kernels which will be loaded in future.
Disable results in breakpoints no longer being set on loaded kernels, but doesn't affect existing breakpoints.

Current command 'language renderscript kernel breakpoint' is changed to 'language renderscript kernel breakpoint set'

Reviewed by: clayborg, jingham
Subscribers: lldb-commits, ADodds, domipheus
Differential Revision: http://reviews.llvm.org/D12728

llvm-svn: 247262
2015-09-10 10:08:48 +00:00
Alexander Kornienko
11d4d6446e [clang-tidy] Add inconsistent declaration parameter name check
This is first of series of patches, porting code from my project colobot-lint,
as I mentioned recently in cfe-dev mailing list.

This patch adds a new check in readability module:
readability-inconsistent-declaration-parameter-name. I also added appropriate
testcases and documentation.

I chose readability module, as it seems it is the best place for it.

I think I followed the rules of LLVM coding guideline, but I may have missed
something, as I usually use other code formatting style.

http://reviews.llvm.org/D12462

Patch by Piotr Dziwinski!

llvm-svn: 247261
2015-09-10 10:07:11 +00:00