Commit Graph

320233 Commits

Author SHA1 Message Date
Mikael Holmen 2adab5a142 Silence gcc warning in testcase [NFC]
Without the fix gcc (7.4.0) complains with

../unittests/ADT/APIntTest.cpp: In member function 'virtual void {anonymous}::APIntTest_MultiplicativeInverseExaustive_Test::TestBody()':
../unittests/ADT/APIntTest.cpp:2510:36: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (unsigned Value = 0; Value < (1 << BitWidth); ++Value) {
                              ~~~~~~^~~~~~~~~~~~~~~~~

llvm-svn: 364624
2019-06-28 06:45:20 +00:00
Craig Topper e832adea0f [X86] Remove some duplicate patterns that already exist as part of their instruction definition. NFC
llvm-svn: 364623
2019-06-28 05:03:47 +00:00
Alex Brachet 1c7aec1c93 [Support] Fix add fs::getUmask() patch
llvm-svn: 364622
2019-06-28 04:07:13 +00:00
Alex Brachet 3b715d67dd [Support] Add fs::getUmask() function and change fs::setPermissions
Summary: This patch changes fs::setPermissions to optionally set permissions while respecting the umask. It also adds the function fs::getUmask() which returns the current umask.

Reviewers: jhenderson, rupprecht, aprantl, lhames

Reviewed By: jhenderson, rupprecht

Subscribers: sanaanajjar231288, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 364621
2019-06-28 03:21:00 +00:00
Zi Xuan Wu 588a170970 [NFC][PowerPC] Move XS*QP series instruction apart from XS*QPO series in position of td file
llvm-svn: 364620
2019-06-28 02:51:03 +00:00
Stanislav Mekhanoshin 07fd88d735 [AMDGPU] Packed thread ids in function call ABI
Differential Revision: https://reviews.llvm.org/D63851

llvm-svn: 364619
2019-06-28 01:52:13 +00:00
Matt Arsenault 3018d1845b GlobalISel: Use Register
llvm-svn: 364618
2019-06-28 01:47:44 +00:00
Kai Luo c6fe8436e8 [PowerPC][NFC] Use `|=` to update `Simplified` flag
llvm-svn: 364617
2019-06-28 01:38:42 +00:00
Matt Arsenault 1178dc3d0b AMDGPU/GlobalISel: Convert to using Register
llvm-svn: 364616
2019-06-28 01:16:46 +00:00
Matt Arsenault 5e66db6b8c GlobalISel: Convert rest of MachineIRBuilder to using Register
llvm-svn: 364615
2019-06-28 01:16:41 +00:00
Ali Tamur 9a89d657b1 Fixing a couple of wrong logical operator bugs.
llvm-svn: 364614
2019-06-28 00:11:26 +00:00
Amara Emerson ecb7ac35f9 [GlobalISel][IRTranslator] Fix some PHI bugs related to jump tables when optimizations are used.
The new switch lowering code that tries to generate jump tables and range checks
were tested at -O0 on arm64, but on -O3 the generic switch lowering code goes to
town on trying to generate optimized lowerings, e.g. multiple jump tables, range
checks etc. This exposed bugs in the way PHI nodes are handled because the CFG
looks even stranger after all of this is done.

llvm-svn: 364613
2019-06-27 23:56:34 +00:00
Fedor Sergeev 92e625c223 [InlineCost] make InlineCost assignable
Summary:
Current InlineCost is not assignable because of const members Cost and Threshold.
I dont see practical benefits from having them const (access to these members is
private and internal interactions are rather simple). On other hand that makes
it hard to use as a member in some other data structure where assignability is necessary.

I'm going to use InlineCost in a downstream inliner that maintains a complex queue
of candidate call-sites and thus keeping and recalculating InlineCost is necessary.

This patch just removes 'const' from both members, making InlineCost assignable.

Reviewers: eraman, greened, chandlerc, yrouban, apilipenko
Reviewed By: apilipenko
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D63823

llvm-svn: 364612
2019-06-27 23:41:03 +00:00
Rumeet Dhindsa ddc2804e1a Fix ASAN error caused by commit r364512.
This patch intends to fix ASAN stack-use-after-scope error.
This is at least a short-term fix to unbreak LLVM's mainline.

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

llvm-svn: 364611
2019-06-27 23:37:04 +00:00
Amara Emerson 4fcf0004fa [LangRef] Clarify codegen expectations for intrinsics with fp/integer-only overloads.
This change is a result of discussions on list: "GlobalISel: Ambiguous intrinsic semantics problem"

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

llvm-svn: 364610
2019-06-27 23:33:05 +00:00
Peter Collingbourne 559b2e0187 hwasan: Fix an off-by-one error in PrintTagsAroundAddr.
Previously we were printing 16 rows of tags, not 17.

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

llvm-svn: 364609
2019-06-27 23:24:36 +00:00
Peter Collingbourne 5378afc02a hwasan: Use llvm.read_register intrinsic to read the PC on aarch64 instead of taking the function's address.
This shaves an instruction (and a GOT entry in PIC code) off prologues of
functions with stack variables.

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

llvm-svn: 364608
2019-06-27 23:24:07 +00:00
Peter Collingbourne d11ea6518c hwasan: Teach the runtime to identify the local variable being accessed in UAR reports.
Each function's PC is recorded in the ring buffer. From there we can access
the function's local variables and reconstruct the tag of each one with the
help of the information printed by llvm-symbolizer's new FRAME command. We
can then find the variable that was likely being accessed by matching the
pointer's tag against the reconstructed tag.

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

llvm-svn: 364607
2019-06-27 23:16:13 +00:00
Lang Hames c29abb50f2 Revert "[JITLink][MachO/x86-64] Add a testcase for X86_64_RELOC_GOT."
Reverts commit r364600 while I investigate bot failures.

llvm-svn: 364606
2019-06-27 23:00:30 +00:00
Nathan Huckleberry 13fde7a89a [analyzer] Fix clang-tidy crash on GCCAsmStmt
Summary:
Added entry in switch statement to recognize GCCAsmStmt
as a possible block terminator.

Handling to build CFG using GCCAsmStmt was already implemented.

Reviewers: nickdesaulniers, george.karpenkov, NoQ

Reviewed By: nickdesaulniers, NoQ

Subscribers: xbolva00, tmroeder, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, cfe-commits

Tags: #clang

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

llvm-svn: 364605
2019-06-27 22:46:40 +00:00
Roman Lebedev 29d05c005f [CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case) (try 3)
Summary:
I'm submitting a new revision since i don't understand how to reclaim/reopen/take over the existing one, D50222.
There is no such action in "Add Action" menu...

This implements an optimization described in Hacker's Delight 10-17: when `C` is constant,
the result of `X % C == 0` can be computed more cheaply without actually calculating the remainder.
The motivation is discussed here: https://bugs.llvm.org/show_bug.cgi?id=35479.

This is a recommit, the original commit rL364563 was reverted in rL364568
because test-suite detected miscompile - the new comparison constant 'Q'
was being computed incorrectly (we divided by `D0` instead of `D`).

Original patch D50222 by @hermord (Dmytro Shynkevych)

Notes:
- In principle, it's possible to also handle the `X % C1 == C2` case, as discussed on bugzilla.
  This seems to require an extra branch on overflow, so I refrained from implementing this for now.
- An explicit check for when the `REM` can be reduced to just its LHS is included:
  the `X % C` == 0 optimization breaks `test1` in `test/CodeGen/X86/jump_sign.ll` otherwise.
  I hadn't managed to find a better way to not generate worse output in this case.
- The `test/CodeGen/X86/jump_sign.ll` regresses, and is being fixed by a followup patch D63390.

Reviewers: RKSimon, craig.topper, spatel, hermord, xbolva00

Reviewed By: RKSimon, xbolva00

Subscribers: dexonsmith, kristina, xbolva00, javed.absar, llvm-commits, hermord

Tags: #llvm

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

llvm-svn: 364600
2019-06-27 21:52:10 +00:00
Roman Lebedev a59cf87822 [NFC][APInt] Add (exhaustive) test for multiplicativeInverse()
Else there is no direct test coverage at all.
The function should either return '0' or precise answer.

llvm-svn: 364599
2019-06-27 21:51:54 +00:00
Lang Hames 4a8dc61534 [JITLink][MachO/x86-64] Add a testcase for X86_64_RELOC_GOT.
This is the data-section counterpart to X86_64_RELOC_GOTPCREL.

llvm-svn: 364598
2019-06-27 21:50:29 +00:00
Cameron McInally 30cab5d6ee [NFC][GVNSink] Pre-commit unary FNeg test to fpmath.ll
llvm-svn: 364597
2019-06-27 21:23:07 +00:00
Heejin Ahn 24dba1fe97 [WebAssembly] Enable an atomic.notify MC test
Summary:
Assembly of atomic.notify has been fixed in r364576, so we can enable
it.

Reviewers: aardappel

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 364596
2019-06-27 21:22:04 +00:00
Akira Hatanaka 3b56e390dd Pattern match struct types in test case.
This simplifies the test cases in a patch I'm planning to send later.

llvm-svn: 364595
2019-06-27 21:16:19 +00:00
Petr Hosek d9a59aeb04 [libFuzzer] Migrate to the new exception syscalls on Fuchsia
This is part of the transition to the new Fuchsia exception syscalls
signature.

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

llvm-svn: 364594
2019-06-27 21:13:06 +00:00
Petr Hosek 379a9f5e24 [sanitizer_common] Switch from zx_clock_get_new to zx_clock_get
This is part of the soft-transition to the new system call name.
These two system calls are the same so this change is no-op.

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

llvm-svn: 364593
2019-06-27 21:13:05 +00:00
Cameron McInally 6e62a796d5 [GVN] Add support for unary FNeg to GVN pass
Differential Revision: https://reviews.llvm.org/D63896

llvm-svn: 364592
2019-06-27 21:05:02 +00:00
Reid Kleckner 8007ff1ab1 [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.*
These lit configuration files are really Python source code. Using the
.py file extension helps editors and tools use the correct language
mode. LLVM and Clang already use this convention for lit configuration,
this change simply applies it to all of compiler-rt.

Reviewers: vitalybuka, dberris

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

llvm-svn: 364591
2019-06-27 20:56:04 +00:00
Alexandre Ganea fa36593f4c Convert line endings to LF.
llvm-svn: 364590
2019-06-27 20:46:11 +00:00
Adrian Prantl 559c6e17cd Make nrvo-string test more robust.
This is a follow-up to r364466, but better implemented. Original
commit message still applies:

    The breakpoint locations were in places where clang doesn't actually
    emit a source location for and depend on the debugger's ability to
    move the breakpoint forward onto a line that is already in the
    function epilogue. In my testing older versions of LLDB fail to do
    that, so I'm modifying the test to force a break-able location by
    calling a noinline function.

    <rdar://problem/52079841>

llvm-svn: 364589
2019-06-27 20:38:37 +00:00
Sanjay Patel 7ecf1ec49a [x86] remove whitespace; NFC
llvm-svn: 364588
2019-06-27 20:37:12 +00:00
Cameron McInally 22afca2ce0 [NFC][GVN] Pre-commit unary FNeg tests to fpmath.ll
llvm-svn: 364587
2019-06-27 20:33:44 +00:00
Louis Dionne 223df5b540 [libcxxabi] Use an explicit list to export symbols from the dylib
Reviewers: EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 364586
2019-06-27 20:17:22 +00:00
Sanjay Patel a95ca2b5ff [x86] prevent crashing from select narrowing with AVX512
llvm-svn: 364585
2019-06-27 20:16:58 +00:00
Vitaly Buka 564b03729b [GN] Update build file
llvm-svn: 364583
2019-06-27 19:55:22 +00:00
Vitaly Buka f7a19f684b [GN] Set exit code to 1 if changes are needed
llvm-svn: 364582
2019-06-27 19:55:21 +00:00
Jinsong Ji c627aa2fa9 [PowerPC][NFC] Remove unused (and unsupported) fusion feature bits.
FeatureFusion bits was first introduced in
https://reviews.llvm.org/rL253724. for add/load integer fusion for P8.
The only use of `hasFusion` was https://reviews.llvm.org/rL255319.

However, this was removed later in https://reviews.llvm.org/rL280440.

So, there is NO any reference to fusion in code now.

Leaving it there is misleading and confusing, so remove it for now.
We can alwasy add back if we ever support fusion in the future.

llvm-svn: 364581
2019-06-27 19:35:11 +00:00
Johannes Doerfert 6ed459fd41 Use "willreturn" in isGuaranteedToTransferExecutionToSuccessor
The `willreturn` function attribute guarantees that a function call will
come back to the call site if the call is also known not to throw.
Therefore, this attribute can be used in
`isGuaranteedToTransferExecutionToSuccessor`.

Patch by Hideto Ueno (@uenoku)

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 364580
2019-06-27 19:29:48 +00:00
Philip Reames 1cf9e72cbc Update -analyze -scalar-evolution output for multiple exit loops w/computable exit values
The previous output was next to useless if *any* exit was not computable.  If we have more than one exit, show the exit count for each so that it's easier to see what's going from with SCEV analysis when debugging.

llvm-svn: 364579
2019-06-27 19:22:43 +00:00
Roman Lebedev bd34e50cf0 [NFC][CodeGen] Add negative test for X u% C == 0 fold (D63391)
The fold (D63391) uses multiplicativeInverse(),
but it is not guaranteed to always succeed,
and '100' appears to be one of the problematic values.

llvm-svn: 364578
2019-06-27 19:09:51 +00:00
Michael Liao c5486b23bc Correct the file path. NFC.
llvm-svn: 364577
2019-06-27 19:05:46 +00:00
Wouter van Oortmerssen bfd3f69480 [WebAssembly] AsmParser: better atomic inst detection
Summary:
Previously missed atomic.notify.

Fixes https://bugs.llvm.org/show_bug.cgi?id=40728

Reviewers: aheejin

Subscribers: sbc100, jgravelle-google, sunfish, jfb, llvm-commits, dschuff

Tags: #llvm

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

llvm-svn: 364576
2019-06-27 18:58:26 +00:00
Alexey Bataev f288cf9dfa [OPENMP]Generate correctly implicit flags for mapped data.
Implicit flag must not be emitted for explicitly specified firstprivate
variables, but for implicitly captured sizes of the VLAs.

llvm-svn: 364575
2019-06-27 18:53:07 +00:00
Marshall Clow 954014a0fa Add a missing '__uncvref_t' to the SFINAE constraints for optional's assignment operator. Fixes PR38638. Thanks to Jonathan Wakely for the report
llvm-svn: 364574
2019-06-27 18:40:55 +00:00
Yuanfang Chen 2dcd2c2493 [llvm-objdump] Update the doc for --disassemble-functions.
Update the doc after llvm-svn: 364121 is landed.
With two more trivial fixes that are not related to
--disassemble-functions but still about llvm-objdump.

Reviewers: jhenderson, grimar, MaskRay, rupprecht, peter.smith

Reviewed by: jhenderson, MaskRay

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

llvm-svn: 364573
2019-06-27 18:39:34 +00:00
Alexey Bataev bb55ece269 [OPENMP][NVPTX]Relax flush directive.
Summary:
According to the OpenMP standard, flush  makes a thread’s temporary view of memory consistent with memory and enforces an order on the memory operations of the variables explicitly specified or implied.

According to the Cuda toolkit documentation (https://docs.nvidia.com/cuda/archive/8.0/cuda-c-programming-guide/index.html#memory-fence-functions), __threadfence() functions provides required functionality.

__threadfence_system() also provides required functionality, but it also
includes some extra functionality, like synchronization of page-locked
host memory, synchronization for the host, etc. It is not required per
the standard and we can use more relaxed version of memory fence
operation.

Reviewers: grokos, gtbercea, kkwli0

Subscribers: guansong, jfb, jdoerfert, openmp-commits, caomhin

Tags: #openmp

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

llvm-svn: 364572
2019-06-27 18:33:09 +00:00
Djordje Todorovic 774eabd097 Revert "[LiveDebugValues] Emit the debug entry values"
Appears that the 'test/DebugInfo/MIR/X86/dbginfo-entryvals.mir'
does not pass on Windows.

This reverts commit rL364553.

llvm-svn: 364571
2019-06-27 18:12:04 +00:00
Wouter van Oortmerssen 6b3f56b65f [WebAssembly] Fix p2align in assembler.
Summary:
- Match the syntax output by InstPrinter.
- Fix it always emitting 0 for align. Had to work around fact that
  opcode is not available for GetDefaultP2Align while parsing.
- Updated tests that were erroneously happy with a p2align=0

Fixes https://bugs.llvm.org/show_bug.cgi?id=40752

Reviewers: aheejin, sbc100

Subscribers: jgravelle-google, sunfish, jfb, llvm-commits, dschuff

Tags: #llvm

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

llvm-svn: 364570
2019-06-27 18:11:15 +00:00