Commit Graph

306509 Commits

Author SHA1 Message Date
Nemanja Ivanovic 3c7ac649ec [PowerPC] Fix CR Bit spill pseudo expansion
The current CRBIT spill pseudo-op expansion creates a KILL instruction
that kills the CRBIT and defines the enclosing CR field. However, this
paints a false picture to the register allocator that all bits in the CR
field are killed so copies of other bits out of the field become dead and
removable.
This changes the expansion to preserve the KILL flag on the CRBIT as an
implicit use and to treat the CR field as an undef input.

Thanks to Hal Finkel for the review and Uli Weigand for implementation input.

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

llvm-svn: 350153
2018-12-29 11:43:54 +00:00
Simon Atanasyan a6424e7c4e [mips] Show an error on attempt to use 64-bit PC-relative relocation
The following code requests 64-bit PC-relative relocations unsupported
by MIPS ABI. Now it triggers an assertion. It's better to show an error
message.
```
foo:
  .quad bar - foo
```

llvm-svn: 350152
2018-12-29 10:10:02 +00:00
Simon Atanasyan b243d8d42a [mips] Show a regular error message on attempt to use one byte relocation
llvm-svn: 350151
2018-12-29 10:09:55 +00:00
Craig Topper 7bb1d50455 [X86] Add test case from PR38217. NFC
llvm-svn: 350150
2018-12-29 07:14:30 +00:00
Davide Italiano db057e7792 [RegisterValue] Rewrite operator!= in terms of operator==. NFCI.
llvm-svn: 350149
2018-12-29 05:05:23 +00:00
Davide Italiano 223032f72e [CompilerType] Simplify operator!=. NFCI.
llvm-svn: 350148
2018-12-29 05:00:33 +00:00
Davide Italiano e70af020f4 [CompilerType] Remove dead code. NFCI.
llvm-svn: 350147
2018-12-29 04:59:07 +00:00
Davide Italiano d22327080c [SymbolContext] Rewrite operator== to be more concise.
And probably, less error prone. NFCI.

llvm-svn: 350146
2018-12-29 04:57:00 +00:00
Max Kazantsev 201534d753 Drop SE cache early because loop parent can change in LoopSimplifyCFG
llvm-svn: 350145
2018-12-29 04:26:22 +00:00
Heejin Ahn 4d98dfb67d [WebAssembly] Fix comments in ExplicitLocals (NFC)
llvm-svn: 350144
2018-12-29 02:42:04 +00:00
Richard Trieu b3e902f4c3 Add vtable anchor to classes.
llvm-svn: 350143
2018-12-29 02:02:30 +00:00
Richard Trieu a87b70d1db Add vtable anchor to classes.
llvm-svn: 350142
2018-12-29 02:02:13 +00:00
Craig Topper 0a6cec6f9f [X86] Don't mark SEXTLOAD v4i8->v4i64 and v8i8->v8i64 as custom under vector widening legalization.
This was tricking us into making these operations and then letting them get scalarized later. But I can't prove that the scalarized version is actually better.

llvm-svn: 350141
2018-12-29 01:17:11 +00:00
Kamil Rytarowski 48615c1786 Reenable hard_rss_limit_mb_test.cc for android-26
Noted by eugenis@ in D55887.

llvm-svn: 350140
2018-12-29 00:35:49 +00:00
Kamil Rytarowski 646c130a18 Add support for background thread on NetBSD in ASan
Summary:
Change the point of calling MaybeStartBackgroudThread() from AsanInitInternal()
that is too early on NetBSD to a constructor (with aid of C++11 lambda construct).

Enable the code for background thread as is for NetBSD.

Rename test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc
to test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc and allow runs
on NetBSD. This tests passes correctly.

Reviewers: vitalybuka, joerg, eugenis

Reviewed By: eugenis

Subscribers: eugenis, kubamracek, fedor.sergeev, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 350139
2018-12-29 00:32:07 +00:00
David Carlier adb5f1e3b5 [Sanitizer] Enable getfsent api for Darwin
Reviewers: vitalybuka, kubamracek

Reviewed By: vitalybuka

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

llvm-svn: 350138
2018-12-29 00:17:21 +00:00
Alexey Bataev d1cd005ec5 [OPENMP][NVPTX]Added/fixed debugging messages, NFC.
Summary: Added or fixed new/old debugging messages for the better diagnostics.

Reviewers: gtbercea, kkwli0, grokos

Reviewed By: grokos

Subscribers: caomhin, guansong, openmp-commits

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

