platform/upstream/llvm.git
5 years agoPortable Python script across Python version
Serge Guelton [Thu, 13 Dec 2018 07:45:55 +0000 (07:45 +0000)]
Portable Python script across Python version

SocketServer has been renamed socketserver in Python3.

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

llvm-svn: 349010

5 years agoPortable Python script across Python version
Serge Guelton [Thu, 13 Dec 2018 07:44:19 +0000 (07:44 +0000)]
Portable Python script across Python version

Queue module as been renamed into queue in Python3

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

llvm-svn: 349009

5 years agoPortable Python script across Python version
Serge Guelton [Thu, 13 Dec 2018 07:42:30 +0000 (07:42 +0000)]
Portable Python script across Python version

Use higher-level and more compatible threading module to start a new thread.

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

llvm-svn: 349008

5 years ago[X86] Remove assert leftover from when i1 was a legal type. Add more accurate assert...
Craig Topper [Thu, 13 Dec 2018 06:14:25 +0000 (06:14 +0000)]
[X86] Remove assert leftover from when i1 was a legal type. Add more accurate assert. NFC

llvm-svn: 349007

5 years ago[AMDGPU] Fix build failure, second attempt
Stanislav Mekhanoshin [Thu, 13 Dec 2018 05:52:11 +0000 (05:52 +0000)]
[AMDGPU] Fix build failure, second attempt

Some compilers complain that variable is captured and some
complain when it is not. Switch to [&].

llvm-svn: 349006

5 years ago[AMDGPU] Fix build failure
Stanislav Mekhanoshin [Thu, 13 Dec 2018 05:21:25 +0000 (05:21 +0000)]
[AMDGPU] Fix build failure

Fixed error 'lambda capture 'CondReg' is not required to be captured
for this use'.

llvm-svn: 349005

5 years ago[clang] Add AST matcher for block expressions 🔍
Stephane Moore [Thu, 13 Dec 2018 03:35:10 +0000 (03:35 +0000)]
[clang] Add AST matcher for block expressions 🔍

Summary:
This change adds a new AST matcher for block expressions.

Test Notes:
Ran the clang unit tests.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 349004

5 years ago[AMDGPU] Simplify negated condition
Stanislav Mekhanoshin [Thu, 13 Dec 2018 03:17:40 +0000 (03:17 +0000)]
[AMDGPU] Simplify negated condition

Optimize sequence:

  %sel = V_CNDMASK_B32_e64 0, 1, %cc
  %cmp = V_CMP_NE_U32 1, %1
  $vcc = S_AND_B64 $exec, %cmp
  S_CBRANCH_VCC[N]Z
=>
  $vcc = S_ANDN2_B64 $exec, %cc
  S_CBRANCH_VCC[N]Z

It is the negation pattern inserted by DAGCombiner::visitBRCOND() in the
rebuildSetCC().

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

llvm-svn: 349003

5 years agoRevert r348645 - "[MemCpyOpt] memset->memcpy forwarding with undef tail"
David L. Jones [Thu, 13 Dec 2018 03:15:11 +0000 (03:15 +0000)]
Revert r348645 - "[MemCpyOpt] memset->memcpy forwarding with undef tail"

This revision caused trucated memsets for structs with padding. See:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181210/610520.html

llvm-svn: 349002

5 years agoRemove unused Args parameter from EmitFunctionBody, NFC
Reid Kleckner [Thu, 13 Dec 2018 01:33:20 +0000 (01:33 +0000)]
Remove unused Args parameter from EmitFunctionBody, NFC

llvm-svn: 349001

5 years ago[analyzer] RunLoopAutoreleaseLeakChecker: Come up with a test for r348822.
Artem Dergachev [Thu, 13 Dec 2018 01:30:47 +0000 (01:30 +0000)]
[analyzer] RunLoopAutoreleaseLeakChecker: Come up with a test for r348822.

Statement memoization was removed in r348822 because it was noticed to cause
memory corruption. This was happening because a reference to an object
in a DenseMap was used after being invalidated by inserting a new key
into the map.

This test case crashes reliably under ASan (i.e., when Clang is built with
-DLLVM_USE_SANITIZER="Address") on at least some machines before r348822
and doesn't crash after it.

llvm-svn: 349000

5 years ago[LoopUtils] Prefer a set over a map. NFCI.
Davide Italiano [Thu, 13 Dec 2018 01:11:52 +0000 (01:11 +0000)]
[LoopUtils] Prefer a set over a map. NFCI.

llvm-svn: 348999

5 years ago[test] Add a set of test for constant folding deopt operands with CVP
Philip Reames [Thu, 13 Dec 2018 00:54:05 +0000 (00:54 +0000)]
[test] Add a set of test for constant folding deopt operands with CVP

For anyone curious, the first test example is illustrative of a real code idiom produced by branching on the result of a three way comparison.

llvm-svn: 348997

5 years ago[NFC] Small code cleanups in utility.
Jonas Devlieghere [Thu, 13 Dec 2018 00:15:17 +0000 (00:15 +0000)]
[NFC] Small code cleanups in utility.

Fix a few small annoyances in Utility I ran into.

llvm-svn: 348996

5 years ago[Support] Fix FileNameLength passed to SetFileInformationByHandle
Shoaib Meenai [Thu, 13 Dec 2018 00:08:25 +0000 (00:08 +0000)]
[Support] Fix FileNameLength passed to SetFileInformationByHandle

The rename_internal function used for Windows has a minor bug where the
filename length is passed as a character count instead of a byte count.
Windows internally ignores this field, but other tools that hook NT
api's may use the documented behavior:

MSDN documentation specifying the size should be in bytes:
https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_rename_info

Patch by Ben Hillis.

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

llvm-svn: 348995

5 years ago[libcxx] Add assertion in deque::pop_back when popping from an empty deque
Louis Dionne [Wed, 12 Dec 2018 23:58:25 +0000 (23:58 +0000)]
[libcxx] Add assertion in deque::pop_back when popping from an empty deque

