Commit Graph

256023 Commits

Author SHA1 Message Date
Dean Michael Berris 427215ce5e [XRay][compiler-rt] Switch default XRay 'patch_premain' to false
Summary:
Currently, we assume that applications built with XRay would like to
have the instrumentation sleds patched before main starts. This patch
changes the default so that we do not patch the instrumentation sleds
before main. This default is more helpful for deploying applications in
environments where changing the current default is harder (i.e. on
remote machines, or work-pool-like systems).

This default (not to patch pre-main) makes it easier to selectively run
applications with XRay instrumentation enabled, than with the current
state.

Reviewers: echristo, timshen

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 296445
2017-02-28 08:10:01 +00:00
Chandler Carruth d1c95b67ba [IR] Add range accessors for the indices of a GEP instruction.
These were noticed as missing in a code review. Add them and the boring
unit test to make sure they compile and DTRT.

llvm-svn: 296444
2017-02-28 08:04:20 +00:00
Vassil Vassilev c986f8765a Fix Win bots.
llvm-svn: 296443
2017-02-28 07:26:21 +00:00
Vassil Vassilev 44693083be Allow externally dlopen-ed libraries to be registered as permanent libraries.
This is also useful in cases when llvm is in a shared library. First we dlopen
the llvm shared library and then we register it as a permanent library in order
to keep the JIT and other services working.

Patch reviewed by Vedant Kumar (D29955)!

llvm-svn: 296442
2017-02-28 07:11:59 +00:00
Tobias Grosser cf66ea3845 Update isl to isl-0.18-304-g1efe43d
This is a normal maintenance update.

llvm-svn: 296441
2017-02-28 07:06:06 +00:00
Sanjoy Das eef785c1a5 [ImplicitNullCheck] Add alias analysis usage
Summary:
With this change ImplicitNullCheck optimization uses alias analysis
and can use load/store memory access for implicit null check if there
are other load/store before but memory accesses do not alias.

Patch by Serguei Katkov!

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 296440
2017-02-28 07:04:49 +00:00
Rui Ueyama 6b776ad985 Refactor {Gnu,}HashTableSection classes.
In other places in LLD, we use write32<E> instead of Elf_Word.
This patch uses the same technique in the hash table classes.
The hash table classes needs improving as they have almost no
comments. We at least need to describe the hash table structure
and why we have to support two different on-disk hash tables
for the same purpose. I'll do that later.

llvm-svn: 296439
2017-02-28 05:53:47 +00:00
Xin Tong c647dcfba0 Empty line. NFCI
llvm-svn: 296438
2017-02-28 05:30:48 +00:00
Rui Ueyama ab0a85ef4d Remove unused typedefs.
llvm-svn: 296437
2017-02-28 05:25:37 +00:00
Rui Ueyama c3726f8263 Remove useless assignments.
These assignments seem meaningful, but actually all tests pass without them.

llvm-svn: 296436
2017-02-28 04:41:20 +00:00
Rui Ueyama b8dcdb5900 Merge SymbolTableSection::add{Global,Local} into one function.
Previously, these two functions put their symbols in different queues.
Now that the queues have been merged. So there's no point to keep two
separate functions.

llvm-svn: 296435
2017-02-28 04:20:16 +00:00
Rui Ueyama 406331ebfd Return early. NFC.
llvm-svn: 296434
2017-02-28 04:11:01 +00:00
Rui Ueyama 968db48cee Move SymbolTableSection::getOutputSection to SymbolBody::getOutputSection.
That function doesn't use any member of SymbolTableSection, so I
couldn't see a reason to make it a member of that class. The function
takes a SymbolBody, so it is more natural to make it a member of
SymbolBody.

llvm-svn: 296433
2017-02-28 04:02:42 +00:00
Xin Tong 01feb29ad2 [LoopUnswitch] Common pushing LIC's user to worklist.
llvm-svn: 296432
2017-02-28 03:32:41 +00:00
Rui Ueyama 6e96734dd1 Simplify SymbolTableSection<ELFT>::finalizeContents().
Previously, there were three conditions: .symtab, .dynsym or we are
producing a relocatable output. Turned out that the third condition is
the same as the first one. This patch removes that third condition and
simplify code.

llvm-svn: 296431
2017-02-28 03:29:12 +00:00
Brad Smith 3d648b357a Set ABIs correctly for OpenBSD/arm; soft float and aapcs-linux.
llvm-svn: 296430
2017-02-28 03:20:26 +00:00
Sean Silva 1d96185f57 Add Triple::thumb to getBitcodeMachineKind
We really need to find a way to get this info from a single point of
truth in the LLVM backend, but it seems that the EM_* constants are
buried deep inside the constructors of the MCAsmBackend's.

For now, just fill in entries as we run into cases. AFAIK these mappings
are largely immutable, so we get a 75% discount on the technical debt
(code is duplicated, but little chance of divergence).