llvm-svn: 350137
2018-12-28 21:36:09 +00:00
Dan Liew 8c11fb3ed4 Introduce `LocalAddressSpaceView::LoadWritable(...)` and make the `Load(...)` method return a const pointer.
Summary:
This is a follow-up to r346956 (https://reviews.llvm.org/D53975).

The purpose of this change to allow implementers of the
`AddressSpaceView` to be able to distinguish between when a caller wants
read-only memory and when a caller wants writable memory. Being able
distinguish these cases allows implementations to optimize for the
different cases and also provides a way to workaround possible platform
restrictions (e.g. the low level platform interface for reading
out-of-process memory may place memory in read-only pages).

For allocator enumeration in almost all cases read-only is sufficient so
we make `Load(...)` take on this new requirement and introduce the
`LoadWritable(...)` variants for cases where memory needs to be
writable.

The behaviour of `LoadWritable(...)` documented in comments are
deliberately very restrictive so that it will be possible in the future
to implement a simple write-cache (i.e. just a map from target address
to a writable region of memory). These restrictions can be loosened in
the future if necessary by implementing a more sophisticated
write-cache.

rdar://problem/45284065

Reviewers: kcc, cryptoad, eugenis, kubamracek, george.karpenkov

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 350136
2018-12-28 19:30:51 +00:00
Anna Thomas bae11e7999 [UnrollRuntime] NFC: Updated exiting tests and added more tests
Added more tests for multiple exiting blocks to the LatchExit.
Today these cases are not supported. Patch to follow soon.

llvm-svn: 350135
2018-12-28 19:21:50 +00:00
Craig Topper f814d28eb3 [X86] Directly emit X86ISD::PMULUDQ from the ReplaceNodeResults handling of v2i8/v2i16/v2i32 multiply.
Previously we emitted a multiply and some masking that was supposed to matched to PMULUDQ, but the masking could sometimes be removed before we got a chance to match it. So instead just emit the PMULUDQ directly.

Remove the DAG combine that was added when the ReplaceNodeResults code was originally added. Add a new DAG combine to avoid regressions in shrink_vmul.ll

Some of the shrink_vmul.ll test cases now pick PMULUDQ instead of PMADDWD/PMULLD, but I think this should be an improvement on most CPUs.

I think all of this can go away if/when we switch to -x86-experimental-vector-widening-legalization

llvm-svn: 350134
2018-12-28 19:19:39 +00:00
Hyrum Wright 4ce05801c7 [clang-tidy] Export the abseil duration inverse lookup function, NFC
This allows other tools to use this function.

llvm-svn: 350133
2018-12-28 19:04:21 +00:00
Reid Kleckner 1c6dbd6921 Speculative fix for xray assembler error on MachO since r349976
This .file directive wasn't doing anything on MachO, and now that's
diagnosed as an error.

llvm-svn: 350132
2018-12-28 18:53:00 +00:00
Anna Thomas 98743fa77a [UnrollRuntime] NFC: Add comment and verify LCSSA
Added -verify-loop-lcssa to test cases.
Updated comments in ConnectProlog.

llvm-svn: 350131
2018-12-28 18:52:16 +00:00
David Chisnall 386477a541 [objc-gnustep2] Fix a bug in category generation.
We were not emitting a protocol definition while generating the category
method list.  This was fine in most cases, because something else in the
library typically referenced any given protocol, but it caused linker
failures if the category was the only reference to a given protocol.

llvm-svn: 350130
2018-12-28 17:44:54 +00:00
Alexey Bataev 28eccf5ba0 [OPENMP][NVPTX]Fixed initialization of the data-sharing interface.
Summary:
Avoid using of the atomic loop to wait for the completion of the
data-sharing interface initialization, use __shfl_sync instead for the
communication within the warp to signal other threads in the warp about
completion of the initialization.

Reviewers: gtbercea, kkwli0, grokos

Subscribers: guansong, jfb, caomhin, openmp-commits

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

llvm-svn: 350129
2018-12-28 17:31:06 +00:00
Alexey Bataev 1708858dbd [OPENMP][NVPTX]Outline assert into noinline function, NFC.
Summary:
At high optimization level asserts lead to some unexpected results
because of auto-inserted unreachable instructions. This outlining
prevents some of such dangerous optimizations and leads to better
stability.

Reviewers: gtbercea, kkwli0, grokos

Subscribers: guansong, caomhin, openmp-commits

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

llvm-svn: 350128
2018-12-28 17:29:47 +00:00
Alexey Bataev db43f0696e [OPENMP]Fix processing of the clauses on target combined directives.
For constants with the predefined data-sharing clauses we may had
troubles with the target combined directives. It may cause compiler
crash in some corner cases.

llvm-svn: 350127
2018-12-28 17:27:32 +00:00
Diogo N. Sampaio 9123f82cc4 [AArch64] Add command-line option for SB
SB (Speculative Barrier) is only mandatory from 8.5
onwards but is optional from Armv8.0-A. This patch adds a command
line option to enable SB, as it was previously only possible to
enable by selecting -march=armv8.5-a.

This patch also moves to FeatureSB the old FeatureSpecRestrict.

Reviewers: pbarrio, olista01, t.p.northover, LukeCheeseman	

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

llvm-svn: 350126
2018-12-28 17:14:58 +00:00
Aleksandr Urakov d5b685a9b2 [CodeView] Extend the `MemberAttributes` interface with the `isStatic` method
Summary:
This patch extends the MemberAttributes interface with the isStatic method.
It is needed for D56126.

Reviewers: zturner, rnk

Reviewed By: zturner

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

llvm-svn: 350125
2018-12-28 17:03:24 +00:00
David Carlier d1ca603770 [Sanitizer] arc4random unit test missing case.
llvm-svn: 350124
2018-12-28 16:36:05 +00:00
David Carlier f11fcc046e [Sanitizer] Intercept arc4random_buf / arc4random_addrandom on FreeBSD/NetBSD
- Disabled on purpose on Android and Darwin platform (for now).
- Darwin supports it, would need interception in its specific code before enabling it.
- Linux does not support it but only via third party library.
- Android supports it via bionic however it is known to have issue with older versions of the implementations. Can be enabled by an Android committer later on if necessary once there is more 'certainity'/been more tested.

Reviewers: krytarowski, vitalybuka

Reviewed By: krytarowski

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

llvm-svn: 350123
2018-12-28 16:04:28 +00:00
Pavel Labath 2da15e4dc8 Fix signed-unsigned comparisons in MinidumpParserTest
llvm-svn: 350122
2018-12-28 13:34:50 +00:00
Pavel Labath ffec31e462 Remove unused variable from ClangASTContext
llvm-svn: 350121
2018-12-28 13:34:44 +00:00
Dmitry Preobrazhensky ddac5c9ba5 [AMDGPU][MC][DOC] Updated AMD GPU assembler description.
Minor bugfixing and improvements.

See bug 36572: https://bugs.llvm.org/show_bug.cgi?id=36572

llvm-svn: 350120
2018-12-28 11:48:23 +00:00
Max Kazantsev 8f70c9bf49 [NFC] Add failing test on LCSSA form preservation of LoopSimplifyCFG
llvm-svn: 350119
2018-12-28 10:43:37 +00:00
Hiroshi Inoue 1ea98f040e [PowerPC] handle ISD:TRUNCATE in BitPermutationSelector
This is the last one in a series of patches to support better code generation for bitfield insert.
BitPermutationSelector already support ISD::ZERO_EXTEND but not TRUNCATE.
This patch adds support for ISD:TRUNCATE in BitPermutationSelector.

For example of this test case, 
struct s64b {
  int a:4;
  int b:16;
  int c:24;
};
void bitfieldinsert64b(struct s64b *p, unsigned char v) {
  p->b = v;
}

the selection DAG loos like:

t14: i32,ch = load<(load 4 from %ir.0)> t0, t2, undef:i64
       t18: i32 = and t14, Constant:i32<-1048561>
            t4: i64,ch = CopyFromReg t0, Register:i64 %1
          t22: i64 = AssertZext t4, ValueType:ch:i8
        t23: i32 = truncate t22
      t16: i32 = shl nuw nsw t23, Constant:i32<4>
    t19: i32 = or t18, t16
  t20: ch = store<(store 4 into %ir.0)> t14:1, t19, t2, undef:i64

By handling truncate in the BitPermutationSelector, we can use information from AssertZext when selecting t19 and skip the mask operation corresponding to t18.
So the generated sequences with and without this patch are

without this patch
	rlwinm 5, 5, 0, 28, 11 # corresponding to t18
	rlwimi 5, 4, 4, 20, 27
with this patch
	rlwimi 5, 4, 4, 12, 27

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

llvm-svn: 350118
2018-12-28 08:00:39 +00:00
Max Kazantsev 530ff8f3cc Temporarily disable term folding in LoopSimplifyCFG, add tests
llvm-svn: 350117
2018-12-28 06:22:39 +00:00
Max Kazantsev 80e4b40f3e [LoopSimplifyCFG] Delete dead blocks in RPO
Deletion of dead blocks in arbitrary order may lead to failure
of assertion in `DeleteDeadBlock` that requires that we have
deleted all predecessors before we can delete the current block.
We should instead delete them in RPO order.

llvm-svn: 350116
2018-12-28 06:08:51 +00:00
QingShan Zhang f2d9df61c7 [PowerPC] Remove the implicit use of the register if it is replaced by Imm
If we are changing the MI operand from Reg to Imm, we need also handle its implicit use if have.

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

llvm-svn: 350115
2018-12-28 03:38:09 +00:00
Zi Xuan Wu 5187444345 [NFC] clang-format functions related to r350113
llvm-svn: 350114
2018-12-28 02:45:17 +00:00
Zi Xuan Wu a02a3feecf [PowerPC] Fix assert from machine verify pass that atomic pseudo expanding causes mismatched register class
For atomic value operand which less than 4 bytes need to be masked. 
And the related operation to calculate the newvalue can be done in 32 bit gprc. 
So just use gprc for mask and value calculation.

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

llvm-svn: 350113
2018-12-28 02:12:55 +00:00
Evgeniy Stepanov 3408b497f9 Revert "[asan] Support running without /proc.", +1
Revert r350104 "[asan] Fix build on windows."
Revert r350101 "[asan] Support running without /proc."

These changes break Mac build, too.

llvm-svn: 350112
2018-12-28 01:27:18 +00:00
Chen Zheng 5ede950df9 [PowerPC] fix register class after converting X-FORM instruction to D-FORM instruction
Differential Revision: https://reviews.llvm.org/D55806

llvm-svn: 350111
2018-12-28 01:02:35 +00:00
Kamil Rytarowski 10828c39cb Fix a mistake in previous
Assign correct ioctl(2) operation number.

llvm-svn: 350110
2018-12-28 00:17:37 +00:00
Chandler Carruth 05b5bd8b85 [CallSite removal] Add and flesh out APIs on the new `CallBase` base class that previously were only available on the `CallSite` wrapper.
Summary:
This will make migrating code easier and generally seems like a good collection
of API improvements.

Some of these APIs seem like more consistent / better naming of existing
ones. I've retained the old names for migration simplicit and am just
adding the new ones in this commit. I'll try to garbage collect these
once CallSite is gone.

Subscribers: sanjoy, mcrosier, hiraditya, llvm-commits

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

llvm-svn: 350109
2018-12-27 23:40:17 +00:00
Nico Weber c38717ff84 [gn build] Add check-clang target and make it work
With this, check-clang runs and passes all of clang's lit tests. It doesn't run
any of its unit tests yet.

Like with check-lld, running just ninja -C out/gn will build all prerequisites
needed to run tests, but it won't run the tests (so that the build becomes
clean after one build). Running ninja -C out/gn check-clang will build
prerequisites if needed and run the tests. The check-clang target never becomes
clean and runs tests every time.

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

