1784 Commits

Author SHA1 Message Date
Fangrui Song
c466264b34 Use the container form llvm::sort(C, ...)
There are a few leftovers in rL343163 which span two lines. This commit
changes these llvm::sort(C.begin(), C.end, ...) to llvm::sort(C, ...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343426 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-30 22:31:29 +00:00
Vitaly Buka
05252670a6 [cxx2a] Fix warning triggered by r343285
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343369 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-29 02:17:12 +00:00
Evgeniy Stepanov
ad869f32bc [hwasan] Record and display stack history in stack-based reports.
Summary:
Display a list of recent stack frames (not a stack trace!) when
tag-mismatch is detected on a stack address.

The implementation uses alignment tricks to get both the address of
the history buffer, and the base address of the shadow with a single
8-byte load. See the comment in hwasan_thread_list.h for more
details.

Developed in collaboration with Kostya Serebryany.

Reviewers: kcc

Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342923 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-24 23:03:34 +00:00
Evgeniy Stepanov
36d0e5fce0 Revert "[hwasan] Record and display stack history in stack-based reports."
This reverts commit r342921: test failures on clang-cmake-arm* bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342922 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-24 22:50:32 +00:00
Evgeniy Stepanov
292ffb5d19 [hwasan] Record and display stack history in stack-based reports.
Summary:
Display a list of recent stack frames (not a stack trace!) when
tag-mismatch is detected on a stack address.

The implementation uses alignment tricks to get both the address of
the history buffer, and the base address of the shadow with a single
8-byte load. See the comment in hwasan_thread_list.h for more
details.

Developed in collaboration with Kostya Serebryany.

Reviewers: kcc

Subscribers: srhines, kubamracek, mgorny, hiraditya, jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342921 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-24 21:38:42 +00:00
Calixte Denizet
44db1d1e24 [IR] Add a boolean field in DILocation to know if a line must covered or not
Summary:
Some lines have a hit counter where they should not have one.
For example, in C++, some cleanup is adding at the end of a scope represented by a '}'.
So such a line has a hit counter where a user expects to not have one.
The goal of the patch is to add this information in DILocation which is used to get the covered lines in GCOVProfiling.cpp.
A following patch in clang will add this information when generating IR (https://reviews.llvm.org/D49916).

Reviewers: marco-c, davidxl, vsk, javed.absar, rnk

Reviewed By: rnk

Subscribers: eraman, xur, danielcdh, aprantl, rnk, dblaikie, #debug-info, vsk, llvm-commits, sylvestre.ledru

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342631 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 08:53:06 +00:00
Hiroshi Yamauchi
f65d102fee [PGO][CHR] Add opt remarks.
Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342495 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-18 16:50:10 +00:00
Matt Morehouse
52d9c5f7ba [SanitizerCoverage] Create comdat for global arrays.
Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342186 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-13 21:45:55 +00:00
Matt Morehouse
3c9c61a3ba Revert "[SanitizerCoverage] Create comdat for global arrays."
This reverts r341987 since it will cause trouble when there's a module
ID collision.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341995 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 21:15:41 +00:00
Matt Morehouse
f3ceb83cbc [SanitizerCoverage] Create comdat for global arrays.
Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341987 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 20:10:40 +00:00
Vedant Kumar
ae4bd95c1e [gcov] Fix branch counters with switch statements (fix PR38821)
Right now, the counters are added in regards of the number of successors
for a given BasicBlock: it's good when we've only 1 or 2 successors (at
least with BranchInstr). But in the case of a switch statement, the
BasicBlock after switch has several predecessors and we need know from
which BB we're coming from.

So the idea is to revert what we're doing: add a PHINode in each block
which will select the counter according to the incoming BB.  They're
several pros for doing that:

- we fix the "switch" bug
- we remove the function call to "__llvm_gcov_indirect_counter_increment"
  and the lookup table stuff
- we replace by PHINodes, so the optimizer will probably makes a better
  job.

Patch by calixte!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341977 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 18:38:34 +00:00
Matt Morehouse
6c62511795 Revert "[SanitizerCoverage] Create comdat for global arrays."
This reverts r341951 due to bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341965 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 17:20:14 +00:00
Matt Morehouse
18dd74a3d2 [SanitizerCoverage] Create comdat for global arrays.
Summary:
Place global arrays in comdat sections with their associated functions.
This makes sure they are stripped along with the functions they
reference, even on the BFD linker.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: eraman, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341951 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-11 15:23:14 +00:00
Fangrui Song
33d40b3195 [PGO] Fix some style issue of ControlHeightReduction
Reviewers: yamauchi

Reviewed By: yamauchi

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341702 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 20:23:15 +00:00
Hiroshi Yamauchi
96a04e655c [PGO][CHR] Build/warning fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341692 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 18:44:53 +00:00
Hiroshi Yamauchi
66f1f168e0 [PGO][CHR] Small cleanup.
Summary:
Do away with demangling. It wasn't really necessary.
Declared some local functions to be static.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341681 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 18:00:58 +00:00
Alexander Potapenko
0e364e1356 [MSan] don't access MsanCtorFunction when using KMSAN
MSan has found a use of uninitialized memory in MSan, fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341646 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 09:56:36 +00:00
Alexander Potapenko
f774071018 [MSan] Add KMSAN instrumentation to MSan pass
Introduce the -msan-kernel flag, which enables the kernel instrumentation.

The main differences between KMSAN and MSan instrumentations are:

- KMSAN implies msan-track-origins=2, msan-keep-going=true;
- there're no explicit accesses to shadow and origin memory.
  Shadow and origin values for a particular X-byte memory location are
  read and written via pointers returned by
  __msan_metadata_ptr_for_load_X(u8 *addr) and
  __msan_store_shadow_origin_X(u8 *addr, uptr shadow, uptr origin);
- TLS variables are stored in a single struct in per-task storage. A call
  to a function returning that struct is inserted into every instrumented
  function before the entry block;
- __msan_warning() takes a 32-bit origin parameter;
- local variables are poisoned with __msan_poison_alloca() upon function
  entry and unpoisoned with __msan_unpoison_alloca() before leaving the
  function;
- the pass doesn't declare any global variables or add global constructors
  to the translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341637 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 09:10:30 +00:00
Alexander Potapenko
066246b993 [MSan] store origins for variadic function parameters in __msan_va_arg_origin_tls
Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters.
Change the instrumentation pass to store parameter origins in this array.

This is a reland of r341528.

test/msan/vararg.cc doesn't work on Mips, PPC and AArch64 (because this
patch doesn't touch them), XFAIL these arches.
Also turned out Clang crashed on i80 vararg arguments because of
incorrect origin type returned by getOriginPtrForVAArgument() - fixed it
and added a test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341554 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 15:14:36 +00:00
Alexander Potapenko
7b6a2c6037 [MSan] revert r341528 to unbreak the bots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341541 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 12:19:27 +00:00
Alexander Potapenko
a044b58ab1 [MSan] store origins for variadic function parameters in __msan_va_arg_origin_tls
Add the __msan_va_arg_origin_tls TLS array to keep the origins for
variadic function parameters.
Change the instrumentation pass to store parameter origins in this array.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341528 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 08:50:11 +00:00
Alexander Potapenko
ac23fcdc32 [MSan] Make sure variadic function arguments do not overflow __msan_va_arg_tls
Turns out that calling a variadic function with too many (e.g. >100 i64's)
arguments overflows __msan_va_arg_tls, which leads to smashing other TLS
data with function argument shadow values.

getShadow() already checks for kParamTLSSize and returns clean shadow if
the argument does not fit, so just skip storing argument shadow for such
arguments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341525 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-06 08:21:54 +00:00
Benjamin Kramer
559403cc05 [ControlHeightReduction] Remove unused includes
Also clang-format them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341468 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 13:51:05 +00:00
Richard Trieu
8ca386371e Prevent unsigned overflow.
The sum of the weights is caculated in an APInt, which has a width smaller than
64.  In certain cases, the sum of the widths would overflow when calculations
are done inside an APInt, but would not if done with uint64_t.  Since the
values will be passed as uint64_t in the function call anyways, do all the math
in 64 bits.  Also added an assert in case the probabilities overflow 64 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341444 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 04:19:15 +00:00
Fangrui Song
ea500dcb7b Fix -Wunused-function in release build after rL341386
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341443 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-05 03:10:20 +00:00
Hiroshi Yamauchi
66ded417a2 Fix a memory leak after rL341386.
Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341412 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 21:28:22 +00:00
Reid Kleckner
801cfc82da Fix unused variable warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341400 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 20:34:47 +00:00
Hiroshi Yamauchi
012ff47f2f Fix build failures after rL341386.
Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341391 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 18:10:54 +00:00
Hiroshi Yamauchi
c38c85037d [PGO] Control Height Reduction
Summary:
Control height reduction merges conditional blocks of code and reduces the
number of conditional branches in the hot path based on profiles.

if (hot_cond1) { // Likely true.
  do_stg_hot1();
}
if (hot_cond2) { // Likely true.
  do_stg_hot2();
}

->

if (hot_cond1 && hot_cond2) { // Hot path.
  do_stg_hot1();
  do_stg_hot2();
} else { // Cold path.
  if (hot_cond1) {
    do_stg_hot1();
  }
  if (hot_cond2) {
    do_stg_hot2();
  }
}

This speeds up some internal benchmarks up to ~30%.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: xbolva00, dmgreen, mehdi_amini, llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341386 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-04 17:19:13 +00:00
Matt Morehouse
3898022b16 [libFuzzer] Port to Windows
Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Patch By: metzman

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341082 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30 15:54:44 +00:00
Matt Morehouse
e368b7aabb Revert "[libFuzzer] Port to Windows"
This reverts r340949 due to bot breakage again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340954 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 18:40:41 +00:00
Matt Morehouse
1f742a3c1b [libFuzzer] Port to Windows
Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340949 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-29 18:08:34 +00:00
Matt Morehouse
0ac1dae46c Revert "[libFuzzer] Port to Windows"
This reverts commit r340860 due to failing tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340867 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 19:07:24 +00:00
Matt Morehouse
0fbff7fa99 [libFuzzer] Port to Windows
Summary:
Port libFuzzer to windows-msvc.
This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.

Patch By: metzman

Reviewers: morehouse, rnk

Reviewed By: morehouse, rnk

Subscribers: morehouse, kcc, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340860 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-28 18:34:32 +00:00
Chandler Carruth
9179aee2c1 [IR] Replace isa<TerminatorInst> with isTerminator().
This is a bit awkward in a handful of places where we didn't even have
an instruction and now we have to see if we can build one. But on the
whole, this seems like a win and at worst a reasonable cost for removing
`TerminatorInst`.

All of this is part of the removal of `TerminatorInst` from the
`Instruction` type hierarchy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340701 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-26 09:51:22 +00:00
Xinliang David Li
e50e52860b [PGO] add target md5sum in warning message for icall
Differential revision: http://reviews.llvm.org/D51193


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340657 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-24 21:38:24 +00:00
Alexander Richardson
47ff67b78d Allow creating llvm::Function in non-zero address spaces
Most users won't have to worry about this as all of the
'getOrInsertFunction' functions on Module will default to the program
address space.

An overload has been added to Function::Create to abstract away the
details for most callers.

This is based on https://reviews.llvm.org/D37054 but without the changes to
make passing a Module to Function::Create() mandatory. I have also added
some more tests and fixed the LLParser to accept call instructions for
types in the program address space.

Reviewed By: bjope

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340519 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-23 09:25:17 +00:00
Reid Kleckner
6d691845e4 Re-land r334313 "[asan] Instrument comdat globals on COFF targets"
If we can use comdats, then we can make it so that the global metadata
is thrown away if the prevailing definition of the global was
uninstrumented. I have only tested this on COFF targets, but in theory,
there is no reason that we cannot also do this for ELF.

This will allow us to re-enable string merging with ASan on Windows,
reducing the binary size cost of ASan on Windows.

I tested this change with ASan+PGO, and I fixed an issue with the
__llvm_profile_raw_version symbol. With the old version of my patch, we
would attempt to instrument that symbol on ELF because it had a comdat
with external linkage. If we had been using the linker GC-friendly
metadata scheme, everything would have worked, but clang does not enable
it by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340232 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-20 23:35:45 +00:00
Vedant Kumar
41bee7d478 [InstrProf] Use atomic profile counter updates for TSan
Thread sanitizer instrumentation fails to skip all loads and stores to
profile counters. This can happen if profile counter updates are merged:

  %.sink = phi i64* ...
  %pgocount5 = load i64, i64* %.sink
  %27 = add i64 %pgocount5, 1
  %28 = bitcast i64* %.sink to i8*
  call void @__tsan_write8(i8* %28)
  store i64 %27, i64* %.sink

To suppress TSan diagnostics about racy counter updates, make the
counter updates atomic when TSan is enabled. If there's general interest
in this mode it can be surfaced as a clang/swift driver option.

Testing: check-{llvm,clang,profile}

rdar://40477803

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339955 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 22:24:47 +00:00
Evgeniy Stepanov
6203c9bd08 [hwasan] Add a basic API.
Summary:
Add user tag manipulation functions:
  __hwasan_tag_memory
  __hwasan_tag_pointer
  __hwasan_print_shadow (very simple and ugly, for now)

Reviewers: vitalybuka, kcc

Subscribers: kubamracek, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339746 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-15 00:39:35 +00:00
Matt Morehouse
4db82cd15b [SanitizerCoverage] Add associated metadata to PC guards.
Summary:
Without this metadata LLD strips unused PC table entries
but won't strip unused guards.  This metadata also seems
to influence the linker to change the ordering in the PC
guard section to match that of the PC table section.

The libFuzzer runtime library depends on the ordering
of the PC table and PC guard sections being the same.  This
is not generally guaranteed, so we may need to redesign
PC tables/guards/counters in the future.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: kcc, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339733 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-14 22:04:34 +00:00
Evgeniy Stepanov
9f42ecf77b [hwasan] Add -hwasan-with-ifunc flag.
Summary: Similar to asan's flag, it can be used to disable the use of ifunc to access hwasan shadow address.

Reviewers: vitalybuka, kcc

Subscribers: srhines, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339447 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-10 16:21:37 +00:00
Alexander Potapenko
252445ebb1 [MSan] Shrink the register save area for non-SSE builds
If code is compiled for X86 without SSE support, the register save area
doesn't contain FPU registers, so `AMD64FpEndOffset` should be equal to
`AMD64GpEndOffset`.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339414 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-10 08:06:43 +00:00
Joel Galenson
1a17324d81 Fix crash in bounds checking.
In r337830 I added SCEV checks to enable us to insert fewer bounds checks.  Unfortunately, this sometimes crashes when multiple bounds checks are added due to SCEV caching issues.  This patch splits the bounds checking pass into two phases, one that computes all the conditions (using SCEV checks) and the other that adds the new instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338902 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-03 17:12:23 +00:00
John Baldwin
0318cbc235 [ASAN] Use the correct shadow offset for ASAN on FreeBSD/mips64.
Reviewed By: atanasyan

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338650 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-01 22:51:13 +00:00
Fangrui Song
af7b1832a0 Remove trailing space
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338293 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 19:41:25 +00:00
Reid Kleckner
b6a0f6b8e0 [InstrProf] Don't register __llvm_profile_runtime_user
Refactor some FileCheck prefixes while I'm at it.

Fixes PR38340

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338172 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-27 22:21:35 +00:00
Petr Hosek
bce5b55ff3 [profile] Support profiling runtime on Fuchsia
This ports the profiling runtime on Fuchsia and enables the
instrumentation. Unlike on other platforms, Fuchsia doesn't use
files to dump the instrumentation data since on Fuchsia, filesystem
may not be accessible to the instrumented process. We instead use
the data sink to pass the profiling data to the system the same
sanitizer runtimes do.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337881 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-25 03:01:35 +00:00
Joel Galenson
cef24f0d3b Use SCEV to avoid inserting some bounds checks.
This patch uses SCEV to avoid inserting some bounds checks when they are not needed.  This slightly improves the performance of code compiled with the bounds check sanitizer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337830 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-24 15:21:54 +00:00
Alexander Potapenko
86a77cda68 [MSan] Hotfix compilation
Make sure NewSI is used in materializeStores()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337577 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 16:52:12 +00:00