Commit Graph

314207 Commits

Author SHA1 Message Date
Eric Christopher 06bfe353fe Move a couple of optional references to just optional to make the
forwarding APIs look similar.

llvm-svn: 358250
2019-04-12 03:49:13 +00:00
Fangrui Song 35861f216b [IRMemoryMap] Fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=off build
llvm-svn: 358249
2019-04-12 02:38:17 +00:00
Fangrui Song abc068fc59 [ELF] Fix typo: .symtab_shndxr -> .symtab_shndx
The typo was introduced to llvm MC in rL204769 (fixed in rL358247) and then to lld.

Also, for relocatable-many-sections.s, the size of .symtab changed at some point and the formula needs update.

llvm-svn: 358248
2019-04-12 02:20:52 +00:00
Fangrui Song 88838d5be7 [MC] Fix typo: .symtab_shndxr -> .symtab_shndx
This special section is named .symtab_shndx, according to gABI Chapter 4
Sections, and the name is used by some other tools. Though the section
type SHT_SYMTAB_SHNDX is what really matters, let's fix the typo
introduced in rL204769 :)

llvm-svn: 358247
2019-04-12 02:16:15 +00:00
Fangrui Song cecc435250 Use llvm::lower_bound. NFC
This reapplies rL358161. That commit inadvertently reverted an exegesis file to an old version.

llvm-svn: 358246
2019-04-12 02:02:06 +00:00
Brad Smith 21375ca136 Enable frame pointer elimination for OpenBSD on x86 and mips64.
llvm-svn: 358245
2019-04-12 01:29:18 +00:00
Eric Christopher 492cad51a4 Remove a parameter that was being passed around that we had at the
local callsite.

NFC.

llvm-svn: 358244
2019-04-12 01:02:02 +00:00
JF Bastien ef202c308b Variable auto-init: also auto-init alloca
Summary:
alloca isn’t auto-init’d right now because it’s a different path in clang that
all the other stuff we support (it’s a builtin, not an expression).
Interestingly, alloca doesn’t have a type (as opposed to even VLA) so we can
really only initialize it with memset.

<rdar://problem/49794007>

Subscribers: jkorous, dexonsmith, cfe-commits, rjmccall, glider, kees, kcc, pcc

Tags: #clang

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

llvm-svn: 358243
2019-04-12 00:11:27 +00:00
Nico Weber ef035186db llvm-undname: Use UNREACHABLE after exhaustive switch returning everywhere
No behavior change.

llvm-svn: 358241
2019-04-11 23:23:00 +00:00
Nico Weber af2ee7d0de llvm-undname: Name a bool param, no behavior change
llvm-svn: 358240
2019-04-11 23:20:18 +00:00
Nico Weber 03db625c13 llvm-undname: Fix out-of-bounds read on invalid intrinsic function code
Found by inspection.

llvm-svn: 358239
2019-04-11 23:11:33 +00:00
Nico Weber e5b62654a5 llvm-undname: Don't crash on incomplete enum tag manglings
Found by inspection.

llvm-svn: 358238
2019-04-11 22:59:25 +00:00
Nico Weber b4f33bbbb0 llvm-undname: Fix crash on incomplete virtual this adjusts
Found by oss-fuzz.

Also remove an else-after-return, this part has no behavior change.

llvm-svn: 358237
2019-04-11 22:47:18 +00:00
Nick Desaulniers 8ec304c9fd [X86AsmPrinter] refactor static functions into private methods. NFC
Summary:
A lot of the code for printing special cases of operands in this
translation unit are static functions. While I too have suffered many
years of abuse at the hands of C, we should prefer private methods,
particularly when you start passing around *this as your first argument,
which is a code smell.

This will help make generic vs arch specific asm printing easier, as it
brings X86AsmPrinter more in line with other arch's derived AsmPrinters.
We will then be able to more easily move architecture generic code to
the base class, and architecture specific code to the derived classes.

Some other small refactorings while we're here:
- the parameter Op is now consistently OpNo
- add spaces around binary expressions. I know we're not millionaires
  but c'mon.

Reviewers: echristo

Reviewed By: echristo

Subscribers: smeenai, hiraditya, llvm-commits, srhines, craig.topper

Tags: #llvm

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

