Commit Graph

283152 Commits

Author SHA1 Message Date
David Blaikie 0e5506838e [llvm-objdump] Use unique_ptr to simplify memory ownership
Followup to r325099/r325100 to simplify further.

llvm-svn: 325612
2018-02-20 18:48:51 +00:00
Simon Pilgrim 75853bf149 [X86][MMX] Regenerate MMX bitcast test
llvm-svn: 325611
2018-02-20 18:48:29 +00:00
Erich Keane 5e5baf59dd Correct multiversion unsupported target behavior, add a test.
Multiversioning SEMA failed to set the declaration as invalid on unsupported
targets.  This patch does that.

Additionally, I noticed that there is no test to validate this error message.
This patch adds one, and uses 'mips' as the test architecture.  

llvm-svn: 325610
2018-02-20 18:44:50 +00:00
Simon Pilgrim 2cf3769a7e [X86][3DNow] Regenerate intrinsics tests
llvm-svn: 325609
2018-02-20 18:44:21 +00:00
Sam Clegg b92b6b532f [WebAssembly] Remove unused header
This header used to be needed here for the `OutRelocation` struct
but that no longer exists.

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

llvm-svn: 325608
2018-02-20 18:40:05 +00:00
Sanjay Patel a604370004 [IRBuilder] fix CreateMaxNum to actually produce maxnum (PR36454)
The bug was introduced here:
https://reviews.llvm.org/rL296409
...but the patch doesn't use maxnum and nothing else in 
trunk has tried since then, so the bug went unnoticed.

llvm-svn: 325607
2018-02-20 18:21:43 +00:00
Krzysztof Parzyszek f9f2005f94 [Hexagon] Handle *Low8 register classes in early if-conversion
llvm-svn: 325606
2018-02-20 18:19:17 +00:00
Alexey Bataev 47dfd249f0 [SLP] Fix tests checks, NFC.
llvm-svn: 325605
2018-02-20 18:11:50 +00:00
Craig Topper df0c22fcd3 [X86] Correct SHRUNKBLEND creation to work correctly when there are multiple uses of the condition.
SimplifyDemandedBits forces the demanded mask to all 1s if the node has multiple uses, unless the AssumeSingleUse flag is set.

So previously we were only really likely to simplify something if the condition had a single use. And on the off chance we did simplify with multiple uses the demanded mask being used was all ones so there was no reason to create a shrunkblend.

This patch now checks that the condition is only used by selects first, and then sets the AssumeSingleUse flag for the simplifcation. Then we convert the selects to shrunkblend, and finally replace condition.

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

llvm-svn: 325604
2018-02-20 17:58:17 +00:00
Sam Clegg 4f61714fd6 [WebAssembly] Remove InputChunk from Symbol baseclass
Instead include InputFuction and InputSegment directly
in the subclasses that use them (DefinedFunction and
DefinedGlobal).

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

llvm-svn: 325603
2018-02-20 17:45:38 +00:00
Craig Topper 35801fa5ce [SelectionDAG] Add LegalTypes flag to getShiftAmountTy. Use it to unify and simplify DAGCombiner and simplifySetCC code and fix a bug.
DAGCombiner and SimplifySetCC both use getPointerTy for shift amounts pre-legalization. DAGCombiner uses a single helper function to hide this. SimplifySetCC does it in multiple places.

This patch adds a defaulted parameter to getShiftAmountTy that can make it return getPointerTy for scalar types. Use this parameter to simplify the SimplifySetCC and DAGCombiner.

Additionally, there were two places in SimplifySetCC that were creating shifts using the target's preferred shift amount pre-legalization. If the target uses a narrow type and the type is illegal, this can cause SimplfiySetCC to create a shift with an amount that can't represent all possible shift values for the type. To fix this we should use pointer type there too.

Alternatively we could make getScalarShiftAmountTy for each target return a safe value for large types as proposed in D43445. And maybe we should still do that, but fixing the SimplifySetCC code keeps other targets from tripping over this in the future.

Fixes PR36250.

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

llvm-svn: 325602
2018-02-20 17:41:05 +00:00
Craig Topper 010ae8dcbb [X86] Promote 16-bit cmovs to 32-bits
This allows us to avoid an opsize prefix. And forcing some move immediates to i32 avoids a length changing prefix on those instructions.

This mostly replaces the existing combine we had for zext/sext+cmov of constants. I left in a case for sign extending a 32 bit cmov of constants to 64 bits.

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