llvm-svn: 350108
2018-12-27 23:38:58 +00:00
Kamil Rytarowski 8e56064542 Update NetBSD ioctl(2) entries with 8.99.28
Add SIOCSETHERCAP.

Add commented out NVMM (NetBSD Virtual Machine Monitor) operations
as this interface is still WIP and a subject to change.

llvm-svn: 350107
2018-12-27 23:35:28 +00:00
Kamil Rytarowski 636269526d Enable asan_and_llvm_coverage_test.cc for NetBSD
LLVM profile is now enabled for this target.

llvm-svn: 350106
2018-12-27 22:55:13 +00:00
Fangrui Song 50394f6e01 [ELF] A shared object is needed if any of its occurrences is needed
Summary:
If a DSO appears more than once with and without --as-needed, ld.bfd and gold consider --no-as-needed to takes precedence over --as-needed. lld didn't and this patch makes it do so.

This makes it a bit away from the position-dependent behavior (how
different occurrences of the same DSO interact) and protects us from
some mysterious runtime errors: if some interceptor libraries add their
own --no-as-needed dependencies (e.g. librt.so), and the user
application specifies -Wl,--as-needed -lrt , the absence of the
DT_NEEDED entry would make dlsym(RTLD_NEXT, "clock_gettime") return NULL
and would break at runtime.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 350105
2018-12-27 22:24:45 +00:00
Evgeniy Stepanov 1ce7fccbc9 [asan] Fix build on windows.
Reviewers: vitalybuka

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 350104
2018-12-27 22:16:28 +00:00