llvm-svn: 358236
2019-04-11 22:47:13 +00:00
Julian Lettner 2edfcf9065 [TSan][libdispatch] Delete old tests
In a previous commit, I re-enabled the ported variants of these 2 tests:
tsan/Darwin/gcd-data.mm -> tsan/libdispatch/data.c
tsan/Darwin/gcd-source-serial.mm -> tsan/libdispatch/source-serial.c

So now we can delete the Darwin-only version.

llvm-svn: 358235
2019-04-11 22:27:57 +00:00
Nico Weber f2d8f09d5d llvm-undname: Fix crash on invalid name in a template parameter pointer to member arg
Found by oss-fuzz.

llvm-svn: 358234
2019-04-11 22:23:35 +00:00
Brendon Cahoon 57c3d4bed3 [Pipeliner] Fix incorrect loop carried dependence calculation
The isLoopCarriedDep function does not correctly compute loop
carried dependences when the array index offset is negative
or the stride is smallar than the access size.

Patch by Denis Antrushin.

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

llvm-svn: 358233
2019-04-11 21:57:51 +00:00
Nico Weber 20118355aa Revert r357610, it caused PR41471
llvm-svn: 358232
2019-04-11 21:26:34 +00:00
Richard Smith 8af8b8611c [C++20] Implement context-sensitive header-name lexing and pp-import parsing in the preprocessor.
llvm-svn: 358231
2019-04-11 21:18:23 +00:00
Richard Smith 75f9681874 Remove use of lookahead from _Pragma handling and from all other
internal lexing steps in the preprocessor.

It is not safe to use the preprocessor's token lookahead except when
operating on the final sequence of tokens that would be produced by
phase 4 of translation. Doing so corrupts the token lookahead cache used
by the parser. (See added testcase for an example.) Lookahead should
instead be viewed as a layer on top of the normal lexer.

Added assertions to catch any further incorrect uses of lookahead within
lexing actions.

llvm-svn: 358230
2019-04-11 21:18:22 +00:00
Nikita Popov 6ffa1511ea [CVP] Generate full test checks for overflows.ll; NFC
llvm-svn: 358229
2019-04-11 21:10:39 +00:00
Nikita Popov e319eafb20 [ConstantRange] Add unsignedMulMayOverflow()
Same as the other ConstantRange overflow checking methods, but for
unsigned mul. In this case there is no cheap overflow criterion, so
using umul_ov for the implementation.

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

llvm-svn: 358228
2019-04-11 21:10:33 +00:00
Nikita Popov db615bb313 [ConstantRangeTest] Fix typos in test names; NFC
llvm-svn: 358227
2019-04-11 21:10:19 +00:00
Pengxuan Zheng d8ada681df [cmake] Fix dependency issue in TableGen
Summary:
There is a bug in add_tablegen which causes cmake to fail with the following
error message if LLVM_TABLEGEN is set.

CMake Error at cmake/modules/TableGen.cmake:147 (add_dependencies):
  The dependency target "LLVM-tablegen-host" of target "CLANG-tablegen-host"
  does not exist.
Call Stack (most recent call first):
  tools/clang/utils/TableGen/CMakeLists.txt:3 (add_tablegen)

The issue happens because setting LLVM_TABLEGEN causes cmake to skip generating
the LLVM-tablegen-host target. As a result, a non-existent target was added for
CLANG-tablegen-host causing cmake to fail.

In order to fix this issue, this patch adds a guard to check the validity of the
dependency target before adding it as a dependency.

Reviewers: aganea, smeenai

Reviewed By: aganea

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 358226
2019-04-11 21:05:15 +00:00
Rong Xu 959ef16859 [PGO] Better handling of profile hash mismatch
We currently assume profile hash conflicts will be caught by an upfront
check and we assert for the cases that escape the check. The assumption
is not always true as there are chances of conflict. This patch prints
a warning and skips annotating the function for the escaped cases,.

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

llvm-svn: 358225
2019-04-11 20:54:17 +00:00
Michal Gorny a318a7f665 [lldb] [lit/Register] XFAIL on Darwin
llvm-svn: 358224
2019-04-11 20:44:40 +00:00
Amara Emerson 7e9355f870 [AArch64][GlobalISel] Flesh out vector load/store support for more types.
Some of these were legalizing into smaller vector types unnecessarily,
others were simply not supported yet.

