Commit graph

365501 commits

Author SHA1 Message Date
Nikita Popov 58b28fa7a2 [InstCombine] Fold mul of abs intrinsic
Same as the existing SPF_ABS fold. We don't need to explicitly
handle NABS, as the negs will get folded away first.
2020-09-05 12:37:45 +02:00
Nikita Popov 3ab13348ba [InstCombine] Add tests for mul of abs intrinsic (NFC) 2020-09-05 12:36:27 +02:00
Nikita Popov 10cb23c6ca [InstCombine] Fold cttz of abs intrinsic
Same as the existing fold for SPF_ABS. We don't need to explicitly
handle the NABS variant, as we'll first fold away the neg in that
case.
2020-09-05 12:25:41 +02:00
Nikita Popov 1903a1afd9 [InstCombine] Add tests for cttz of abs intrinsic (NFC) 2020-09-05 12:22:42 +02:00
Nikita Popov d401e376e4 [InstCombine] Test abs with dominating condition (NFC) 2020-09-05 11:10:01 +02:00
Jonas Paulsson 714ceefad9 [SelectionDAG] Always intersect SDNode flags during getNode() node memoization.
Previously SDNodeFlags::instersectWith(Flags) would do nothing if Flags was
in an undefined state, which is very bad given that this is the default when
getNode() is called without passing an explicit SDNodeFlags argument.

This meant that if an already existing and reused node had a flag which the
second caller to getNode() did not set, that flag would remain uncleared.

This was exposed by https://bugs.llvm.org/show_bug.cgi?id=47092, where an NSW
flag was incorrectly set on an add instruction (which did in fact overflow in
one of the two original contexts), so when SystemZElimCompare removed the
compare with 0 trusting that flag, wrong-code resulted.

There is more that needs to be done in this area as discussed here:

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

Review: Ulrich Weigand, Sanjay Patel
2020-09-05 10:30:38 +02:00
Nikita Popov 39caf9e940 [SCCP] Add tests for intrinsic ranges (NFC) 2020-09-05 10:28:13 +02:00
serge-sans-paille 3a6f3fc160 Fix return status of SimplifyCFG
When a switch case is folded into default's case, that's an IR change that
should be reported, update ConstantFoldTerminator accordingly.

Differential Revision: https://reviews.llvm.org/D87142
2020-09-05 07:54:15 +02:00
Qiu Chaofan 705271d9cd [PowerPC] Expand constrained ppc_fp128 to i32 conversion
Libcall __gcc_qtou is not available, which breaks some tests needing
it. On PowerPC, we have code to manually expand the operation, this
patch applies it to constrained conversion. To keep it strict-safe,
it's using the algorithm similar to expandFP_TO_UINT.

For constrained operations marking FP exception behavior as 'ignore',
we should set the NoFPExcept flag. However, in some custom lowering
the flag is missed. This should be fixed by future patches.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D86605
2020-09-05 13:16:20 +08:00
Nemanja Ivanovic 2d652949be [PowerPC] Provide vec_cmpne on pre-Power9 architectures in altivec.h
These overloads are listed in appendix A of the ELFv2 ABI specification
without a requirement for ISA 3.0. So these need to be available on
all Altivec-capable architectures. The implementation in altivec.h
erroneously had them guarded for Power9 due to the availability of
the VCMPNE[BHW] instructions. However these need to be implemented
in terms of the VCMPEQ[BHW] instructions on older architectures.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=47423
2020-09-04 21:48:38 -04:00
Fangrui Song a5d6af421d [compiler-rt] Add .clang-tidy with customization to disable readability-identifier-naming
Copied from lldb/.clang-tidy (D75810).

Most compiler-rt code actually uses variableName or variable_name but not VariableName.
Lots of functions use `__function_name` and FunctionName instead of functionName.
Just exclude readability-identifier-naming.
2020-09-04 16:05:20 -07:00
Daniel Sanders 5e04b539c8 [compiler-rt] Try again to correct test after 3f1a9b7eca added segment names to objdump output
One check was missed on the previous attempt
2020-09-04 15:49:11 -07:00
Krzysztof Parzyszek 89a4fe79d4 [Hexagon] Unindent everything in HexagonISelLowering.h, NFC
Just a shift, no other formatting changes.
2020-09-04 17:25:29 -05:00
Pengxuan Zheng 2bccd2b435 [Driver] Allow -specs and -nostartfiles to be forwarded to GCC
With 6a75496836, these two options are no longer
forwarded to GCC. This patch restores the original behavior.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D87162
2020-09-04 15:09:33 -07:00
Jan Korous 7cfc8f0c7c [libclang] Add missing dependency on clangRewrite lib
Differential Revision: https://reviews.llvm.org/D86992
2020-09-04 14:59:53 -07:00
Nikita Popov 781a438408 [InstSimplify] Add tests for min/max with dominating condition (NFC) 2020-09-04 23:45:54 +02:00
LLVM GN Syncbot b07cbccf28 [gn build] Port 69e5abb57b 2020-09-04 21:18:33 +00:00
Jan Korous 69e5abb57b [libclang] Add CXRewriter to libclang API
Differential Revision: https://reviews.llvm.org/D86992
2020-09-04 14:17:03 -07:00
Craig Topper 35b35a373d [X86] Prevent shuffle combining from creating an identical X86ISD::SHUF128.
This can cause an infinite loop if SimplifiedDemandedElts asks
for the node to replace itself.