llvm-svn: 325601
2018-02-20 17:41:00 +00:00
Jonas Devlieghere 563c901bac [dsymutil] Correctly handle DW_TAG_label
This patch contains logic for handling DW_TAG_label that's present in
darwin's dsymutil implementation, but not yet upstream.

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

llvm-svn: 325600
2018-02-20 17:34:29 +00:00
Mikhail Maltsev 581a7f0bef [vim] Recognize more FileCheck comments
Summary:
Currently vim syntax highlighting recognizes 'CHECK:' as a special
comment, but not CHECK-DAG, CHECK-NOT and other CHECKs. This patch
adds rules for these comments.

Reviewers: chandlerc, compnerd, rogfer01

Reviewed By: rogfer01

Subscribers: rogfer01, llvm-commits

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

llvm-svn: 325599
2018-02-20 17:27:44 +00:00
Sam Clegg c7e885b52a [WebAssembly] Check signatures of weakly defined funtions too
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 325598
2018-02-20 17:20:44 +00:00
Sanjay Patel 29b98ae337 [InstCombine] remove unneeded dyn_cast to prevent unused variable warning
llvm-svn: 325597
2018-02-20 17:14:53 +00:00
Simon Marchi 104117abfd [clangd] Fix formatting in XRefs.cpp
This is also to test my commit access.

llvm-svn: 325596
2018-02-20 16:57:47 +00:00
Sanjay Patel b2d978682b [InstCombine] remove compound fdiv pattern folds
These are fdiv-with-constant-divisor, so they already become
reciprocal multiplies. The last gap for vector ops should be
closed with rL325590.

It's possible that we're missing folds for some edge cases 
with denormal intermediate constants after deleting these,
but there are no tests for those patterns, and it would be 
better to handle denormals more consistently (and less 
conservatively) as noted in TODO comments.

llvm-svn: 325595
2018-02-20 16:52:17 +00:00
David Blaikie 4b9bc239ee PR36442: Correct description of -fsplit-dwarf-inlining
llvm-svn: 325594
2018-02-20 16:35:08 +00:00
Kamil Rytarowski af1d48a2ff Stop linking sanitized applications with -lutil and -lkvm on NetBSD
The proper approach is to rebuild libutil and libkvm with a desired sanitizer.
An alternative approach to reimplement these functions (and other ones like
curses(3), editline(3) etc) does not scale and enforces linkage every single
binary with these libraries.

llvm-svn: 325593
2018-02-20 16:27:28 +00:00
Sanjay Patel 90f4c8ec29 [InstCombine] fold fdiv with non-splat divisor to fmul: X/C --> X * (1/C)
llvm-svn: 325590
2018-02-20 16:08:15 +00:00
Simon Dardis d3860e6670 [mips] Correct the definition of cvt.d.w
An upcoming patch D41434, changes the ordering of the matcher table
for assembly. This patch corrects the definition of the normal MIPS
cvt.d.w not to be available in microMIPS.

llvm-svn: 325589
2018-02-20 15:55:17 +00:00
Kamil Rytarowski 59a9856e06 Add new interceptor: strmode(3)
Summary:
strmode - convert inode status information into a symbolic string

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 325588
2018-02-20 15:53:30 +00:00
Kamil Rytarowski 8317565532 Add new interceptor: fgetln(3)
Summary:
fgetln - get a line from a stream

Sponsored by <The NetBSD Foundation>

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 325587
2018-02-20 15:52:08 +00:00
Kamil Rytarowski babcdb3a9a Stop intercepting forkpty(3) and openpty(3) on NetBSD
Summary:
forkpty(3) and openpty(3) are part of `-lutil` and we don't intend to reimplement
this system library in sanitizers. Everybody using these functions will need to use
a precompiled library against MSan or other desired sanitizer.

Restrict these functions to Linux-only.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 325585
2018-02-20 15:43:07 +00:00
Alexey Bataev 0d6aeadc40 [DEBUGINFO] Add support for emission of the inlined strings.
Summary:
Patch adds an option for emission of inlined strings rather than
.debug_str section.

Reviewers: echristo, jlebar

Subscribers: eraman, llvm-commits, JDevlieghere

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

llvm-svn: 325583
2018-02-20 15:28:08 +00:00
Lei Huang dfd41552f4 [PowerPC] Reduce stack frame for fastcc functions by only allocating parameter save area when needed
Current implementation always allocates the parameter save area conservatively
for fastcc functions. There is no reason to allocate the parameter save area if
all the parameters can be passed via registers.

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

