| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
| |
Phabricator ticket: D4246, Don't merge functions with different range metadata on call/invoke.
Thanks!
llvm-svn: 213060
|
| |
|
|
|
|
|
| |
Specifically, when building a union query, if we are dominated by an identical
query then use the result of that query instead.
llvm-svn: 213047
|
| |
|
|
|
|
| |
domtree.
llvm-svn: 213046
|
| |
|
|
| |
llvm-svn: 213045
|
| |
|
|
|
|
| |
relevant. Fixes PR18304. Patch by David Wiberg!
llvm-svn: 212970
|
| |
|
|
| |
llvm-svn: 212963
|
| |
|
|
|
|
| |
BugpointPasses, on Win32.
llvm-svn: 212904
|
| |
|
|
|
|
|
|
|
|
| |
not properly handle the case where the predecessor block was the entry block to
the function. The only in-tree client of this is JumpThreading, which worked
around the issue in its own code. This patch moves the solution into the helper
so that JumpThreading (and other clients) do not have to replicate the same fix
everywhere.
llvm-svn: 212875
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
error reports.
Currently ASan instrumentation pass creates a string with global name
for each instrumented global (to include global names in the error report). Global
name is already mangled at this point, and we may not be able to demangle it
at runtime (e.g. there is no __cxa_demangle on Android).
Instead, create a string with fully qualified global name in Clang, and pass it
to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata
for some global, ASan will use the original algorithm.
This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264.
llvm-svn: 212872
|
| |
|
|
|
|
|
|
| |
llvm.asan.globals.
No functionality change.
llvm-svn: 212850
|
| |
|
|
|
|
| |
to be sunk - add them to the worklist
llvm-svn: 212847
|
| |
|
|
|
|
|
|
| |
This commit fixes bug http://llvm.org/bugs/show_bug.cgi?id=20103.
Thanks to Qwertyuiop for the report and the proposed fix.
llvm-svn: 212802
|
| |
|
|
|
|
| |
count by reducing calls to SE->forgetLoop
llvm-svn: 212782
|
| |
|
|
|
|
|
|
|
|
| |
Fix a crash in `InstCombiner::Descale()` when a multiply-by-zero gets
created as an argument to a GEP partway through an iteration, causing
-instcombine to optimize the GEP before the multiply.
rdar://problem/17615671
llvm-svn: 212742
|
| |
|
|
|
|
|
|
|
|
| |
This is the one remaining place I see where passing
isSafeToSpeculativelyExecute a DataLayout pointer might matter (at least for
loads) -- I think I got the others in r212720. Most of the other remaining
callers of isSafeToSpeculativelyExecute only use it for call sites (or
otherwise exclude loads).
llvm-svn: 212730
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
isSafeToSpeculativelyExecute can optionally take a DataLayout pointer. In the
past, this was mainly used to make better decisions regarding divisions known
not to trap, and so was not all that important for users concerned with "cheap"
instructions. However, now it also helps look through bitcasts for
dereferencable loads, and will also be important if/when we add a
dereferencable pointer attribute.
This is some initial work to feed a DataLayout pointer through to callers of
isSafeToSpeculativelyExecute, generally where one was already available.
llvm-svn: 212720
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
isDereferenceablePointer should not give up upon encountering any bitcast. If
we're casting from a pointer to a larger type to a pointer to a small type, we
can continue by examining the bitcast's operand. This missing capability
was noted in a comment in the function.
In order for this to work, isDereferenceablePointer now takes an optional
DataLayout pointer (essentially all callers already had such a pointer
available). Most code uses isDereferenceablePointer though
isSafeToSpeculativelyExecute (which already took an optional DataLayout
pointer), and to enable the LICM test case, LICM needs to actually provide its DL
pointer to isSafeToSpeculativelyExecute (which it was not doing previously).
llvm-svn: 212686
|
| |
|
|
| |
llvm-svn: 212668
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Turn llvm::SpecialCaseList into a simple class that parses text files in
a specified format and knows nothing about LLVM IR. Move this class into
LLVMSupport library. Implement two users of this class:
* DFSanABIList in DFSan instrumentation pass.
* SanitizerBlacklist in Clang CodeGen library.
The latter will be modified to use actual source-level information from frontend
(source file names) instead of unstable LLVM IR things (LLVM Module identifier).
Remove dependency edge from ClangCodeGen/ClangDriver to LLVMTransformUtils.
No functionality change.
llvm-svn: 212643
|
| |
|
|
|
|
|
|
|
|
|
|
| |
may trap)
In PR20059 ( http://llvm.org/pr20059 ), instcombine eliminates shuffles that are necessary before performing an operation that can trap (srem).
This patch calls isSafeToSpeculativelyExecute() and bails out of the optimization in SimplifyVectorOp() if needed.
Differential Revision: http://reviews.llvm.org/D4424
llvm-svn: 212629
|
| |
|
|
| |
llvm-svn: 212596
|
| |
|
|
|
|
|
|
|
|
| |
removing the value the initializer is referring to."
This reverts commit 5b55a47e94e28fbb56d0cd5d72c3db9105c15b4c.
A test case was found to crash after this was applied. I'll file a bug to track fixing this with the test case needed.
llvm-svn: 212550
|
| |
|
|
|
|
| |
Two of those are use after frees. Found by clang-tidy, fixed by me.
llvm-svn: 212537
|
| |
|
|
|
|
| |
fixed
llvm-svn: 212530
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All blacklisting logic is now moved to the frontend (Clang).
If a function (or source file it is in) is blacklisted, it doesn't
get sanitize_address attribute and is therefore not instrumented.
If a global variable (or source file it is in) is blacklisted, it is
reported to be blacklisted by the entry in llvm.asan.globals metadata,
and is not modified by the instrumentation.
The latter may lead to certain false positives - not all the globals
created by Clang are described in llvm.asan.globals metadata (e.g,
RTTI descriptors are not), so we may start reporting errors on them
even if "module" they appear in is blacklisted. We assume it's fine
to take such risk:
1) errors on these globals are rare and usually indicate wild memory access
2) we can lazily add descriptors for these globals into llvm.asan.globals
lazily.
llvm-svn: 212505
|
| |
|
|
| |
llvm-svn: 212503
|
| |
|
|
| |
llvm-svn: 212495
|
| |
|
|
|
|
|
|
|
|
| |
operation in a phi node that can trap.
This patch adds to an existing loop over phi nodes in SimplifyCondBranchToCondBranch() to check for trapping ops and bails out of the optimization if we find one of those.
The test cases verify that trapping ops are not hoisted and non-trapping ops are still optimized as expected.
llvm-svn: 212490
|
| |
|
|
| |
llvm-svn: 212460
|
| |
|
|
| |
llvm-svn: 212454
|
| |
|
|
| |
llvm-svn: 212449
|
| |
|
|
| |
llvm-svn: 212423
|
| |
|
|
| |
llvm-svn: 212405
|
| |
|
|
|
|
|
|
|
|
|
|
| |
the value the initializer is referring to.
This is useful for functions that are not actually available externally but
referenced by a vtable of some kind. Clang emits functions like this for the MS
ABI.
PR20182.
llvm-svn: 212337
|
| |
|
|
|
|
|
|
| |
can prove that it cannot overflow.
PR20194
llvm-svn: 212331
|
| |
|
|
|
|
|
|
|
|
|
| |
Exposes more constant globals that can be removed by
the global optimizer. A specific example is the removal
of the static global block address array in
clang/test/CodeGen/indirect-goto.c. This change impacts only
lower optimization levels. With LTO interprocedural
const prop runs already before global opt.
llvm-svn: 212284
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change all values passed through blacklisted functions
become fully initialized. Previous behavior was to initialize all
loads in blacklisted functions, but apply normal shadow propagation
logic for all other operation.
This makes blacklist applicable in a wider range of situations.
It also makes code for blacklisted functions a lot shorter, which
works as yet another workaround for PR17409.
llvm-svn: 212268
|
| |
|
|
| |
llvm-svn: 212266
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change all values passed through blacklisted functions
become fully initialized. Previous behavior was to initialize all
loads in blacklisted functions, but apply normal shadow propagation
logic for all other operation.
This makes blacklist applicable in a wider range of situations.
It also makes code for blacklisted functions a lot shorter, which
works as yet another workaround for PR17409.
llvm-svn: 212265
|
| |
|
|
| |
llvm-svn: 212259
|
| |
|
|
| |
llvm-svn: 212212
|
| |
|
|
|
|
|
| |
These don't need to be mutable and callers being added soon in CodeGen
won't have access to non-const Module&.
llvm-svn: 212202
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the
original feature request.
Introduce llvm.asan.globals metadata, which Clang (or any other frontend)
may use to report extra information about global variables to ASan
instrumentation pass in the backend. This metadata replaces
llvm.asan.dynamically_initialized_globals that was used to detect init-order
bugs. llvm.asan.globals contains the following data for each global:
1) source location (file/line/column info);
2) whether it is dynamically initialized;
3) whether it is blacklisted (shouldn't be instrumented).
Source location data is then emitted in the binary and can be picked up
by ASan runtime in case it needs to print error report involving some global.
For example:
0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40
These source locations are printed even if the binary doesn't have any
debug info.
This is an ABI-breaking change. ASan initialization is renamed to
__asan_init_v4(). Pre-built libraries compiled with older Clang will not work
with the fresh runtime.
llvm-svn: 212188
|
| |
|
|
|
|
|
| |
The result of x/INT_MIN is either 0 or 1, we can just use an icmp
instead.
llvm-svn: 212167
|
| |
|
|
|
|
|
|
|
| |
It is not safe to negate the smallest signed integer, doing so yields
the same number back.
This fixes PR20186.
llvm-svn: 212164
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch reduces the stack memory consumption of the InstCombine
function "isOnlyCopiedFromConstantGlobal() ", that in certain conditions
could overflow the stack because of excessive recursiveness.
For example, in a case like this:
%0 = alloca [50025 x i32], align 4
%1 = getelementptr inbounds [50025 x i32]* %0, i64 0, i64 0
store i32 0, i32* %1
%2 = getelementptr inbounds i32* %1, i64 1
store i32 1, i32* %2
%3 = getelementptr inbounds i32* %2, i64 1
store i32 2, i32* %3
%4 = getelementptr inbounds i32* %3, i64 1
store i32 3, i32* %4
%5 = getelementptr inbounds i32* %4, i64 1
store i32 4, i32* %5
%6 = getelementptr inbounds i32* %5, i64 1
store i32 5, i32* %6
...
This piece of code crashes llvm when trying to apply instcombine on
desktop. On embedded devices this could happen with a much lower limit
of recursiveness. Some instructions (getelementptr and bitcasts) make
the function recursively call itself on their uses, which is what makes
the example above consume so much stack (it becomes a recursive
depth-first tree visit with a very big depth).
The patch changes the algorithm to be semantically equivalent, but
iterative instead of recursive and the visiting order to be from a
depth-first visit to a breadth-first visit (visit all the instructions
of the current level before the ones of the next one).
Now if a lot of memory is required a heap allocation is done instead of
the the stack allocation, avoiding the possible crash.
Reviewed By: rnk
Differential Revision: http://reviews.llvm.org/D4355
Patch by Marcello Maggioni! We don't generally commit large stress test
that look for out of memory conditions, so I didn't request that one be
added to the patch.
llvm-svn: 212133
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Matching behavior with DeadArgumentElimination (and leveraging some
now-common infrastructure), keep track of the function from debug info
metadata if arguments are promoted.
This may produce interesting debug info - since the arguments may be
missing or of different types... but at least backtraces, inlining, etc,
will be correct.
llvm-svn: 212128
|
| |
|
|
|
|
|
|
|
| |
llvm::DISubprograms
Update DeadArgumentElimintation to use this, with the intent of reusing
the functionality for ArgumentPromotion as well.
llvm-svn: 212122
|
| |
|
|
|
|
|
|
|
| |
There were transforms whose *intent* was to downgrade the linkage of
external objects to have internal linkage.
However, it fired on things with private linkage as well.
llvm-svn: 212104
|
| |
|
|
|
|
|
| |
An alias with an aliasee of a non-zero GEP is not trivially replacable
with it's aliasee.
llvm-svn: 212079
|