Also, add tests making sure that vector and deque both catch the problem
when assertions are enabled. Otherwise, deque would segfault and vector
would never terminate.

llvm-svn: 348994

5 years ago[gn build] Fix defines define on Windows
Shoaib Meenai [Wed, 12 Dec 2018 23:57:21 +0000 (23:57 +0000)]
[gn build] Fix defines define on Windows

On Windows, we won't go into the `host_os != "win"` block, so `defines`
won't have been defined, and we'll run into an undefined identifier
error when we try to later append to it. Unconditionally define it at
the start and append to it everywhere else.

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

llvm-svn: 348993

5 years ago[globalisel] Add GISelChangeObserver::changingInstr()
Daniel Sanders [Wed, 12 Dec 2018 23:48:13 +0000 (23:48 +0000)]
[globalisel] Add GISelChangeObserver::changingInstr()

Summary:
In addition to knowing that an instruction is changed. It's also useful to
know when it's about to change. For example, it might print the instruction so
you can track the changes in a debug log, it might remove it from some queue
while it's being worked on, or it might want to change several instructions as
a single transaction and act on all the changes at once.

Added changingInstr() to all existing uses of changedInstr()

Reviewers: aditya_nandakumar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 348992

5 years agoEmit a proper diagnostic when attempting to forward inalloca arguments
Reid Kleckner [Wed, 12 Dec 2018 23:46:06 +0000 (23:46 +0000)]
Emit a proper diagnostic when attempting to forward inalloca arguments

The previous assertion was relatively easy to trigger, and likely will
be easy to trigger going forward. EmitDelegateCallArg is relatively
popular.

This cleanly diagnoses PR28299 while I work on a proper solution.

llvm-svn: 348991

5 years ago[WebAssembly] Add "needed" list to dylink section
Sam Clegg [Wed, 12 Dec 2018 23:44:59 +0000 (23:44 +0000)]
[WebAssembly] Add "needed" list to dylink section

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

llvm-svn: 348990

5 years ago[WebAssembly] Update dylink section parsing
Sam Clegg [Wed, 12 Dec 2018 23:40:58 +0000 (23:40 +0000)]
[WebAssembly] Update dylink section parsing

This updates the format of the dylink section in accordance with
recent "spec" change:
  https://github.com/WebAssembly/tool-conventions/pull/77

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

llvm-svn: 348989

5 years ago[LoopDeletion] Update debug values after loop deletion.
Davide Italiano [Wed, 12 Dec 2018 23:32:35 +0000 (23:32 +0000)]
[LoopDeletion] Update debug values after loop deletion.

When loops are deleted, we don't keep track of variables modified inside
the loops, so the DI will contain the wrong value for these.

e.g.

int b() {

int i;
for (i = 0; i < 2; i++)
  ;
patatino();
return a;
-> 6 patatino();

7     return a;
8   }
9   int main() { b(); }
(lldb) frame var i
(int) i = 0

We mark instead these values as unavailable inserting a
@llvm.dbg.value(undef to make sure we don't end up printing an incorrect
value in the debugger. We could consider doing something fancier,
for, e.g. constants, in the future.

PR39868.
rdar://problem/46418795)

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

llvm-svn: 348988

5 years ago[InstCombine] Fix negative GEP offset evaluation for 32-bit pointers
Nikita Popov [Wed, 12 Dec 2018 23:19:03 +0000 (23:19 +0000)]
[InstCombine] Fix negative GEP offset evaluation for 32-bit pointers

This fixes https://bugs.llvm.org/show_bug.cgi?id=39908.

The evaluateGEPOffsetExpression() function simplifies GEP offsets for
use in comparisons against zero, basically by converting X*Scale+Offset==0
to X+Offset/Scale==0 if Scale divides Offset. However, before this is done,
Offset is masked down to the pointer size. This results in incorrect
results for negative Offsets, because we basically end up dividing the
32-bit offset *zero* extended to 64-bit bits (rather than sign extended).

Fix this by explicitly sign extending the truncated value.

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

llvm-svn: 348987

5 years ago[hwasan] Link ubsan_cxx to shared runtime library.
Evgeniy Stepanov [Wed, 12 Dec 2018 22:56:00 +0000 (22:56 +0000)]
[hwasan] Link ubsan_cxx to shared runtime library.

Summary: This is needed for C++-specific ubsan and cfi error reporting to work.

Reviewers: kcc, vitalybuka

Subscribers: srhines, kubamracek, mgorny, llvm-commits

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

llvm-svn: 348986

5 years ago[llvm-objcopy] Change Segment::Type from uint64_t to uint32_t
Fangrui Song [Wed, 12 Dec 2018 22:46:37 +0000 (22:46 +0000)]
[llvm-objcopy] Change Segment::Type from uint64_t to uint32_t

Summary:
In both Elf{32,64}_Phdr, the field Elf{32,64}_World p_type is uint32_t.

Also reorder the fields to be similar to Elf64_Phdr (which is different
from Elf32_Phdr but quite similar).

Reviewers: rupprecht, jhenderson, jakehehrlich, alexshap, espindola

Reviewed By: rupprecht

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 348985

5 years agoSwitch Android from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)
Ryan Prichard [Wed, 12 Dec 2018 22:45:12 +0000 (22:45 +0000)]
Switch Android from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)

Summary:
The TLS_SLOT_TSAN slot is available starting in N, but its location (8)
is incompatible with the proposed solution for implementing ELF TLS on
Android (i.e. bump ARM/AArch64 alignment to reserve an 8-word TCB).

Instead, starting in Q, Bionic replaced TLS_SLOT_DLERROR(6) with
TLS_SLOT_SANITIZER(6). Switch compiler-rt to the new slot.

Reviewers: eugenis, srhines, enh

Reviewed By: eugenis

Subscribers: ruiu, srhines, kubamracek, javed.absar, kristof.beyls, delcypher, llvm-commits, #sanitizers

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