llvm-svn: 325581
2018-02-20 15:09:45 +00:00
Krzysztof Parzyszek b404fae9e3 [Hexagon] Fix alignment calculation of stack objects in Hexagon bit tracker
llvm-svn: 325580
2018-02-20 14:29:43 +00:00
Simon Pilgrim 61ba223704 [X86] Regenerate XOR tests
llvm-svn: 325579
2018-02-20 14:08:39 +00:00
Simon Pilgrim 2f29afb439 [VectorLegalizer] Fix uint64_t typo in ExpandUINT_TO_FLOAT (PR36391)
ExpandUINT_TO_FLOAT can accept vXi32 or vXi64 inputs, so we need to use a uint64_t shift to generate the 2^(BW/2) constant.

No test case unfortunately as no upstream target uses this, but its affecting a downstream target.

llvm-svn: 325578
2018-02-20 13:24:24 +00:00
Hans Wennborg b18da9b122 Revert r325375 "[MS] Make constexpr static data members implicitly inline"
This broke Clang bootstrap on Windows, PR36453.

> This handles them exactly the same way that we handle const integral
> static data members with inline definitions, which is what MSVC does.
>
> As a follow-up, now that we have a way to mark variables inline in the
> AST, we should consider marking them implicitly inline there instead of
> only treating them as inline in CodeGen. Unfortunately, this breaks a
> lot of dllimport test cases, so that is future work for now.
>
> Fixes PR36125.

llvm-svn: 325576
2018-02-20 12:43:02 +00:00
Ivan A. Kosarev 124a2187ad [CodeGen] Fix generation of TBAA tags for may-alias accesses
This patch fixes creating TBAA access descriptors for
may_alias-marked access types. Currently, for such types we
generate ordinary descriptors with char as its access type. The
patch changes this to produce proper may-alias descriptors.

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

llvm-svn: 325575
2018-02-20 12:33:04 +00:00
Sam McCall 3ebf760a92 [clangd] Dump stack on crash
llvm-svn: 325574
2018-02-20 11:46:39 +00:00
David Green 056476497e [ARM] Mark -1 as cheap in xor's for thumb1
We can always convert xor %a, -1 into MVN, even in thumb 1 where the -1
would not otherwise be considered a cheap constant. This prevents the
-1's from being pulled out into constants and potentially hoisted.

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

llvm-svn: 325573
2018-02-20 11:07:35 +00:00
Gabor Horvath 76e5023dd3 [clang-tidy] Replace the usage of std::uncaught_exception with std::uncaught_exceptions
Patch by: Daniel Kolozsvari!

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

llvm-svn: 325572
2018-02-20 10:48:38 +00:00
Hans Wennborg b8f369d636 clang-cl: Make /d1PP an alias for -dD (PR36446)
llvm-svn: 325571
2018-02-20 10:47:14 +00:00
Pavel Labath a9f8b0d1a9 Avoid dirtying the source tree in breakpoint command tests
Summary:
The paralelization patch exposed a bunch of cases where we were still
touching the source tree (as these tests were now stepping on each
others toes and being flaky).

This patch removes such issues from breakpoint command tests. Since the
only reason they were creating files was to indirectly test whether the
breakpoint commands got executed (and plumbing the full build tree path
to all places that needed it would be messy) I decided to modify the
tests to check for a different side effect instead: modification of a
global variable. This also makes the code simpler as checking the value
of the global variable is easier, and there is nothing to clean up.

As the tests aren't really doing anything debug-info related, I took the
opportunity to also mark them as NO_DEBUG_INFO_TESTCASEs.

Reviewers: jingham, aprantl

Subscribers: lldb-commits

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

llvm-svn: 325570
2018-02-20 10:24:37 +00:00
George Rimar da4f43a4b4 [llvm-mc] - Produce R_X86_64_PLT32 for "call/jmp foo".
For instructions like call foo and jmp foo patch changes
relocation produced from R_X86_64_PC32 to R_X86_64_PLT32.
Relocation can be used as a marker for 32-bit PC-relative branches.
Linker will reduce PLT32 relocation to PC32 if function is defined locally.

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

llvm-svn: 325569
2018-02-20 10:17:57 +00:00
Jonas Devlieghere 65d2d5bad4 Handle typeof() expressions
Before this patch, LLDB was not able to evaluate expressions that
resulted in a value with a typeof- or decltype-type. This patch fixes
that.

