Commit Graph

338134 Commits

Author SHA1 Message Date
Muhammad Omair Javaid e25e3d7585 [lldb] Silent random xpass on aarch64-linux buildbot
This patch adds skipif decorator to TestWatchLocationWithWatchSet.py.
Decorator will trigger for aarch64-linux as this test passes randomly
causing buildbot failure.
2019-12-27 17:01:58 +05:00
wyzhao 2e5a75581c [mlir] fix typo in a comment
Trivial patch, reviewed and accepted on
https://github.com/tensorflow/mlir/pull/336 before MLIR merge.
2019-12-27 12:15:26 +01:00
Uday Bondhugula be775a0038 [MLIR] [NFC] fix unused var warning
Summary:
Fix this warning:
`
[69/106] Building CXX object tools/mlir/lib/Dialect/StandardOps/CMakeFiles/MLIRStandardOps.dir/Ops.cpp.o
/home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp: In member function ‘virtual mlir::PatternMatchResult {anonymous}::ViewOpShapeFolder::matchAndRewrite(mlir::ViewOp, mlir::PatternRewriter&) const’:
/home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp:2575:14: warning: variable ‘dynamicOffsetOperandCount’ set but not used [-Wunused-but-set-variable]
 2575 |     unsigned dynamicOffsetOperandCount = 0;
`

Reviewers: rriddle, mehdi_amini, ftynse

Reviewed By: ftynse

Subscribers: jpienaar, burmako, shauheen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71922
2019-12-27 12:04:46 +01:00
Alex Zinenko cda94d3e8a [mlir] Floating constants for import-llvm
Summary:
`mlir-translate -import-llvm test.ll`  was going into segmentation fault if `test.ll` had `float` or `double` constants.
For example,
```
%3 = fadd double 3.030000e+01, %0
```
Now, it is handled in `Importer::getConstantAsAttr` (similar behaviour as normal integers)
Added tests for FP arithmetic

Reviewers: ftynse, mehdi_amini

Reviewed By: ftynse, mehdi_amini

Subscribers: shauheen, mehdi_amini, rriddle, jpienaar, burmako, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71912
2019-12-27 11:48:24 +01:00
Ilya Biryukov e2d9f4e6a2 [clangd] Reformat `HoverTests.cpp` NFC
I accidentally broke formatting in the previous revision.
2019-12-27 09:35:46 +01:00
Craig Topper fca4736874 [X86] Allow v2i32->v2f32 strict and non-strict uint_to_fp to be widened to v4i32->v4f32 under avx512.
With avx512vl we get v4i32->v4f32 uint_to_fp instructions. With
avx512f we get v16i32->v16f32 instructions which we can use to
emulate v4i32->v4f32.
2019-12-27 00:28:44 -08:00
Craig Topper 931946bb1d [X86] Add v2i32->v2f32 non-strict sint_to_fp/uint_to_fp tests. NFC 2019-12-27 00:28:44 -08:00
Craig Topper 20aab49492 [X86] Custom widen v2i32->v2f32 strict_sint_to_fp to avoid scalarization. 2019-12-27 00:28:44 -08:00
Georgii Rymar e7a296a312 [llvm-readobj][llvm-objdump][test] - Improve dynamic section testing.
This adds --strict-whitespace --match-full-lines flags to
improve the testing and reveal formatting issues we have.

Differential revision: https://reviews.llvm.org/D71895
2019-12-27 11:27:39 +03:00
Ilya Biryukov 14e11005d1 [clangd] Fix crash in hover 2019-12-27 09:15:15 +01:00
Fangrui Song 7a7334663c Delete llvm.{sig,}{setjmp,longjmp} remnant after r136821
Intrinsic has incorrect argument type!
  i32 (i32*)* @llvm.setjmp

*wipes tear*
2019-12-27 00:00:14 -08:00
Craig Topper ecbaf152f8 [X86] Custom widen 128/256-bit vXi32 fp_to_uint on avx512f targets without avx512vl. Similar for vXi64 on avx512dq without avx512vl.
Summary:
Previously we did this with isel patterns that used garbage in
the widened part of the source. But that's not valid for strictfp.
So now we custom widen and use zeroes for the widened elemens for
strictfp.

This replaces D71864.

Reviewers: RKSimon, spatel, andrew.w.kaylor, pengfei, LiuChen3