llvm-svn: 348984

5 years ago[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)
Ryan Prichard [Wed, 12 Dec 2018 22:45:06 +0000 (22:45 +0000)]
[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)

Summary:
The change is needed to support ELF TLS in Android. See D55581 for the
same change in compiler-rt.

Reviewers: srhines, eugenis

Reviewed By: eugenis

Subscribers: srhines, llvm-commits

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

llvm-svn: 348983

5 years agoRevert "Declares __cpu_model as dso local"
Haibo Huang [Wed, 12 Dec 2018 22:39:51 +0000 (22:39 +0000)]
Revert "Declares __cpu_model as dso local"

This reverts r348978

llvm-svn: 348982

5 years agoAvoid code duplication in the SEH version of UnwindCursor::getRegisterName. NFC.
Martin Storsjo [Wed, 12 Dec 2018 22:24:42 +0000 (22:24 +0000)]
Avoid code duplication in the SEH version of UnwindCursor::getRegisterName. NFC.

This requires making Registers_*::getRegisterName static.

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

llvm-svn: 348981

5 years ago[PhaseOrdering] add test for funnel shift (rotate); NFC
Sanjay Patel [Wed, 12 Dec 2018 22:11:05 +0000 (22:11 +0000)]
[PhaseOrdering] add test for funnel shift (rotate); NFC

As mentioned in D55604, there are 2 bugs here:
1. The new pass manager is speculating wildly by default.
2. The old pass manager is not converting this to funnel shift.

llvm-svn: 348980

5 years ago[hwasan] Verify Android TLS slot at startup.
Evgeniy Stepanov [Wed, 12 Dec 2018 22:10:52 +0000 (22:10 +0000)]
[hwasan] Verify Android TLS slot at startup.

Summary:
Add a check that TLS_SLOT_TSAN / TLS_SLOT_SANITIZER, whichever
android_get_tls_slot is using, is not conflicting with
TLS_SLOT_DLERROR.

Reviewers: rprichard, vitalybuka

Subscribers: srhines, kubamracek, llvm-commits

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

llvm-svn: 348979

5 years agoDeclares __cpu_model as dso local
Haibo Huang [Wed, 12 Dec 2018 22:04:12 +0000 (22:04 +0000)]
Declares __cpu_model as dso local

__builtin_cpu_supports and __builtin_cpu_is use information in __cpu_model to decide cpu features. Before this change, __cpu_model was not declared as dso local. The generated code looks up the address in GOT when reading __cpu_model. This makes it impossible to use these functions in ifunc, because at that time GOT entries have not been relocated. This change makes it dso local.

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

llvm-svn: 348978

5 years ago[AST] Store "UsesADL" information in CallExpr.
Eric Fiselier [Wed, 12 Dec 2018 21:50:55 +0000 (21:50 +0000)]
[AST] Store "UsesADL" information in CallExpr.

Summary:
Currently the Clang AST doesn't store information about how the callee of a CallExpr was found. Specifically if it was found using ADL.

However, this information is invaluable to tooling. Consider a tool which renames usages of a function. If the originally CallExpr was formed using ADL, then the tooling may need to additionally qualify the replacement.
Without information about how the callee was found, the tooling is left scratching it's head. Additionally, we want to be able to match ADL calls as quickly as possible, which means avoiding computing the answer on the fly.

This patch changes `CallExpr` to store whether it's callee was found using ADL. It does not change the size of any AST nodes.

Reviewers: fowles, rsmith, klimek, shafik

Reviewed By: rsmith

Subscribers: aaron.ballman, riccibruno, calabrese, titus, cfe-commits

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

llvm-svn: 348977

5 years ago[globalisel] Rename GISelChangeObserver's erasedInstr() to erasingInstr() and related...
Daniel Sanders [Wed, 12 Dec 2018 21:32:01 +0000 (21:32 +0000)]
[globalisel] Rename GISelChangeObserver's erasedInstr() to erasingInstr() and related nits. NFC

Summary:
There's little of interest that can be done to an already-erased instruction.
You can't inspect it, write it to a debug log, etc. It ought to be notification
that we're about to erase it. Rename the function to clarify the timing of the
event and reflect current usage.

Also fixed one case where we were trying to print an erased instruction.

Reviewers: aditya_nandakumar

Reviewed By: aditya_nandakumar

Subscribers: rovka, kristof.beyls, llvm-commits

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

llvm-svn: 348976

5 years ago[X86] Don't emit MULX by default with BMI2
Craig Topper [Wed, 12 Dec 2018 21:21:31 +0000 (21:21 +0000)]
[X86] Don't emit MULX by default with BMI2

MULX has somewhat improved register allocation constraints compared to the legacy MUL instruction. Both output registers are encoded instead of fixed to EAX/EDX, but EDX is used as input. It also doesn't touch flags. Unfortunately, the encoding is longer.

Prefering it whenever BMI2 is enabled is probably not optimal. Choosing it should somehow be a function of register allocation constraints like converting adds to three address. gcc and icc definitely don't pick MULX by default. Not sure what if any rules they have for using it.

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

llvm-svn: 348975

5 years agoFix for llvm-dwarfdump changes for subroutine types
David Blaikie [Wed, 12 Dec 2018 21:15:48 +0000 (21:15 +0000)]
Fix for llvm-dwarfdump changes for subroutine types

llvm-svn: 348974

5 years ago[test] [depr.c.headers] XFAIL uchar.h on NetBSD
Michal Gorny [Wed, 12 Dec 2018 20:51:46 +0000 (20:51 +0000)]
[test] [depr.c.headers] XFAIL uchar.h on NetBSD

llvm-svn: 348973

5 years ago[X86] Move stack folding test for MULX to a MIR test. Add a MULX32 case as well
Craig Topper [Wed, 12 Dec 2018 20:50:24 +0000 (20:50 +0000)]
[X86] Move stack folding test for MULX to a MIR test. Add a MULX32 case as well