A similar protection exists in other places in shuffle combining.

Fixes ISPC https://github.com/ispc/ispc/issues/1864
2020-09-04 14:12:49 -07:00
Sanjay Patel 35c6d56c04 [InstCombine] rename tmp values to avoid scripted FileCheck conflicts; NFC 2020-09-04 17:02:18 -04:00
Sanjay Patel c5d6b2b7e5 [InstCombine] add test for assume in block with unreachable (PR47416); NFC 2020-09-04 16:57:35 -04:00
Nikita Popov b3e139444f [BDCE] Add tests for min/max intrinsincs (NFC) 2020-09-04 22:41:52 +02:00
Jan Korous 052f838903 [libclang] Expose couple more AST details via cursors
Differential Revision: https://reviews.llvm.org/D86991
2020-09-04 13:38:47 -07:00
Fangrui Song 398ba37230 [LiveDebugVariables] Delete unneeded doInitialization 2020-09-04 13:27:42 -07:00
Lang Hames 3b64052a25 [ORC] Fix some bugs in TPCDynamicLibrarySearchGenerator, use in llvm-jitlink.
TPCDynamicLibrarySearchGenerator was generating errors on missing
symbols, but that doesn't fit the DefinitionGenerator contract: A symbol
that isn't generated by a particular generator should not cause an
error.

This commit fixes the error by using SymbolLookupFlags::WeaklyReferencedSymbol
for all elements of the lookup, and switches llvm-jitlink to use
TPCDynamicLibrarySearchGenerator.
2020-09-04 13:23:52 -07:00
Nikita Popov 6b50ce3ac9 [SCEV] Add tests for min/max intrinsics (NFC) 2020-09-04 22:08:01 +02:00
Steven Wu 97866b8de8 [ThinLTO][Legacy] Fix StringRef assertion from ThinLTO bots
This is a presumed fix for FireFox thinLTO bot fix which hits assertion
failure for invalid index when access StringRef. Techinically, `IRName`
in the symtab should not be empty string for the entries we cared about
but this will help to fix the bot before more information can be
provided. Otherwise, NFCI.
2020-09-04 12:30:09 -07:00
Daniel Sanders 1eae19a87f [compiler-rt] Try to correct test after 3f1a9b7eca added segment names to objdump output 2020-09-04 12:24:46 -07:00
Nemanja Ivanovic 54205f0bd2 [PowerPC] Allow const pointers for load builtins in altivec.h
The load builtins in altivec.h do not have const in the signature
for the pointer parameter. This prevents using them for loading
from constant pointers. A notable case for such a use is Eigen.

This patch simply adds the missing const.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=47408
2020-09-04 13:56:39 -04:00
Florian Hahn 00eb6fef08 [DSE,MemorySSA] Check for throwing instrs between killing/killed def.
We also have to check all uses between the killing & killed def and
check if any of them is throwing.
2020-09-04 18:54:59 +01:00
Akira Hatanaka 64bb582f4a Fix the type of the invoke function in the block ABI documentation
rdar://problem/67892794
2020-09-04 10:29:09 -07:00
Daniel Sanders 8760048384 [lld] Test corrections after 3f1a9b7eca added segment names to objdump output 2020-09-04 10:26:29 -07:00
Hubert Tong dde16ef031 [tests][libFuzzer] Fix -Wmissing-field-initializers after D86092
Speculatively fix `-Werror,-Wmissing-field-initializers` failures
relating to the `ScalePerExecTime` field added by D86092.
2020-09-04 13:07:44 -04:00
Daniel Sanders 3f1a9b7eca [objdump][macho] Emit segment names along with section names
I recently came across a MachO with multiple sections of the same name but
different segments. We should emit the segment name alongside the section name
for MachO's.