llvm-svn: 358223
2019-04-11 20:40:01 +00:00
Amara Emerson b956051415 [AArch64][GlobalISel] Legalization and ISel support for load/stores of vectors of pointers.
Loads and store of values with type like <2 x p0> currently don't get imported
because SelectionDAG has no knowledge of pointer types. To leverage the existing
support for vector load/stores, we can bitcast the value to have s64 element
types instead. We do this as a custom legalization.

This patch also adds support for general loads of <2 x s64>, and relaxes some
type conditions on selecting G_BITCAST.

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

llvm-svn: 358221
2019-04-11 20:32:24 +00:00
Aaron Smith 994023a3f1 [DebugInfo] Combine Trivial and NonTrivial flags
Summary:
Companion to https://reviews.llvm.org/D59347


Reviewers: rnk, zturner, probinson, dblaikie, deadalnix

Subscribers: aprantl, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 358220
2019-04-11 20:25:10 +00:00
Aaron Smith fa7745be7a [DebugInfo] Combine Trivial and NonTrivial flags
Summary:
These flags are used when emitting debug info and needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs.

The Trivial flag was introduced in https://reviews.llvm.org/D45122

It's been pointed out that Trivial and NonTrivial may imply each other and that seems to be the case in the current tests. This change combines them into a single flag -- NonTrivial -- and updates the corresponding unit tests. There is an additional change to llvm to update the flags.

Reviewers: rnk, zturner, dblaikie, probinson, Hui

Reviewed By: dblaikie

Subscribers: aprantl, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 358219
2019-04-11 20:24:54 +00:00
Craig Topper 68a5d619a4 [X86] Restrict vselect handling in scalarizeExtEltFP to only case to pre type legalization where the setcc result type is vXi1.
If the vector setcc has been legalized then we will need to convert a vector boolean of 0 or -1 to a scalar boolean of 0 or 1.

The added test case previously crashed in 32-bit mode by creating a setcc with an i64 condition that type legalization couldn't expand.

llvm-svn: 358218
2019-04-11 19:57:44 +00:00
Craig Topper a3635b94c4 [X86] Add 32-bit command line to extractelement-fp.ll so I can add a test case for a 32-bit only crasher. NFC
This is a bit ugly for ABI reasons about how floats/doubles are returned.

llvm-svn: 358217
2019-04-11 19:57:24 +00:00
Jonas Devlieghere bb6e3f6be7 [test] Fix & re-enable CommandScriptImmediateOutputFile on Windows
Apparently the shlex module produces garbage on Windows. I've added a
hand rolled split instead that should suffice for this test.

llvm-svn: 358216
2019-04-11 19:36:53 +00:00
Craig Topper 586fad50ac [X86] Add patterns for using movss/movsd for atomic load/store of f32/64. Remove atomic fadd pseudos use isel patterns instead.
This patch adds patterns for turning bitcasted atomic load/store into movss/sd.

It also removes the pseudo instructions for atomic RMW fadd. Instead just adding isel patterns for folding an atomic load into addss/sd. And relying on the new movss/sd store pattern to handle the write part.

This also makes the fadd patterns use VEX and EVEX instructions when AVX or AVX512F are enabled.

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

llvm-svn: 358215
2019-04-11 19:19:52 +00:00
Craig Topper f7e548c076 Recommit r358211 "[X86] Use FILD/FIST to implement i64 atomic load on 32-bit targets with X87, but no SSE2"
With correct test checks this time.

If we have X87, but not SSE2 we can atomicaly load an i64 value into the significand of an 80-bit extended precision x87 register using fild. We can then use a fist instruction to convert it back to an i64 integ

This matches what gcc and icc do for this case and removes an existing FIXME.

llvm-svn: 358214
2019-04-11 19:19:42 +00:00
Jonas Devlieghere 1fefee6a6e [test] Disable CommandScriptImmediateOutputFile on Windows
Somehow the path gets messed up. The command looks correct, but the
python path is not.

(lldb) mywrite
E:\build_slave\lldb-x64-windows-ninja\build\tools\lldb\lit\Commands\
  CommandScriptImmediateOutput\Output\
  CommandScriptImmediateOutputFile.test.tmp.read.txt r