A future patch may stop using MULX by default so use MIR to ensure we're always testing MULX.

Add the 32-bit case that we couldn't do in the 64-bit mode IR test due to it being promoted to a 64-bit mul.

llvm-svn: 348972

5 years ago[AMDGPU] Support for "uniform-work-group-size" attribute
Aakanksha Patil [Wed, 12 Dec 2018 20:49:17 +0000 (20:49 +0000)]
[AMDGPU] Support for "uniform-work-group-size" attribute

Updated the annotate-kernel-features pass to support the propagation of uniform-work-group attribute from the kernel to the called functions. Once this pass is run, all kernels, even the ones which initially did not have the attribute, will be able to indicate weather or not they have uniform work group size depending on the value of the attribute.

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

llvm-svn: 348971

5 years agoSupport: use internal `call_once` on PPC64le
Saleem Abdulrasool [Wed, 12 Dec 2018 20:35:47 +0000 (20:35 +0000)]
Support: use internal `call_once` on PPC64le

Use the replacement execute once threading support in LLVM for PPC64le.  It
seems that GCC does not define `__ppc__` and so we would actually call out to
the C++ runtime there which is not what the current code intended.  Check both
`__ppc__` and `__PPC__`.  This avoids the need for checking the endianness.

Thanks to nemanjai for the hint about GCC's behaviour and the fact that the
reviewed condition could be simplified.

Original patch by Sarvesh Tamba!

llvm-svn: 348970

5 years agoTeach __builtin_unpredictable to work through implicit casts.
Erich Keane [Wed, 12 Dec 2018 20:30:53 +0000 (20:30 +0000)]
Teach __builtin_unpredictable to work through implicit casts.

The __builtin_unpredictable implementation is confused by any implicit
casts, which happen in C++.  This patch strips those off so that
if/switch statements now work with it in C++.

Change-Id: I73c3bf4f1775cd906703880944f4fcdc29fffb0a
llvm-svn: 348969

5 years ago[test] [filesystems] NetBSD can do symlink permissions too
Michal Gorny [Wed, 12 Dec 2018 20:28:52 +0000 (20:28 +0000)]
[test] [filesystems] NetBSD can do symlink permissions too

llvm-svn: 348968