Differential Revision: https://reviews.llvm.org/D87119
2020-09-04 09:57:02 -07:00
Florian Hahn 51932fc6bd [DSE,MemorySSA] Remove some duplicated test functions.
Some tests from multibuild-malloc-free.ll do not actually use malloc or
free and where split out to multiblock-throwing.ll, but not removed from
the original file. This patch cleans that up. It also moves @test22 to
simple.ll, because it does not involve multiple blocks.
2020-09-04 17:52:59 +01:00
Gabor Marton f0b9dbcfc7 [analyzer][StdLibraryFunctionsChecker] Add POSIX time handling functions
Differential Revision: https://reviews.llvm.org/D84248
2020-09-04 18:44:12 +02:00
Jan Korous baf3c77bd9 [libclang] Add translateCXRangeToCharRange conversion
Add new conversion with clearly specified semantics.

https://reviews.llvm.org/D86990
2020-09-04 09:41:22 -07:00
Wei Wang 4eef14f978 [OpenMPOpt] Assume indirect call always changes ICV
When checking call sites, give special handling to indirect call, as the
callee may be unknown and can lead to nullptr dereference later. Assume
conservatively that the ICV always changes in such case.

Reviewed By: sstefan1

Differential Revision: https://reviews.llvm.org/D87104
2020-09-04 09:05:32 -07:00
Teresa Johnson 45c3560384 [HeapProf] Address post-review comments in instrumentation code
Addresses post-review comments from D85948, which can be found here:
https://reviews.llvm.org/rG7ed8124d46f9.
2020-09-04 08:59:00 -07:00
Alex Richardson 2108bceceb FormatTest: Provide real line number in failure messages
Currently a test failure always reports a line number inside verifyFormat()
which is not very helpful to see which test failed. With this change we now
emit the line number where the verify function was called. When using an
IDE such as CLion, the output now includes a clickable link that points to
the call site.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86926
2020-09-04 16:57:46 +01:00
Alex Richardson e0ff5a8410 [clang-format] Add a test showing the current config file list parsing
Currently clang-format starts overriding the default values at index 0
(keeping the existing values) instead of appending or replacing all values.
This patch simply checks the current (IMO surprising) behaviour and does
not attempt to change it.

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86941
2020-09-04 16:57:46 +01:00
Alex Richardson 8c810acc94 [clang-format] Parse __ptr32/__ptr64 as a pointer qualifier
Before:
x = (foo *__ptr32) * v;
MACRO(A * __ptr32 a);
x = (foo *__ptr64) * v;
MACRO(A * __ptr64 a);

After:
x = (foo *__ptr32)*v;
MACRO(A *__ptr32 a);
x = (foo *__ptr64)*v;
MACRO(A *__ptr64 a);

Depends on D86721 (to apply cleanly)

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D86775
2020-09-04 16:56:21 +01:00
Muhammad Asif Manzoor 1ffcbe35ae [AArch64][SVE] Add lowering for rounding operations
Add the functionality to lower SVE rounding operations for passthru variant.
Created a new test case file for all rounding operations.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D86793
2020-09-04 11:16:57 -04:00
Nico Weber fab60665eb sanitizer_common: Implement COMPILER_CHECK using static_assert
Since this is an internal header, we can just assume static_assert
exists.

If this doesn't upset any bots, I'll replace all uses of
COMPILER_CHECK in a follow-up.
2020-09-04 11:05:54 -04:00
Nico Weber dbf04aaade Revert "[Asan] Cleanup atomic usage in allocator"
This reverts commit 8b8be6f38a
and follow-ups 99a93c3a22,
a9c0bf0404,
48ac5b4833.

It breaks building on Windows, see https://reviews.llvm.org/D86917#2255872
2020-09-04 10:51:08 -04:00
Xing GUO 2966d6e80b [MachOYAML] Allow handcrafting custom contents for DWARF sections.
This patch enables users to handcraft custom contents for DWARF
sections. If we specify the contents of DWARF sections both in the
'DWARF' entry and the 'content', yaml2obj will emit an error message.
In addition, this patch helps remove the restriction that only the
content of sections whose segname are __DWARF can be specified in the
"DWARF" entry.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D87126
2020-09-04 22:42:45 +08:00
Bryan Chan 3404add468 [EarlyCSE] Verify hash code in regression tests
As discussed in D86843, -earlycse-debug-hash should be used in more regression
tests to catch inconsistency between the hashing and the equivalence check.

Differential Revision: https://reviews.llvm.org/D86863
2020-09-04 10:40:35 -04:00
Nico Weber 2a03f270d6 clang: Add test for -Wunreachable-code + weak redeclaration
This tests what caused the revert in 7b033238.
2020-09-04 10:35:50 -04:00
Lei Zhang 7d53fecb67 [spirv] Add more target and resource limit fields
These fields will be used to choose/influence patterns for
SPIR-V code generation.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D87106
2020-09-04 10:26:34 -04:00
Nico Weber c88a776204 [gn build] fix llvm-lit after d23b15cc16 2020-09-04 10:23:16 -04:00