No such file or directory:
'E:build_slavelldb-x64-windows-ninjabuildtoolslldblitCommands
  CommandScriptImmediateOutputOutput
  CommandScriptImmediateOutputFile.test.tmp.read.txt'

Maybe the shlex module is escaping it?

llvm-svn: 358213
2019-04-11 19:18:40 +00:00
Craig Topper 8200880c9a Revert r358211 "[X86] Use FILD/FIST to implement i64 atomic load on 32-bit targets with X87, but no SSE2"
I seem to have messed up the test checks.

llvm-svn: 358212
2019-04-11 19:04:38 +00:00
Craig Topper 1c2dfc3100 [X86] Use FILD/FIST to implement i64 atomic load on 32-bit targets with X87, but no SSE2
If we have X87, but not SSE2 we can atomicaly load an i64 value into the significand of an 80-bit extended precision x87 register using fild. We can then use a fist instruction to convert it back to an i64 integer and store it to a stack temporary. From there we can do two 32-bit loads to get the value into integer registers without worrying about atomicness.

This matches what gcc and icc do for this case and removes an existing FIXME.

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

llvm-svn: 358211
2019-04-11 18:40:21 +00:00
Craig Topper 1fe5a9963d [X86] Pre-commit i64 volatile test case for D60156. NFC
llvm-svn: 358210
2019-04-11 18:40:08 +00:00
Julian Lettner 1740c6e0da [TSan][libdispatch] Re-enable disabled tests
I re-activated "broad strokes suppressions"
(ignore_noninstrumented_modules=1) in my last commit. Re-enable tests
that only fail on our bots to check if they work now.

llvm-svn: 358209
2019-04-11 18:34:47 +00:00
Julian Lettner 5b981638fb [TSan][libdispatch] Turn ignore_noninstrumented_modules=1 back on for Darwin
llvm-svn: 358208
2019-04-11 18:34:44 +00:00
Max Moroz bcb93a35c0 [libFuzzer] Make MutateWithMask work when the Mask is shorter than the input.
Summary:
Before this change, MutateWithMask used to assert that Mask should be
of sufficient length (>= Size of the input). However, in real cases we may have
inputs that are longer than the Mask they have inherited from the based inputs.

Reviewers: kcc, morehouse

Reviewed By: kcc

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 358207
2019-04-11 18:21:53 +00:00
Julian Lettner 3e58f94ced [TSan][libdispatch] Replace usage of NSMutableData with stack array
Reviewed By: kubamracek

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

llvm-svn: 358205
2019-04-11 18:14:19 +00:00
Julian Lettner edea731af2 [TSan][libdispatch] Change test to have two simultaneous timers
Change test semantics by waiting for both timer callbacks at the end
instead of serializing operations: start/wait timer 1 then 2.

Reviewed By: kubamracek

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

llvm-svn: 358204
2019-04-11 18:14:16 +00:00
Julian Lettner 0f7a0c71c6 [TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 2
Reviewed By: kubamracek

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

llvm-svn: 358203
2019-04-11 18:14:13 +00:00
Matt Morehouse abed4acc2c Revert "tsan: Update test expectations."
This reverts r357831 to go with r358113.

llvm-svn: 358202
2019-04-11 18:05:37 +00:00
Erik Pilkington 1138d8c892 Support objc_nonlazy_class attribute on Objective-C implementations
Fixes rdar://49523079

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

llvm-svn: 358201
2019-04-11 17:55:34 +00:00
Erik Pilkington c5a0583400 Add support for attributes on @implementations in Objective-C
We want to make objc_nonlazy_class apply to implementations, but ran into this.
There doesn't seem to be any reason that this isn't supported.

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

llvm-svn: 358200
2019-04-11 17:55:30 +00:00
Ali Tamur 7822b46188 Revert "Use llvm::lower_bound. NFC"
This reverts commit rL358161.

This patch have broken the test:
llvm/test/tools/llvm-exegesis/X86/uops-CMOV16rm-noreg.s

llvm-svn: 358199
2019-04-11 17:35:20 +00:00
Zachary Turner 528b01e998 Fix sphinx documentation warning.
llvm-svn: 358198
2019-04-11 17:30:03 +00:00