llvm-svn: 296429
2017-02-28 03:00:48 +00:00
Filipe Cabecinhas 6e36c11d2a Revert r296419 since the strings appear to need some tweaking.
llvm-svn: 296428
2017-02-28 02:45:46 +00:00
Eugene Zemtsov 23847fbefe Add a comment to describe purpose of signal-filtering test
llvm-svn: 296427
2017-02-28 02:40:34 +00:00
Matthias Braun 81f68ec3a9 Revert "Add MIR-level outlining pass"
Revert Machine Outliner for now, as it breaks the asan bot.

This reverts commit r296418.

llvm-svn: 296426
2017-02-28 02:24:30 +00:00
Daniel Berlin 57196dbadb This script was meant to be committed with the DebugCounter changes.
llvm-svn: 296425
2017-02-28 02:19:11 +00:00
Filipe Cabecinhas f1d4ae579d [non-executable-pc.cpp] Try to fix clang-ppc64be buildbot.
llvm-svn: 296424
2017-02-28 02:05:53 +00:00
Rui Ueyama 1f03253767 Improve SymbolTableSection synthetic section.
The previous code was a bit hard to understand because it unnecessarily
distinguished local and non-local symbols. It had NumLocals member
variable, but that variable didn't have a number of local symbols but
had some value that I cannot describe easily.

This patch rewrites SynbolTableSection::finalizeContents and
SymbolTableSection::writeTo to make it easy to understand. NumLocals
member variable has been removed, and writeGlobalSymbols and
writeLocalSymbols have been merged into one function.

There's still a piece of code that I think unnecessary. I'm not removing
that code in this patch, but will do in a follow-up patch.

llvm-svn: 296423
2017-02-28 01:56:36 +00:00
Dominic Chen 00355a51d0 Revert "Reland: [analyzer] NFC: Update test infrastructure to support multiple constraint managers"
This reverts commit 1b28d0b10e1c8feccb971abb6ef7a18bee589830.

llvm-svn: 296422
2017-02-28 01:50:23 +00:00
Lang Hames 6b0b2b54da [docs] Fix a think-o in the Programmer's Manual.
llvm-svn: 296421
2017-02-28 01:35:31 +00:00
Amaury Sechet 428f8f5a27 Add test case for usubo combine. NFC.
llvm-svn: 296420
2017-02-28 01:16:39 +00:00
Filipe Cabecinhas cd643f6324 [asan] Print a "PC is at a non-executable memory region" message if that's the case
Summary: Points the user to look at function pointer assignments.

Reviewers: kcc, eugenis, kubamracek

Subscribers: llvm-commits

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

llvm-svn: 296419
2017-02-28 00:56:43 +00:00
Matthias Braun d36410945f Add MIR-level outlining pass
This is a patch for the outliner described in the RFC at:
http://lists.llvm.org/pipermail/llvm-dev/2016-August/104170.html

The outliner is a code-size reduction pass which works by finding
repeated sequences of instructions in a program, and replacing them with
calls to functions. This is useful to people working in low-memory
environments, where sacrificing performance for space is acceptable.

This adds an interprocedural outliner directly before printing assembly.
For reference on how this would work, this patch also includes X86
target hooks and an X86 test.

The outliner is run like so:

clang -mno-red-zone -mllvm -enable-machine-outliner file.c

Patch by Jessica Paquette<jpaquette@apple.com>!

rdar://29166825

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

llvm-svn: 296418
2017-02-28 00:33:32 +00:00
Amaury Sechet 5a605fc6c6 Add test case for computing known bits of substraction operations. NFC
llvm-svn: 296417
2017-02-28 00:15:13 +00:00
Michael Kuperstein 13bf8a2684 [CGP] Split some critical edges coming out of indirect branches
Splitting critical edges when one of the source edges is an indirectbr
is hard in general (because it requires changing the memory the indirectbr
reads). But if a block only has a single indirectbr predecessor (which is
the common case), we can simulate splitting that edge by splitting
the destination block, and retargeting the *direct* branches.