Before:
  (lldb) p int i; __typeof__(i) j = 1; j
  (typeof (i)) $0 =

After:
  (lldb) p int i; __typeof__(i) j = 1; j
  (typeof (i)) $0 = 1

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

rdar://37461520

llvm-svn: 325568
2018-02-20 10:15:08 +00:00
Tim Renouf 8234b4893a [AMDGPU] stop buffer_store being moved illegally
Summary:
The machine instruction scheduler was illegally moving a buffer store
past a buffer load with the same descriptor and offset. Fixed by marking
buffer ops as mayAlias and isAliased. This may be overly conservative,
and we may need to revisit.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: Iff3173d9e0653e830474546276ab9d30318b8ef7
llvm-svn: 325567
2018-02-20 10:03:38 +00:00
Hans Wennborg b8bf5a6c85 clang-format plugin: Add missing semicolon in list of file extensions (PR36383)
llvm-svn: 325566
2018-02-20 09:26:38 +00:00
George Rimar 9712113f8b [MC] - Don't crash on unclosed frame.
llvm-mc can crash when
there is cfi_startproc without cfi_end_proc:

.text
.globl foo
foo:
 .cfi_startproc

Testcase shows the issue, patch fixes it.

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

llvm-svn: 325564
2018-02-20 09:04:13 +00:00
Gadi Haber 2cede2e229 [X86][CET]: Adding full coverage of MC encoding for the CET instructions.<NFC>
NFC.
Adding MC regressions tests to cover the CET instructions.
This patch is part of a larger task to cover MC encoding of all X86 isa sets started in revision: https://reviews.llvm.org/D39952

Reviewers: zvi, craig.topper, RKSimon, AndreiGrischenko, oren_ben_simhon
Differential Revision: https://reviews.llvm.org/D41329

Change-Id: I9c133d4ba07508ce8fd738a1230edd586e2c2f1b
llvm-svn: 325561
2018-02-20 08:00:31 +00:00
Craig Topper 0a70c3c7af [X86] Remove mask from 512 bit pmulhrsw/pmulhw/pmulhuw builtins.
We now use a vselect node in IR around an unmasked builtin. This makes it consistent with the 128 and 256 bit versions.

llvm-svn: 325560
2018-02-20 07:28:18 +00:00
Craig Topper 9256ac1a58 [X86] Add 512-bit unmasked pmulhrsw/pmulhw/pmulhuw intrinsics. Remove and auto upgrade 128/256/512 bit masked pmulhrsw/pmulhw/pmulhuw intrinsics.
The 128 and 256 bit versions were already not used by clang. This adds an equivalent unmasked 512 bit version. Then autoupgrades all sizes to use unmasked intrinsics plus select.

llvm-svn: 325559
2018-02-20 07:28:14 +00:00
Tobias Grosser 718d04c653 Use isl::manage_copy to simplify calls to isl::manage(isl_.._copy())
As part of this cleanup a couple of unnecessary isl::manage(obj.copy()) pattern
are eliminated as well.

We checked for all potential cleanups by scanning for:

  "grep -R isl::manage\( lib/ | grep copy"

llvm-svn: 325558
2018-02-20 07:26:58 +00:00
Tobias Grosser fa8079d0dc Update isl to isl-0.18-1047-g4a20ef8
This update:

  - Removes several deprecated functions (e.g., isl_band).
  - Improves the pretty-printing of sets by detecting modulos and "false"
    equalities.
  - Minor improvements to coalescing and increased robustness of the isl
    scheduler.

This update does not yet include isl commit isl-0.18-90-gd00cb45
(isl_pw_*_alloc: add missing check for compatible spaces, Wed Sep 6 12:18:04
2017 +0200), as this additional check is too tight and unfortunately causes
two test case failures in Polly. A patch has been submitted to isl and will be
included in the next isl update for Polly.

llvm-svn: 325557
2018-02-20 07:26:42 +00:00
Tobias Grosser 85476dc45a Fix broken isl-noexceptions.h path in update-isl script
llvm-svn: 325556
2018-02-20 07:24:58 +00:00
Tobias Grosser ba4257b187 Update isl C++ bindings to latest version of isl
llvm-svn: 325555
2018-02-20 07:24:55 +00:00
Tobias Grosser 5f62fafadd Do not call band_list().dump()
This is in preparation for the removal of band_list from isl.

llvm-svn: 325554
2018-02-20 07:24:40 +00:00