5 years ago[test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSD
Michal Gorny [Wed, 12 Dec 2018 20:20:15 +0000 (20:20 +0000)]
[test] [filesystems] Extend FreeBSD tv_sec==-1 workaround to NetBSD

NetBSD also uses tv_sec==-1 as error status indicator, and does not
support setting such a value.

llvm-svn: 348967

5 years ago[X86] Added missing constant pool checks. NFCI.
Simon Pilgrim [Wed, 12 Dec 2018 19:56:38 +0000 (19:56 +0000)]
[X86] Added missing constant pool checks. NFCI.

So the extra checks in D55600 don't look like a regression.

llvm-svn: 348966

5 years agoDebugInfo/DWARF: Pretty print subroutine types
David Blaikie [Wed, 12 Dec 2018 19:53:03 +0000 (19:53 +0000)]
DebugInfo/DWARF: Pretty print subroutine types

Doesn't handle varargs and other fun things, but it's a start. (also
doesn't print these strictly as valid C++ when it's a pointer to
function, it'll print as "void(int)*" instead of "void (*)(int)")

llvm-svn: 348965

5 years ago[AMDGPU] Emit MessagePack HSA Metadata for v3 code object
Scott Linder [Wed, 12 Dec 2018 19:39:27 +0000 (19:39 +0000)]
[AMDGPU] Emit MessagePack HSA Metadata for v3 code object

Continue to present HSA metadata as YAML in ASM and when output by tools
(e.g. llvm-readobj), but encode it in Messagepack in the code object.

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

llvm-svn: 348963

5 years agoDebugInfo/DWARF: Improve dumping of pointers to members ('int foo::*' rather than...
David Blaikie [Wed, 12 Dec 2018 19:34:02 +0000 (19:34 +0000)]
DebugInfo/DWARF: Improve dumping of pointers to members ('int foo::*' rather than 'int*')

llvm-svn: 348962

5 years agoDebugInfo/DWARF: Refactor type dumping to dump types, rather than DIEs that reference...
David Blaikie [Wed, 12 Dec 2018 19:33:08 +0000 (19:33 +0000)]
DebugInfo/DWARF: Refactor type dumping to dump types, rather than DIEs that reference types

This lays the foundation for dumping types not referenced by DW_AT_type
attributes (in the near-term, that'll be DW_AT_containing_type for a
DW_TAG_ptr_to_member_type - in the future, potentially dumping the
pretty printed name next to the DW_TAG for the type, rather than only
when the type is referenced from elsewhere)

llvm-svn: 348961

5 years agoDebugInfo/DWARF: Refactor getAttributeValueAsReferencedDie to accept a DWARFFormValue
David Blaikie [Wed, 12 Dec 2018 19:23:55 +0000 (19:23 +0000)]
DebugInfo/DWARF: Refactor getAttributeValueAsReferencedDie to accept a DWARFFormValue

Save searching for the attribute again when you already have the
DWARFFormValue at hand.

llvm-svn: 348960

5 years ago[X86] Emit SBB instead of SETCC_CARRY from LowerSELECT. Break false dependency on...
Craig Topper [Wed, 12 Dec 2018 19:20:21 +0000 (19:20 +0000)]
[X86] Emit SBB instead of SETCC_CARRY from LowerSELECT. Break false dependency on the SBB input.

I'm hoping we can just replace SETCC_CARRY with SBB. This is another step towards that.

I've explicitly used zero as the input to the setcc to avoid a false dependency that we've had with the SETCC_CARRY. I changed one of the patterns that used NEG to instead use an explicit compare with 0 on the LHS. We needed the zero anyway to avoid the false dependency. The negate would clobber its input register. By using a CMP we can avoid that which could be useful.

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

llvm-svn: 348959

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Wed, 12 Dec 2018 19:01:39 +0000 (19:01 +0000)]
Fix Wdocumentation warning. NFCI.

llvm-svn: 348958

5 years ago[ConstantFold] Use getMinSignedBits for APInt in isIndexInRangeOfArrayType.
Florian Hahn [Wed, 12 Dec 2018 18:55:14 +0000 (18:55 +0000)]
[ConstantFold] Use getMinSignedBits for APInt in isIndexInRangeOfArrayType.

Indices for getelementptr can be signed so we should use
getMinSignedBits instead of getActiveBits here. The function later calls
getSExtValue to get the int64_t value, which also checks
getMinSignedBits.

This fixes  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11647.

Reviewers: mssimpso, efriedma, davide

Reviewed By: efriedma

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

llvm-svn: 348957

5 years ago[X86] Added missing constant pool checks. NFCI.
Simon Pilgrim [Wed, 12 Dec 2018 18:53:12 +0000 (18:53 +0000)]
[X86] Added missing constant pool checks. NFCI.

So the extra checks in D55600 don't look like a regression.

llvm-svn: 348956

5 years agoUpdate for an llvm-dwarfdump change in output
David Blaikie [Wed, 12 Dec 2018 18:46:43 +0000 (18:46 +0000)]
Update for an llvm-dwarfdump change in output

llvm-svn: 348955

5 years agollvm-dwarfdump: Dump array dimensions in stringified type names
David Blaikie [Wed, 12 Dec 2018 18:46:25 +0000 (18:46 +0000)]
llvm-dwarfdump: Dump array dimensions in stringified type names

llvm-svn: 348954

5 years ago[SelectionDAG] Add a generic isSplatValue function
Simon Pilgrim [Wed, 12 Dec 2018 18:32:29 +0000 (18:32 +0000)]
[SelectionDAG] Add a generic isSplatValue function

This patch introduces a generic function to determine whether a given vector type is known to be a splat value for the specified demanded elements, recursing up the DAG looking for BUILD_VECTOR or VECTOR_SHUFFLE splat patterns.

It also keeps track of the elements that are known to be UNDEF - it returns true if all the demanded elements are UNDEF (as this may be useful under some circumstances), so this needs to be handled by the caller.

A wrapper variant is also provided that doesn't take the DemandedElts or UndefElts arguments for cases where we just want to know if the SDValue is a splat or not (with/without UNDEFS).

I had hoped to completely remove the X86 local version of this function, but I'm seeing some regressions in shift/rotate codegen that will take a little longer to fix and I hope to get this in sooner so I can continue work on PR38243 which needs more capable splat detection.

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

llvm-svn: 348953

5 years ago[NVPTX] do not rely on cached subtarget info.
Artem Belevich [Wed, 12 Dec 2018 18:31:04 +0000 (18:31 +0000)]
[NVPTX] do not rely on cached subtarget info.
If a module has function references, but no functions
themselves, we may end up never calling runOnMachineFunction
and therefore would never initialize nvptxSubtarget field
which would eventually cause a crash.

Instead of relying on nvptxSubtarget being initialized by
one of the methods, retrieve subtarget info directly.

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

llvm-svn: 348952

5 years agoNFC: fix compiler warning about code never being executed when compiling on non windo...
Greg Clayton [Wed, 12 Dec 2018 18:14:27 +0000 (18:14 +0000)]
NFC: fix compiler warning about code never being executed when compiling on non windows platform.

llvm-svn: 348951

5 years agoChange CallGraph print to show the fully qualified name
Erich Keane [Wed, 12 Dec 2018 18:11:36 +0000 (18:11 +0000)]
Change CallGraph print to show the fully qualified name

CallGraph previously would just show the normal name of a function,
which gets really confusing when using it on large C++ projects.  This
patch switches the printName call to a printQualifiedName, so that the
namespaces are included.

Change-Id: Ie086d863f6b2251be92109ea1b0946825b28b49a
llvm-svn: 348950

5 years ago[LV] Fix signed/unsigned comparison warning.
Michael Kruse [Wed, 12 Dec 2018 18:07:19 +0000 (18:07 +0000)]
[LV] Fix signed/unsigned comparison warning.

llvm-svn: 348949

5 years ago[gn build] Merge r348944
Nico Weber [Wed, 12 Dec 2018 18:04:57 +0000 (18:04 +0000)]
[gn build] Merge r348944

llvm-svn: 348948

5 years ago[docs] Use correct ending quotes.
Michael Kruse [Wed, 12 Dec 2018 17:59:01 +0000 (17:59 +0000)]
[docs] Use correct ending quotes.

llvm-svn: 348947

5 years ago[x86] allow 8-bit adds to be promoted by convertToThreeAddress() to form LEA
Sanjay Patel [Wed, 12 Dec 2018 17:58:27 +0000 (17:58 +0000)]
[x86] allow 8-bit adds to be promoted by convertToThreeAddress() to form LEA

This extends the code that handles 16-bit add promotion to form LEA to also allow 8-bit adds.
That allows us to combine add ops with register moves and save some instructions. This is
another step towards allowing add truncation in generic DAGCombiner (see D54640).

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

llvm-svn: 348946

5 years ago[gn build] Add all non-test build files for lld
Nico Weber [Wed, 12 Dec 2018 17:57:10 +0000 (17:57 +0000)]
[gn build] Add all non-test build files for lld

Version.inc.in processing has a potentially interesting part which I've punted
on for now (LLD_REVISION and LLD_REPOSITORY are set to empty strings for now).

lld now builds in the gn build. But no symlinks to it are created yet, so it
can't be meaningfully run yet.

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

llvm-svn: 348945

5 years ago[Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.
Michael Kruse [Wed, 12 Dec 2018 17:32:52 +0000 (17:32 +0000)]
[Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.

When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g.

    #pragma clang loop unroll_and_jam(enable)
    #pragma clang loop distribute(enable)

is the same as

    #pragma clang loop distribute(enable)
    #pragma clang loop unroll_and_jam(enable)

and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used.

This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance,

    !0 = !{!0, !1, !2}
    !1 = !{!"llvm.loop.unroll_and_jam.enable"}
    !2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3}
    !3 = !{!"llvm.loop.distribute.enable"}

defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop.

Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account.

For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations.

Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated.

To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied.

With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling).

Reviewed By: hfinkel, dmgreen

Differential Revision: https://reviews.llvm.org/D49281
Differential Revision: https://reviews.llvm.org/D55288

llvm-svn: 348944

5 years ago[Driver] Add support for -fembed-bitcode for assembly file
Steven Wu [Wed, 12 Dec 2018 17:30:16 +0000 (17:30 +0000)]
[Driver] Add support for -fembed-bitcode for assembly file

Summary:
Handle -fembed-bitcode for assembly inputs. When the input file is
assembly, write a marker as "__LLVM,__asm" section.

Fix llvm.org/pr39659

Reviewers: compnerd, dexonsmith

Reviewed By: compnerd

Subscribers: rjmccall, dblaikie, jkorous, cfe-commits

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

llvm-svn: 348943

5 years agoMake clang::CallGraph look into template instantiations
Erich Keane [Wed, 12 Dec 2018 17:22:52 +0000 (17:22 +0000)]
Make clang::CallGraph look into template instantiations

Clang's CallGraph analysis doesn't use the RecursiveASTVisitor's setting
togo into template instantiations.  The result is that anything wanting
to do call graph analysis ends up missing any template function calls.

Change-Id: Ib4af44ed59f15d43f37af91622a203146a3c3189
llvm-svn: 348942

5 years ago[ast] CreateParameterDeclaration should use an appropriate DeclContext.
Zachary Turner [Wed, 12 Dec 2018 17:17:53 +0000 (17:17 +0000)]
[ast] CreateParameterDeclaration should use an appropriate DeclContext.

Previously CreateParameterDeclaration was always using the translation
unit DeclContext.  We would later go and add parameters to the
FunctionDecl, but internally clang makes a copy when you do this, and
we'd end up with ParmVarDecl's at the global scope as well as in the
function scope.

This fixes the issue.  It's hard to say whether this will introduce
a behavioral change in name lookup, but I know there have been several
hacks introduced in previous years to deal with collisions between
various types of variables, so there's a chance that this patch could
obviate one of those hacks.

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

llvm-svn: 348941

5 years ago[SampleFDO] Extend profile-sample-accurate option to cover isFunctionColdInCallGraph
Wei Mi [Wed, 12 Dec 2018 17:09:27 +0000 (17:09 +0000)]
[SampleFDO] Extend profile-sample-accurate option to cover isFunctionColdInCallGraph

For SampleFDO, when a callsite doesn't appear in the profile, it will not be marked as cold callsite unless the option -profile-sample-accurate is specified.

But profile-sample-accurate doesn't cover function isFunctionColdInCallGraph which is used to decide whether a function should be put into text.unlikely section, so even if the user knows the profile is accurate and specifies profile-sample-accurate, those functions not appearing in the sample profile are still not be put into text.unlikely section right now.

The patch fixes that.

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

llvm-svn: 348940

5 years agoBasic: make `int_least64_t` and `int_fast64_t` match on Darwin
Saleem Abdulrasool [Wed, 12 Dec 2018 17:05:20 +0000 (17:05 +0000)]
Basic: make `int_least64_t` and `int_fast64_t` match on Darwin

The Darwin targets use `int64_t` and `uint64_t` to define the `int_least64_t`
and `int_fast64_t` types.  The underlying type is actually a `long long`.  Match
the types to allow the printf specifiers to work properly and have the compiler
vended macros match the implementation on the target.

llvm-svn: 348939

5 years ago[ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types
Hubert Tong [Wed, 12 Dec 2018 16:53:43 +0000 (16:53 +0000)]
[ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types

Summary:
`memchr` and `memcmp` operate upon the character units of the object
representation; that is, the `size_t` parameter expresses the number of
character units. The constant folding implementation is updated in this
patch to account for multibyte element types in the arrays passed to
`memchr`/`memcmp` and, in the case of `memcmp`, to account for the
possibility that the arrays may have differing element types (even when
they are byte-sized).

Actual inspection of the object representation is not implemented.
Comparisons are done only between elements with the same object size;
that is, `memchr` will fail when inspecting at least one character unit
of a multibyte element. The integer types are assumed to have two's
complement representation with 0 for `false`, 1 for `true`, and no
padding bits.

`memcmp` on multibyte elements will only be able to fold in cases where
enough elements are equal for the answer to be 0.

Various tests are added to guard against incorrect folding for cases
that miscompile on some system or other prior to this patch. At the same
time, the unsigned 32-bit `wchar_t` testing in
`test/SemaCXX/constexpr-string.cpp` is restored.

Reviewers: rsmith, aaron.ballman, hfinkel

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 348938

5 years ago[AMDGPU] Extend the SI Load/Store optimizer to combine more things.
Neil Henning [Wed, 12 Dec 2018 16:15:21 +0000 (16:15 +0000)]
[AMDGPU] Extend the SI Load/Store optimizer to combine more things.

I've extended the load/store optimizer to be able to produce dwordx3
loads and stores, This change allows many more load/stores to be combined,
and results in much more optimal code for our hardware.

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

llvm-svn: 348937

5 years agoELF: Clean up section type computation
Pavel Labath [Wed, 12 Dec 2018 15:46:18 +0000 (15:46 +0000)]
ELF: Clean up section type computation

Move code into a separate function, and replace the if-else chain with
llvm::StringSwitch.

A slight behavioral change is that now I use the section flags
(SHF_TLS) instead of the section name to set the thread-specific
property. There is no explanation in the original commit introducing
this (r153537) as to why that was done this way, but the new behavior
should be more correct.

llvm-svn: 348936

5 years ago[mips] Enable using of integrated assembler in all cases.
Simon Atanasyan [Wed, 12 Dec 2018 15:32:25 +0000 (15:32 +0000)]
[mips] Enable using of integrated assembler in all cases.

llvm-svn: 348935

5 years ago[mips] Enable using of integrated assembler in all cases.
Simon Atanasyan [Wed, 12 Dec 2018 15:32:03 +0000 (15:32 +0000)]
[mips] Enable using of integrated assembler in all cases.

llvm-svn: 348934

5 years ago[AggressiveInstCombine] add tests for rotates with branch; NFC
Sanjay Patel [Wed, 12 Dec 2018 15:28:21 +0000 (15:28 +0000)]
[AggressiveInstCombine] add tests for rotates with branch; NFC

llvm-svn: 348933

5 years agoRemove TODO leftover from my devleopment branch
Erich Keane [Wed, 12 Dec 2018 15:13:00 +0000 (15:13 +0000)]
Remove TODO leftover from my devleopment branch

Accidentially checked in a TODO line from r348899. This removes it.

Change-Id: I74b59c0ecfe147af8a08dd7fd10893a4ca351d6d
llvm-svn: 348932

5 years agoRevert "[OpenCL] Add generic AS to 'this' pointer"
Mikael Nilsson [Wed, 12 Dec 2018 15:06:16 +0000 (15:06 +0000)]
Revert "[OpenCL] Add generic AS to 'this' pointer"

Reverting because the patch broke lldb.

llvm-svn: 348931

5 years ago[CUDA][OPENMP][NVPTX]Improve logic of the debug info support.
Alexey Bataev [Wed, 12 Dec 2018 14:52:27 +0000 (14:52 +0000)]
[CUDA][OPENMP][NVPTX]Improve logic of the debug info support.

Summary:
Added support for the -gline-directives-only option + fixed logic of the
debug info for CUDA devices. If optimization level is O0, then options
--[no-]cuda-noopt-device-debug do not affect the debug info level. If
the optimization level is >O0, debug info options are used +
--no-cuda-noopt-device-debug is used or no --cuda-noopt-device-debug is
used, the optimization level for the device code is kept and the
emission of the debug directives is used.
If the opt level is > O0, debug info is requested +
--cuda-noopt-device-debug option is used, the optimization is disabled
for the device code + required debug info is emitted.

Reviewers: tra, echristo

Subscribers: aprantl, guansong, JDevlieghere, cfe-commits

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

llvm-svn: 348930

5 years ago[clang-fuzzer] Add explicit dependency on clangSerialization for clangHandleCXX after...
Alex Bradbury [Wed, 12 Dec 2018 14:33:24 +0000 (14:33 +0000)]
[clang-fuzzer] Add explicit dependency on clangSerialization for clangHandleCXX after rC348907

This library was breaking my -DBUILD_SHARED_LIBS=1 build. rC348915 seemed to miss this case.

As this seems an "obvious" fix, I am committing without pre-commit review as
per the LLVM developer policy.

llvm-svn: 348929

5 years agoELF: Simplify program header iteration
Pavel Labath [Wed, 12 Dec 2018 14:20:28 +0000 (14:20 +0000)]
ELF: Simplify program header iteration

Instead of GetProgramHeaderCount+GetProgramHeaderByIndex, expose an
ArrayRef of all program headers, to enable range-based iteration.
Instead of GetSegmentDataByIndex, expose GetSegmentData, taking a
program header (reference).

This makes the code simpler by enabling range-based loops and also
allowed to remove some null checks, as it became locally obvious that
some pointers can never be null.

llvm-svn: 348928

5 years ago[OpenCL] Add generic AS to 'this' pointer
Mikael Nilsson [Wed, 12 Dec 2018 14:11:59 +0000 (14:11 +0000)]
[OpenCL] Add generic AS to 'this' pointer

Address spaces are cast into generic before invoking the constructor.

Added support for a trailing Qualifiers object in FunctionProtoType.

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

llvm-svn: 348927

5 years ago[TargetLowering] Add ISD::AND handling to SimplifyDemandedVectorElts
Simon Pilgrim [Wed, 12 Dec 2018 13:43:07 +0000 (13:43 +0000)]
[TargetLowering] Add ISD::AND handling to SimplifyDemandedVectorElts

If either of the operand elements are zero then we know the result element is going to be zero (even if the other element is undef).

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

llvm-svn: 348926

5 years agoRegenerate knownbits test. NFCI.
Simon Pilgrim [Wed, 12 Dec 2018 13:21:03 +0000 (13:21 +0000)]
Regenerate knownbits test. NFCI.

A future SimplifyDemandedBits patch will affect this code and I want to ensure the codegen diff is obvious.

llvm-svn: 348925

5 years agolldb-test: Add ability to dump subsections
Pavel Labath [Wed, 12 Dec 2018 12:35:25 +0000 (12:35 +0000)]
lldb-test: Add ability to dump subsections

Previously, lldb-test would only print top-level sections. However, in
lldb, sections can contain other sections. This teaches lldb-test to
print nested sections too.

llvm-svn: 348924

5 years ago[ASTImporter] Remove import of definition from GetAlreadyImportedOrNull
Gabor Marton [Wed, 12 Dec 2018 11:22:55 +0000 (11:22 +0000)]
[ASTImporter] Remove import of definition from GetAlreadyImportedOrNull

Summary: a_sidorin

Reviewers: a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits

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

llvm-svn: 348923

5 years ago[AMDGPU] Set metadata access for explicit section
Piotr Sobczak [Wed, 12 Dec 2018 11:20:04 +0000 (11:20 +0000)]
[AMDGPU] Set metadata access for explicit section

Summary:
This patch provides a means to set Metadata section kind
for a global variable, if its explicit section name is
prefixed with ".AMDGPU.metadata."
This could be useful to make the global variable go to
an ELF section without any section flags set.

Reviewers: dstuttard, tpr, kzhuravl, nhaehnle, t-tye

Reviewed By: dstuttard, kzhuravl

Subscribers: llvm-commits, arsenm, jvesely, wdng, yaxunl, t-tye

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

llvm-svn: 348922

5 years ago[lit]Add llvm-readelf to tool substitutions
James Henderson [Wed, 12 Dec 2018 10:34:01 +0000 (10:34 +0000)]
[lit]Add llvm-readelf to tool substitutions

Reviewed by: rnk, alexsahp

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

llvm-svn: 348921

5 years ago[ARM GlobalISel] Select load/store for Thumb2
Diana Picus [Wed, 12 Dec 2018 10:32:15 +0000 (10:32 +0000)]
[ARM GlobalISel] Select load/store for Thumb2

Unfortunately we can't use TableGen for this because it doesn't yet
support predicates on the source pattern root. Therefore, add a bit of
handwritten code to the instruction selector to handle the most basic
cases.

Also mark them as legal and extract their legalizer test cases to a new
test file.

llvm-svn: 348920

5 years ago[OpenCL] Fix for TBAA information of pointer after addresspacecast
Andrew Savonichev [Wed, 12 Dec 2018 09:51:23 +0000 (09:51 +0000)]
[OpenCL] Fix for TBAA information of pointer after addresspacecast

Summary: When addresspacecast is generated resulting pointer should preserve TBAA information from original value.

Reviewers: rjmccall, yaxunl, Anastasia

Reviewed By: rjmccall

Subscribers: asavonic, kosarev, cfe-commits, llvm-commits

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

llvm-svn: 348919

5 years agobuild.py: Implement "gcc" builder
Pavel Labath [Wed, 12 Dec 2018 08:54:14 +0000 (08:54 +0000)]
build.py: Implement "gcc" builder

Summary:
This implements the gcc builder in build.py script to allow it to
compile host executables when running on a non-windows host. Where it
made sense, I tried to share code with the msvc builder by moving stuff
to the base class.

Reviewers: zturner

Subscribers: mehdi_amini, dexonsmith, lldb-commits

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

llvm-svn: 348918

5 years ago[SystemZ] Minor cleanup of SchedModels
Jonas Paulsson [Wed, 12 Dec 2018 08:26:24 +0000 (08:26 +0000)]
[SystemZ]  Minor cleanup of SchedModels

Some fixes of a few InstRWs for z13 and z14.

Review: Ulrich Weigand
llvm-svn: 348917

5 years agoAdd explicit dependency on clangSerialization after rC348911
Fangrui Song [Wed, 12 Dec 2018 08:25:16 +0000 (08:25 +0000)]
Add explicit dependency on clangSerialization after rC348911

llvm-svn: 348916

5 years agoAdd explicit dependency on clangSerialization for a bunch of components to fix -DBUIL...
Fangrui Song [Wed, 12 Dec 2018 08:02:18 +0000 (08:02 +0000)]
Add explicit dependency on clangSerialization for a bunch of components to fix -DBUILD_SHARED_LIBS=on build

This is a more thorough fix of rC348911.
The story about -DBUILD_SHARED_LIBS=on build after rC348907 (Move PCHContainerOperations from Frontend to Serialization) is:

1. libclangSerialization.so defines PCHContainerReader dtor, ...
2. clangFrontend and clangTooling define classes inheriting from PCHContainerReader, thus their DSOs have undefined references on PCHContainerReader dtor
3. Components depending on either clangFrontend or clangTooling cannot be linked unless they have explicit dependency on clangSerialization due to the default linker option -z defs. The explicit dependency could be avoided if libclang{Frontend,Tooling}.so had these undefined references.

This patch adds the explicit dependency on clangSerialization to make them build.

llvm-svn: 348915

5 years ago[mips] Use llvm-mc -triple option instead of combination of arch,target-abi,mcpu...
Simon Atanasyan [Wed, 12 Dec 2018 07:03:04 +0000 (07:03 +0000)]
[mips] Use llvm-mc -triple option instead of combination of arch,target-abi,mcpu. NFC

llvm-svn: 348914

5 years agoFix compiler warning about unused variable [NFC]
Mikael Holmen [Wed, 12 Dec 2018 06:33:45 +0000 (06:33 +0000)]
Fix compiler warning about unused variable [NFC]

llvm-svn: 348913

5 years ago[Intrinsic] Signed Fixed Point Multiplication Intrinsic
Leonard Chan [Wed, 12 Dec 2018 06:29:14 +0000 (06:29 +0000)]
[Intrinsic] Signed Fixed Point Multiplication Intrinsic

Add an intrinsic that takes 2 signed integers with the scale of them provided
as the third argument and performs fixed point multiplication on them.

This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.

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

llvm-svn: 348912

5 years ago[CodeGen] Fix -DBUILD_SHARED_LIBS=on build after rC348907
Fangrui Song [Wed, 12 Dec 2018 06:07:33 +0000 (06:07 +0000)]
[CodeGen] Fix -DBUILD_SHARED_LIBS=on build after rC348907

llvm-svn: 348911

5 years ago[X86] Combine vpmovdw+vpacksswb into vpmovdb.
Craig Topper [Wed, 12 Dec 2018 05:56:01 +0000 (05:56 +0000)]
[X86] Combine vpmovdw+vpacksswb into vpmovdb.

This is similar to the combine we already have for vpmovdw+vpackuswb.

llvm-svn: 348910

5 years ago[X86] Add a few more fptosi test cases to demonstrate -x86-experimental-vector-wideni...
Craig Topper [Wed, 12 Dec 2018 05:55:59 +0000 (05:55 +0000)]
[X86] Add a few more fptosi test cases to demonstrate -x86-experimental-vector-widening legalization not combining vpacksswb+vpmovdw.

We are able to combine vpackuswb+vpmovdw, but we didn't have packsswb+vpmovdw at the time that combine was added.

llvm-svn: 348909