This is motivated by the use of computed gotos in python 2.7: PyEval_EvalFrame()
ends up using an indirect branch with ~100 successors, and passing a constant to
each of those. Since MachineSink can't break indirect critical edges on demand
(and doing this in MIR doesn't look feasible), this causes us to emit about ~100
defs of registers containing constants, which we in the predecessor block, where
only one of those constants is used in each successor. So, at each computed goto,
we needlessly spill about a 100 constants to stack. The end result is that a
clang-compiled python interpreter can be about ~2.5x slower on a simple python
reduction loop than a gcc-compiled interpreter.

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

llvm-svn: 296416
2017-02-28 00:11:34 +00:00
Zachary Turner 695ed56ba5 [PDB] Make streams carry their own endianness.
Before the endianness was specified on each call to read
or write of the StreamReader / StreamWriter, but in practice
it's extremely rare for streams to have data encoded in
multiple different endiannesses, so we should optimize for the
99% use case.

This makes the code cleaner and more general, but otherwise
has NFC.

llvm-svn: 296415
2017-02-28 00:04:07 +00:00
Dominic Chen 59cd893320 Reland: [analyzer] NFC: Update test infrastructure to support multiple constraint managers
Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952.

Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin

Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits

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

llvm-svn: 296414
2017-02-28 00:02:36 +00:00
Eugene Zelenko e94042cafe [DebugInfo] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 296413
2017-02-27 23:43:14 +00:00
Jason Molenda eb0e7cb8de Ah, this was an early exit to leave built products around, it wasn't meant to
be checked in.

llvm-svn: 296412
2017-02-27 23:31:29 +00:00
Michael Kuperstein c07cca85fb [SLP] Load sorting should not try to sort things that aren't loads.
We may get a VL where the first element is a load, but the others
aren't. Trying to sort such VLs can only lead to sorrow.

llvm-svn: 296411
2017-02-27 23:18:11 +00:00
Dan Gohman 1588b6a9f8 [MC] Implement the COFF directives in MCNullStreamer.
This fixes -filetype=null errors introduced in r296403.

llvm-svn: 296410
2017-02-27 23:10:18 +00:00
Matt Arsenault cdb468c0f9 AMDGPU: Basic folds for fmed3 intrinsic
Constant fold, canonicalize constants to RHS,
reduce to minnum/maxnum when inputs are nan/undef.

llvm-svn: 296409
2017-02-27 23:08:49 +00:00
Nico Weber 65da45763e clang-format: Don't leave behind temp files in -i mode on Windows, PR26125, reloaded
Second attempt after http://llvm.org/viewvc/llvm-project?rev=296166&view=rev

In the first attempt, Code (the memory buffer backing the input file) was reset
before overwriteChangedFiles() was called, but overwriteChangedFiles() still
reads from it.  This time, load the whole input file into memory instead of
using mmap when formatting in-place.

(Since the test is identical to what was in the repo before chapuni's revert,
svn diff doesn't show it – see the above link for the test.)

https://reviews.llvm.org/D30385

llvm-svn: 296408
2017-02-27 22:59:58 +00:00
Zachary Turner 4c7458b00d Remove some code accidentally left in.
llvm-svn: 296407
2017-02-27 22:57:32 +00:00
Tim Hammerquist f54f74660d update pbxproj to match cmake config, broken in r296335
llvm-svn: 296406
2017-02-27 22:56:27 +00:00
Petr Hosek 6f16857167 [AddressSanitizer] Put shadow at 0 for Fuchsia
The Fuchsia ASan runtime reserves the low part of the address space.

Patch by Roland McGrath

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

llvm-svn: 296405
2017-02-27 22:49:37 +00:00
Eugene Zelenko fa912a7151 [CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 296404
2017-02-27 22:45:06 +00:00
Dan Gohman 1f4e26fc58 [MC] Factor out non-COFF handling of COFF-specific directives.
Instead of requiring every non-COFF MCObjectStreamer to implement the
COFF hooks just to do an llvm_unreachable to say that they're not
supported, do the llvm_unreachable in the default implementation, as
suggested by rnk in https://reviews.llvm.org/D26722.

llvm-svn: 296403
2017-02-27 22:44:37 +00:00
Dan Gohman d37dc2f773 [WebAssembly] Add some comments and tidy up whitespace.
llvm-svn: 296402
2017-02-27 22:41:39 +00:00
Matt Arsenault 10268f93e8 AMDGPU: Use v_med3_{f16|i16|u16}
llvm-svn: 296401
2017-02-27 22:40:39 +00:00
Rui Ueyama 3bc39016cd Refactor write{Global,Local}Symbols.
This part of code is hard to understand because NumLocals does not
actually mean the number of local symbols but something else (!).
We need to rewrite. But before that we need to clean it up.

llvm-svn: 296400
2017-02-27 22:39:50 +00:00
Dan Gohman f52ee17a09 [WebAssembly] Split CFG-sorting into its own pass. NFC.
CFG sorting was already an independent algorithm from block/loop insertion;
this change makes it more convenient to debug.

llvm-svn: 296399
2017-02-27 22:38:58 +00:00
Hans Wennborg 2d5841fa73 Revert r296366 "[InlineFunction] add nonnull assumptions based on argument attributes"
It causes miscompiles e.g. during self-host of Clang (PR32082).

llvm-svn: 296398
2017-02-27 22:33:02 +00:00
Zachary Turner c78a5560fe Add missing namespace qualifier.
llvm-svn: 296397
2017-02-27 22:17:50 +00:00
Matt Arsenault eb522e68bc AMDGPU: Support v2i16/v2f16 packed operations
llvm-svn: 296396
2017-02-27 22:15:25 +00:00