Reviewed By: pengfei

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71879
2019-12-26 22:04:40 -08:00
Craig Topper 50fb3957c1 [X86] Custom widen strict v2f32->v2i32 by padding with zeroes.
For non-strict, generic type legalization will take care of this,
but that doesn't happen currently for strict nodes.
2019-12-26 21:45:18 -08:00
Fangrui Song c4a97b64e3 [X86] Fix -Wmisleading-indentation after D71892 2019-12-26 21:41:16 -08:00
Craig Topper 53ee806d93 [X86][FPEnv] Promote some float strictfp operations to double on i686-pc-windows-msvc to match what we do for non-strict.
The float libcalls are inlined in MSVC's math header where they
just cast to double and use the double libcall. Do the same when
we emit libcalls.
2019-12-26 20:22:24 -08:00
Craig Topper e647ff0d7d [X86] Add tests for constrained float intrinsics on i686-pc-windows-msvc. NFC
We need to promote these to double due to missing libcalls on
Windows.
2019-12-26 20:09:34 -08:00
Craig Topper a5d266b9cf [X86] Add custom legalization for strict_uint_to_fp v2i32->v2f32.
I believe the algorithm we use for non-strict is exception safe
for strict. The fsub won't generate any exceptions. After it we
will have an exact version of the i32 integer in a double. Then
we just round it to f32. That rounding will generate a precision
exception if it can't be represented exactly.
2019-12-26 19:10:26 -08:00
Craig Topper bc202547d5 [X86] Add test cases for v2i32->v2f32 strict_sint_to_fp/strict_uint_to_fp. NFC 2019-12-26 19:10:26 -08:00
Eric Christopher 371038e3ff Add an __attribute__((unused)) to populateWithGenerated since it might
not be used where defined and is autogenerated.
2019-12-26 18:48:59 -08:00
Eric Christopher 8f9304f559 Temporarily Revert "[compiler-rt] [netbsd] Add support for versioned statvfs interceptors"
as it's failing the netbsd specific linter parts of the sanitizer linter:

llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc:23:  Lines should be <= 80 characters long  [whitespace/line_length]
llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp:2450:  Do not use variable-length arrays.  Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size.

This reverts commit 78f714f824.
2019-12-26 18:40:20 -08:00
Eric Christopher e1838a1789 Fix a -Wcovered-switch-default warning by moving the unreachable out of the
covered switch.
2019-12-26 18:34:41 -08:00
Eric Christopher 3d18ce7154 Remove an unused static function. 2019-12-26 18:34:14 -08:00
Eric Christopher 3009cee75f Fix a -Wcovered-switch-default warning by moving the unreachable out of the
covered switch.
2019-12-26 18:29:54 -08:00
Eric Christopher 30617e4b9c Remove unused static function. 2019-12-26 18:20:15 -08:00
Evgenii Stepanov 5ca97d0def Revert "Allow newlines in AST Matchers in clang-query files" + 1
Revert "Fix -Wunused-lambda-capture warnings."
This reverts commit 2369560f4a.
This reverts commit 522ee29a4f.

clang/lib/ASTMatchers/Dynamic/Parser.cpp:610:13: warning: implicit conversion turns string literal into bool: 'const char [35]' to 'bool' [-Wstring-conversion]
    assert(!"Newline should never be found here");
2019-12-26 18:07:20 -08:00
Liu, Chen3 1a7b69f5dd add custom operation for strict fpextend/fpround
Differential Revision: https://reviews.llvm.org/D71892
2019-12-27 08:28:33 +08:00
Kamil Rytarowski 78f714f824 [compiler-rt] [netbsd] Add support for versioned statvfs interceptors
Summary:
Add support for NetBSD 9.0 and newer versions of interceptors
operating on struct statvfs: fstatvfs, fstatvfs1, getmntinfo,
getvfsstat, statvfs, statvfs1.

The default promoted interceptors are for NetBSD 9.99.26. Older
ones (currently 9.0) are kept in a new NetBSD specific file:
/sanitizer_common_interceptors_netbsd_compat.inc. This file
defines compat interceptors and mangles `INIT_*` macros,
concatenating the current interceptors and the compat ones.
This redefinition is not elegant, but it avoids preprocessor madness.

Define struct_statvfs90_sz for the compat purposes.

Reviewers: mgorny, kcc, vitalybuka, joerg

Reviewed By: mgorny

Subscribers: dberris, llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D71700
2019-12-27 01:15:39 +01:00
Eric Christopher 1584e2f987 Remove SrcVT only used in an assert and propagate query. 2019-12-26 15:28:32 -08:00
Eric Christopher 2369560f4a Fix -Wunused-lambda-capture warnings. 2019-12-26 15:27:21 -08:00
David Herzka 4e5d134da1 Make lazyload_metadata.ll resilient to the addition of new metadata kinds
Summary: The specific number of records loaded depends on the number of kinds, but the difference between the lazy and not lazy cases does not.

Reviewers: modocache

Subscribers: llvm-commits, dexonsmith, steven_wu, hiraditya, mehdi_amini

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71882
2019-12-26 18:23:08 -05:00
Craig Topper f953882113 [X86] Custom widen 128/256-bit vXi32 uint_to_fp on avx512f targets without avx512vl. Similar for vXi64 sint_to_fp/uint_to_fp on avx512dq without avx512vl.
Previously we widened these through isel patterns, but that
didn't work for STRICT_ nodes. Those need to be padded with
zeroes in the upper bits which is harder to do in isel patterns.
2019-12-26 14:46:56 -08:00
Reid Kleckner ad1f7a895b Revert "Make lazyload_metadata.ll resilient to the addition of new metadata kinds"
This reverts commit be4704bd41.

This test fails on Windows without awk.
2019-12-26 14:29:11 -08:00
Fangrui Song 019a92bb28 [ELF][test] Fix dynamic-linker.s 2019-12-26 13:44:52 -08:00
Mehdi Amini b52cb5688b Add a clang-tidy configuration file for MLIR, it is using camelBack for naming at the moment 2019-12-26 21:42:01 +00:00
Craig Topper 90ff34e6ab [X86] Add custom widening for v2i32->v2f64 strict_uint_to_fp with AVX512F, but not AVX512VL.
Previously we were widening with isel patterns, but that wasn't
exception safe for strict FP. So now we widen to v4i32->v4f64
during type legalization. And then let op legalization further
widen to v8i32->v8f64.

The vec_int_to_fp.ll changes are caused by us no longer narrowing
extracts of strict_uint_to_fp to the v4i32->v2f64 instruction
without AVX512VL only to have isel rewiden it. Now we just keep
it wide throughout. So we don't have an opportunity to narrow
the load.
2019-12-26 13:40:56 -08:00
Fangrui Song 1417558e4a [ELF] Improve the condition to create .interp
Similar to rL362355, but with the `!config->shared` guard.

(1) {gcc,clang} -fuse-ld=bfd -pie -fPIE -nostdlib a.c => .interp created
(2) {gcc,clang} -fuse-ld=lld -pie -fPIE -nostdlib a.c => .interp not created
(3) {gcc,clang} -fuse-ld=lld -pie -fPIE -nostdlib a.c a.so => .interp created

The inconsistency of (2) is due to the condition `!Config->SharedFiles.empty()`.
To make lld behave more like ld.bfd, we could change the condition to:

    config->hasDynSymTab && !config->dynamicLinker.empty() && script->needsInterpSection();

However, that would bring another inconsistency as can be observed with:

(4) {gcc,clang} -fuse-ld=bfd -no-pie -nostdlib a.c => .interp not created
2019-12-26 13:26:43 -08:00
Craig Topper bb0138729b [X86] Add custom widening for v2f64->v2i32 strict_fp_to_uint with avx512f, but not avx512vl.
AVX512F added instruction for vector fp_to_uint conversions. With
AVX512VL we can use a specific instruction that does v2f64->v4i32 with
zeroes in the 2 extra elements. For non-strict nodes without AVX512VL
we relied on type legalization to turn it to v4f64->v4i32 which would
later be widened by op legalization to v8f64->v8i32. But type legalization
doesn't currently widen strict nodes since it doesn't know how to
safely and efficiently pad the extra elements. But for X86 we know
padding with zeroes is safe and efficient so do that ourselves.
2019-12-26 12:42:27 -08:00
Stephen Kelly 522ee29a4f Allow newlines in AST Matchers in clang-query files
Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D71842
2019-12-26 20:40:33 +00:00
Evgenii Stepanov 04926e67fd Revert "[msan] Check qsort input."
This change breaks LLVM bootstrap with ASan and MSan.

FAILED: lib/ToolDrivers/llvm-lib/Options.inc
OptParser.td:137:1: error: Option is equivalent to
def INPUT : Option<[], "<input>", KIND_INPUT>;
^
OptParser.td:137:1: error: Other defined here
def INPUT : Option<[], "<input>", KIND_INPUT>;

This reverts commit caa48a6b88.
2019-12-26 12:29:48 -08:00
Stephen Kelly 831b636861 Revert "Allow newlines in AST Matchers in clang-query files"
This reverts commit 6a3ecf4dc7.
2019-12-26 20:16:23 +00:00
Stephen Kelly 6a3ecf4dc7 Allow newlines in AST Matchers in clang-query files
Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D71842
2019-12-26 20:00:59 +00:00
David Herzka be4704bd41 Make lazyload_metadata.ll resilient to the addition of new metadata kinds
Summary: The specific number of records loaded depends on the number of kinds, but the difference between the lazy and not lazy cases does not.

Reviewers: modocache

Subscribers: llvm-commits, dexonsmith, steven_wu, hiraditya, mehdi_amini

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71882
2019-12-26 13:56:07 -05:00
Kristina Bessonova cdd25a4c74 [DebugInfo][SelectionDAG] Change order while transferring SDDbgValue to another node
SelectionDAG::transferDbgValues() can 'reattach' SDDbgValue from one to
another node, but doesn't change its source order. If the destination node has
the order greater than the SDDbgValue, there are two possible issues
revealed later:

* If debug info is attached to an instruction that is the first definition
of a register, this ends up with a def-after-use and the debug info
gets 'undef' later.

* If MIR has another definition of a register above the debug info,
the debug info may represent a source variable incorrectly because
it appears (significantly) before an instruction corresponded
to this debug info.

So, the patch changes the order of an SDDbgValue when it is moved
to a node with greater order.

Reviewers: dblaikie, jmorse, aprantl

Reviewed By: aprantl

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71175
2019-12-26 21:01:59 +03:00
Fangrui Song 1edd965130 [ELF] Support input section description .gnu.version* in /DISCARD/
Linux powerpc discards `*(.gnu.version*)` (arch/powerpc/kernel/vmlinux.lds.S)
to suppress --orphan-handling=warn warnings in the -pie output `.tmp_vmlinux1`

The support is simple. Just add isLive() to:

1) Fix an assertion in SectionBase::getPartition() called by VersionTableSection::isNeeded().
2) Suppress DT_VERSYM, DT_VERDEF, DT_VERNEED and DT_VERNEEDNUM, if the relevant section is discarded.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D71819
2019-12-26 09:54:22 -08:00
Hideto Ueno cb5eb13eaf [Attributor] Add helper to change an instruction to `unreachable` inst
Summary: Calling `changeToUnreachable` in `manifest` from different places might cause really unpredictable problems. As other deleting functions are doing, we need to change these instructions after all `manifest`.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71910
2019-12-27 02:39:37 +09:00
Yonghong Song ffd57408ef [BPF] Enable relocation location for load/store/shifts
Previous btf field relocation is always at assignment like
   r1 = 4
which is converted from an ld_imm64 instruction.

This patch did an optimization such that relocation
instruction might be load/store/shift. Specically, the
following insns may also have relocation, except BPF_MOV:
  LDB, LDH, LDW, LDD, STB, STH, STW, STD,
  LDB32, LDH32, LDW32, STB32, STH32, STW32,
  SLL, SRL, SRA

To accomplish this, a few BPF target specific
codegen only instructions are invented. They
are generated at backend BPF SimplifyPatchable phase,
which is at early llc phase when SSA form is available.
The new codegen only instructions will be converted to
real proper instructions at the codegen and BTF emission stage.

Note that, as revealed by a few tests, this optimization might
be actual generating more relocations:
Scenario 1:
  if (...) {
    ... __builtin_preserve_field_info(arg->b2, 0) ...
  } else {
    ... __builtin_preserve_field_info(arg->b2, 0) ...
  }
  Compiler could do CSE to only have one relocation. But if both
  of the above is translated into codegen internal instructions,
  the compiler will not be able to do that.
Scenario 2:
  offset = ... __builtin_preserve_field_info(arg->b2, 0) ...
  ...
  ...  offset ...
  ...  offset ...
  ...  offset ...
  For whatever reason, the compiler might be temporarily do copy
  propagation of the righthand of "offset" assignment like
  ...  __builtin_preserve_field_info(arg->b2, 0) ...
  ...  __builtin_preserve_field_info(arg->b2, 0) ...
  and CSE will be able to deduplicate later.
  But if these intrinsics are converted to BPF pseudo instructions,
  they will not be able to get deduplicated.

I do not expect we have big instruction count difference.
It may actually reduce instruction count since now relocation
is in deeper insn dependency chain.
For example, for test offset-reloc-fieldinfo-2.ll, this patch
generates 7 instead of 6 relocations for non-alu32 mode, but it
actually reduced instruction count from 29 to 26.

Differential Revision: https://reviews.llvm.org/D71790
2019-12-26 09:07:39 -08:00
Johannes Doerfert 6c5d1f40ff [OpenMP][NFCI] Use the libFrontend ProcBindKind in Clang
This removes the OpenMPProcBindClauseKind enum in favor of
llvm::omp::ProcBindKind which lives in OpenMPConstants.h and was
introduced in D70109.

No change in behavior is expected.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D70289
2019-12-26 11:04:07 -06:00
Craig Topper c91bf72e2c [X86] Merge the SINT_TO_FP/UINT_TO_FP handlers in ReplaceNodeResults since the AVX512DQ+AVX512VL code is very similar in both. NFC 2019-12-26 08:58:34 -08:00
Craig Topper 4e6b0dd681 [X86] Add custom lowering for v2i64->v2f32 strict_sint_to_fp/strict_uint_to_fp for avx512dq+avx512vl targets.
With avx512dq+avx512vl we have instruction that implements this and
places zeroes in the upper 64-bits of the destination xmm register.
2019-12-26 08:58:34 -08:00
Craig Topper 7f071958cd [X86] Add test cases for v2i64->v2f32 strict_sint_to_fp/strict_uint_to_fp. 2019-12-26 08:58:34 -08:00