Commit Graph

158934 Commits

Author SHA1 Message Date
Easwaran Raman 283d9781d9 Add a pass to generate synthetic function entry counts.
Summary:
This pass synthesizes function entry counts by traversing the callgraph
and using the relative block frequencies of the callsites. The intended
use of these counts is in inlining to determine hot/cold callsites in
the absence of profile information.

The pass is split into two files with the code that propagates the
counts in a callgraph in a Utils file. I plan to add support for
propagation in the thinlto link phase and the propagation code will be
shared and hence this split. I did not add support to the old PM since
hot callsite determination in inlining is not possible in old PM
(although we could use hot callee heuristic with synthetic counts in the
old PM it is not worth the effort tuning it)

Reviewers: davidxl, silvas

Subscribers: mgorny, mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322110 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 19:39:35 +00:00
Brian Gesiak 2fd0a70e2d [Option] For typo '-foo', suggest '--foo'
Summary:
https://reviews.llvm.org/rL321877 introduced the `OptTable::findNearest`
method, to find the closest edit distance option for a given string.
However, the implementation contained a bug: for a typo `-foo` with an
edit distance of 1 away from a valid option `--foo`, `findNearest`
would suggest a nearby option of `foo`. That is, the result would not
include the `--` prefix, and so was not a valid option.

Fix the bug by ensuring that the prefix string is initialized to one of
the valid prefixes for the option.

Test Plan: `check-llvm-unit`

Reviewers: v.g.vassilev, teemperor, ruiu, jroelofs, yamaguchi

Reviewed By: jroelofs

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322109 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 19:38:04 +00:00
Rafael Espindola 6ec8f0bf3c Make one of the emitFill methods non virtual. NFC.
This is just preparatory work to fix PR35858.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322108 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 19:29:33 +00:00
Alexey Bataev c719b31f2b [COST]Fix PR35865: Fix cost model evaluation for shuffle on X86.
Summary:
If the vector type is transformed to non-vector single type, the compile
may crash trying to get vector information about non-vector type.

Reviewers: RKSimon, spatel, mkuper, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322106 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 19:08:22 +00:00
Derek Schuff 904cb14b26 [WebAssembly] Update libcall signature lists
New signatures added in r322087. A fix for this tight coupling is forthcoming.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322105 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 19:05:34 +00:00
Sanjay Patel 55a661586a [InstCombine] weaken assertions for icmp folds (PR35846)
Because of potential UB (known bits conflicts with an llvm.assume),
we have to check rather than assert here because InstSimplify doesn't
kill the compare:
https://bugs.llvm.org/show_bug.cgi?id=35846


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322104 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 18:56:03 +00:00
Teresa Johnson 5e57c18284 Fix crash when linking metadata with ODR type uniquing
Summary:
With DebugTypeODRUniquing enabled, during IR linking debug metadata
in the destination module may be reached from the source module.
This means that ConstantAsMetadata nodes (e.g. on DITemplateValueParameter)
may contain a value the destination module. When trying to map such
metadata nodes, we will attempt to map a GV already in the dest module.
linkGlobalValueProto will end up with a source GV that is the same as
the dest GV as well as the new GV. Trying to access the TypeMap for the
source GV type, which is actually a dest GV type, hits an assertion
since it appears that we have mapped into the source module (because the
type is the value not a key into the map).

Detect that we don't need to access the TypeMap in this case, since
there is no need to create a bitcast from the new GV to the source GV
type as they GV are the same.

Fixes PR35722.

Reviewers: mehdi_amini, pcc

Subscribers: probinson, llvm-commits, eraman

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322103 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 18:32:53 +00:00
Max Moroz 4d8dc918b4 [lit] Implement "-r" option for builtin "diff" command + a test using that.
Summary:
That would allow to recursively compare directories in tests using
"diff -r" on Windows in a similar way as it can be done on Linux or Mac.

Reviewers: zturner, morehouse, vsk

Reviewed By: zturner

Subscribers: kcc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322102 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 18:23:34 +00:00
Craig Topper 7481a4cf21 [X86] Add a DAG combine to combine (sext (setcc)) with VLX
Normally target independent DAG combine would do this combine based on getSetCCResultType, but with VLX getSetCCResultType returns a vXi1 type preventing the DAG combining from kicking in.

But doing this combine can allow us to remove the explicit sign extend that would otherwise be emitted.

This patch adds a target specific DAG combine to combine the sext+setcc when the result type is the same size as the input to the setcc. I've restricted this to FP compares and things that can be represented with PCMPEQ and PCMPGT since we don't have full integer compare support on the older ISAs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322101 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 18:14:22 +00:00
Craig Topper 3db29f781f [lli] Make lli support -mcpu=native for CPU autodetection
llc, opt, and clang can all autodetect the CPU and supported features. lli cannot as far as I could tell.

This patch uses the getCPUStr() and introduces a new getCPUFeatureList() and uses those in lli in place of MCPU and MAttrs.

Ideally, we would merge getCPUFeatureList and getCPUFeatureStr, but opt and llc need a string and lli wanted a list. Maybe we should just return the SubtargetFeature object and let the caller decide what it needs?

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322100 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 18:14:18 +00:00
Matthew Voss 21f75f812f Test commit
This is a commit to test commit access.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322099 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 17:52:00 +00:00
Florian Hahn ff58e7c6d9 [TargetParser] Add missing armv8l ARMv8 variant.
This change adds the missing armv8l variant as an alias of armv8 architecture.
The issue was observed with several regressions in validation on armv8l
hardware (for instance ExecutionEngine/frem.ll failed due to lack of neon fpu).

Tested with regression testsuite passed without regression on ARM and x86_64.

Patch by Yvan Roux.

Reviewers: rengolin, rogfer01, olista01, fhahn

Reviewed By: fhahn

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322098 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 17:49:25 +00:00
Francis Visoiu Mistrih 2cba0cc385 [CodeGen] Don't print "pred:" and "opt:" in -debug output
In -debug output we print "pred:" whenever a MachineOperand is a
predicate operand in the instruction descriptor, and "opt:" whenever a
MachineOperand is an optional def in the instruction descriptor.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322096 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 17:31:07 +00:00
Davide Italiano 74e1b78a9d [Support] Use realpath(3) instead of trying to open a file.
If we don't have read permissions on the directory the call would
fail.

<rdar://problem/35871293>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322095 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 17:27:45 +00:00
Pavel Labath 861f6eb249 [Support] Add WritableMemoryBuffer::getNewMemBuffer
Summary:
The idea is that it would replace
(non-Writable)MemoryBuffer::getNewMemBuffer, which is quite useless
unless you const_cast its contents to write to it (which all (both)
callers of this function were doing). This patch also fixes one of the usages in
COFFWriter. After fixing the other usage in clang, I plan to delete the old
function.

Reviewers: dblaikie, Bigcheese

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322094 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 17:26:06 +00:00
Sander de Smalen 4f407a2b19 Recommit r322073: [AArch64][SVE] Asm: Add predicated ADD/SUB instructions
Fixed issue that was found on sanitizer-x86_64-linux-fast.
I changed the result type of 'Parser.getTok().getString().lower()'
in AArch64AsmParser::tryParseSVEPredicateVector() from 'StringRef' to
'auto', since StringRef::lower() returns a std::string.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322092 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 17:01:27 +00:00
Zvi Rackover a0c74d2002 X86 Tests: Update more isel tests with FastVariableShuffle feature
Summary:
Added the FastVariableShuffle feature to cases that resembled processors
for which this fearure is on.
For AVX2 there are processors with and w/o this fearue enable.
For AVX512 only KNL does enable this feature so cases which only have
+avx512f were left without the FastVariableShuffle enabled.

Reviewers: RKSimon, craig.topper

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322090 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 16:26:06 +00:00
Zvi Rackover 8d3a0bc0c4 X86 Tests: Add common check prefix to test-case. NFC.
As suggested in D41851

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322089 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 16:14:15 +00:00
Francis Visoiu Mistrih 2a21599e1d [CodeGen] Print frame-setup/destroy flags in -debug output like we do in MIR
Currently the MachineInstr::print function prints the
frame-setup/frame-destroy differently than it does in MIR.

Instead of:

  %x21 = LDR %sp, -16; flags: FrameDestroy

print:

  %x21 = frame-destroy LDR %sp, -16

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322088 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 16:11:51 +00:00
Sanjay Patel 8abb7fa665 [SelectionDAG] lower math intrinsics to finite version of libcalls when possible (PR35672)
Ingredients in this patch:
1. Add HANDLE_LIBCALL defs for finite mathlib functions that correspond to LLVM intrinsics.
2. Plumbing to send TargetLibraryInfo down to SelectionDAGLegalize.
3. Relaxed math and library checking in SelectionDAGLegalize::ConvertNodeToLibcall() to choose finite libcalls.

There was a bug about determining the availability of the finite calls that should be fixed with:
rL322010

Not in this patch:
This doesn't resolve the question/bug of clang creating the intrinsic IR in the first place.
There's likely follow-up work needed to support the long double variants better.
There's room for improvement to reduce the code duplication.
Create finite calls that don't originate from a corresponding intrinsic or DAG node?

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322087 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 15:41:00 +00:00
Francis Visoiu Mistrih 93f5fcdff3 [CodeGen] Don't print register classes in -debug output
Since register classes and banks are already printed with the register
definition, don't print it at the end of every instruction anymore.

This follows MIR in this regard and is another step to the unification
of the two formats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322086 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 15:39:44 +00:00
Nirav Dave b56f822bc7 [DAG] Elide overlapping stores
Relanding after fixing handling of pre-indexed memory operations in
BaseIndexOffset analysis (r322003).

Extend overlapping store elision to handle overwrites of stores by
larger stores.

Reviewers: craig.topper, rnk, t.p.northover

Subscribers: javed.absar, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322085 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 15:23:12 +00:00
Petar Jovanovic 9f32fd27a8 [EarlyCSE] Salvage debug info during DCE
EarlyCSE did not try to salvage debug info during erasing of instructions.
This change fixes it.

Patch by Djordje Todorovic.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322083 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 15:08:37 +00:00
Simon Pilgrim 5646bdb21b [InstCombine] Check for out of range ashr values using APInt before calling getZExtValue
Reduced from oss-fuzz #5032 test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322078 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 14:23:46 +00:00
Sander de Smalen 0d0979698a Reverted r322073 because of AddressSanitizer failure on
sanitizer-x86_64-linux-fast builder.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322077 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 13:51:09 +00:00
Simon Pilgrim b9261dc359 [X86][AVX] Add v2i64/v2f64 load tests
Ensure these use insertions, not masked load ops

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322076 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 13:35:18 +00:00
Sander de Smalen 8e2f4b41a1 [AArch64][SVE] Asm: Add predicated ADD/SUB instructions
Summary:
Add the predicated ADD/SUB instructions and corresponding tests.

Patch [3/3] in a series to add predicated ADD/SUB instructions for SVE.

Reviewers: rengolin, mcrosier, evandro, fhahn, echristo

Reviewed By: fhahn

Subscribers: aemerson, javed.absar, tschuett, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322073 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 12:43:46 +00:00
Simon Pilgrim d3e342783d [InstCombine] Add pow2 mul -> shl tests for vectors with uniform/non-uniform constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322072 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 11:55:27 +00:00
Francis Visoiu Mistrih 4e1cf66e6f [MIR] Add support for the frame-destroy MachineInstr flag
We are printing / parsing the `frame-setup` MachineInstr flag but not
the `frame-destroy` one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 11:33:22 +00:00
Sander de Smalen 714260a2fe [AArch64][SVE] Asm: Add parsing of merging/zeroing suffix for SVE predicate vector operands
Summary:
Parsing of the '/m' (merging) or '/z' (zeroing) suffix of a predicate operand.

Patch [2/3] in a series to add predicated ADD/SUB instructions for SVE.

Reviewers: rengolin, mcrosier, evandro, fhahn, echristo, MatzeB, t.p.northover

Reviewed By: fhahn

Subscribers: t.p.northover, MatzeB, aemerson, javed.absar, tschuett, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322070 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 11:17:06 +00:00
Nikolai Bozhenov 27033c5420 [Nios2] Arithmetic instructions for R1 and R2 ISA.
Summary:
This commit enables some of the arithmetic instructions for Nios2 ISA (for both
R1 and R2 revisions), implements facilities required to emit those instructions
and provides LIT tests for added instructions.

Reviewed By: hfinkel

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

Author: belickim <mateusz.belicki@intel.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322069 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 11:15:08 +00:00
Oren Ben Simhon b89275f988 Instrument Control Flow For Indirect Branch Tracking
CET (Control-Flow Enforcement Technology) introduces a new mechanism called IBT (Indirect Branch Tracking).
According to IBT, each Indirect branch should land on dedicated ENDBR instruction (End Branch).
The new pass adds ENDBR instructions for every indirect jmp/call (including jumps using jump tables / switches).
For more information, please see the following:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

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

Change-Id: Icb754489faf483a95248f96982a4e8b1009eb709

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322062 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 08:51:18 +00:00
Shoaib Meenai cb3923fb1c [cmake] Use symlinks for Windows-hosted toolchains built on Unix
When cross-compiling for Windows on Unix, the built toolchain will need
to be transferred to Windows to actually run. My opinion is that the
Unix build should use symlinks, and the transfer to Windows should take
care of making those symlinks usable. E.g., I envision tarballs to be a
common form of transfer from Unix to Windows, in which case the tarball
can be created using --dereference to follow the symlinks.

The motivation here is that, when cross-compiling for Windows on Unix,
the installation will *already* create symlinks. The reason is that the
installation script will be invoked without knowing the host system, so
the `if(UNIX)` check in the installation symlink creation script will
reflect the build system rather than the host system. We could either
make the build and install trees both contain copies or both contain
symlinks, and using symlinks is a significant space saving without (in
my opinion) having any detrimental effect on the usage of the cross-
compiled toolchain on Windows.

A secondary motivation is that Windows 10 version 1703 and later finally
lift the administrator rights requirement for creating symbolic links
(if the system is in Developer Mode), which makes symlinks a lot more
practical even on Windows. Of course Unix and Windows symlinks aren't
interoperable, but symlinks for Windows toolchains is a reasonable
future direction to be going in anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322061 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 07:50:18 +00:00
Craig Topper fe61b63259 [X86] Allow more cmpps/pd immediate encodings to be commuted during isel.
The code that checks the immediate wasn't masking to the lower 3-bits like the code in X86InstrInfo.cpp that's used by the peephole pass does.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322060 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 07:09:34 +00:00
Serguei Katkov 090a0d657f [SCEV] Do not cache S -> V if S is not equivalent of V
SCEV tracks the correspondence of created SCEV to original instruction.
However during creation of SCEV it is possible that nuw/nsw/exact flags are
lost.

As a result during expansion of the SCEV the instruction with nuw/nsw/exact
will be used where it was expected and we produce poison incorreclty.

Reviewers: sanjoy, mkazantsev, sebpop, jbhateja
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41578



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322058 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 06:47:14 +00:00
Serguei Katkov a377183cff [CGP] Fix Complex addressing mode for offset
If the offset is differ in two addressing mode we can continue only if
ScaleReg is not set due to we will use it as merge of different offsets.

It should fix PR35799 and PR35805.

Reviewers: john.brawn, reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D41227



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322056 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 04:37:06 +00:00
Sean Fertile 16ee408684 [PowerPC] Can not assume an intrinsic argument is a simple type.
The CTRLoop pass performs checks on the argument of certain libcalls/intrinsics,
and assumes the arguments must be of a simple type. This isn't always the case
though. For example if we unroll and vectorize a loop we may end up with vectors
larger then the largest legal type, along with intrinsics that operate on those
wider types. This happened in the ffmpeg build, where we unrolled a loop and
ended up with a sqrt intrinsic that operated on V16f64, triggering an assertion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322055 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 03:03:41 +00:00
Eric Christopher aa847cebc7 Remove unused function HvxSelector::zerous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322053 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 02:38:17 +00:00
Stefan Pintilie 63c5ae2ff9 Revert "[PowerPC] Manually schedule the prologue and epilogue"
[PowerPC] This reverts commit r322036.

Failing build bots. Revert the commit now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322051 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 01:06:21 +00:00
Craig Topper 7ef3f8d9a1 [X86] Remove llvm.x86.avx512.cvt*2mask.* intrinsics and autoupgrade to (icmp slt X, 0)
I had to drop fast-isel-abort from a test because we can't fast isel some of the mask stuff. When we used intrinsics we implicitly fell back to SelectionDAG for the intrinsic call without triggering the abort error. But with native IR that doesn't happen the same way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322050 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 00:50:47 +00:00
Craig Topper 80bcd57901 [X86] Remove unnecessary isel pattern that is a combination of two other patterns.
The pattern was this

 def : Pat<(i32 (zext (i8 (bitconvert (v8i1 VK8:$src))))),
           (MOVZX32rr8 (EXTRACT_SUBREG (i32 (COPY_TO_REGCLASS VK8:$src, GR32)), sub_8bit))>, Requires<[NoDQI]>;

but if you just let (i32 (zext X)) match byte itself you'll get MOVZX32rr8. And if you let (i8 (bitconvert (v8i1 VK8:$src))) match by itself you'll get (EXTRACT_SUBREG (i32 (COPY_TO_REGCLASS VK8:$src, GR32)), sub_8bit).

So we can just let isel do the two patterns naturally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322049 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 00:50:42 +00:00
Jessica Paquette 3f8e15a628 [MachineOutliner] AArch64: Handle instrs that use SP and will never need fixups
This commit does two things. Firstly, it adds a collection of flags which can
be passed along to the target to encode information about the MBB that an
instruction lives in to the outliner.

Second, it adds some of those flags to the AArch64 outliner in order to add
more stack instructions to the list of legal instructions that are handled
by the outliner. The two flags added check if

- There are calls in the MachineBasicBlock containing the instruction
- The link register is available in the entire block

If the link register is available and there are no calls, then a stack
instruction can always be outlined without fixups, regardless of what it is,
since in this case, the outliner will never modify the stack to create a
call or outlined frame.

The motivation for doing this was checking which instructions are most often
missed by the outliner. Instructions like, say

%sp<def> = ADDXri %sp, 32, 0; flags: FrameDestroy

are very common, but cannot be outlined in the case that the outliner might
modify the stack. This commit allows us to outline instructions like this.
  


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322048 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 00:26:18 +00:00
Petr Hosek f5a4b47201 [CMake] Support for cross-compilation when build runtimes
When cross-compiling, we cannot use the just built toolchain, instead
we need to use the host toolchain which we assume has a support for
targeting the selected target platform. We also need to pass the path
to the native version of llvm-config to external projects.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322046 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 23:50:59 +00:00
Craig Topper 3e1ae86847 [X86] Remove GCCBuiltin from int_x86_avx512_cvtb2mask_128 and similar intrinsics.
I'm going to convert these to 'icmp slt X, zeroinitializer' in clang's CGBuiltin.cpp, but the GCCBuiltin names need to be removed to do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322037 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 22:37:49 +00:00
Stefan Pintilie ecb72f4119 [PowerPC] Manually schedule the prologue and epilogue
This patch makes the following changes to the schedule of instructions in the
prologue and epilogue.

The stack pointer update is moved down in the prologue so that the callee saves
do not have to wait for the update to happen.
Saving the lr is moved down in the prologue to hide the latency of the mflr.
The stack pointer is moved up in the epilogue so that restoring of the lr can
happen sooner.
The mtlr is moved up in the epilogue so that it is away form the blr at the end
of the epilogue. The latency of the mtlr can now be hidden by the loads of the
callee saved registers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322036 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 22:23:10 +00:00
Justin Bogner e9fb716fe6 AlwaysInliner: Alow setting InsertLifetime in the new-style pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322033 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 22:07:42 +00:00
Shoaib Meenai 4794bea023 [cmake] Pass CMAKE_MAKE_PROGRAM to native configure
If the make program isn't in the path, the native configure will fail.
Pass CMAKE_MAKE_PROGRAM to the native configure explicitly to remedy
this, similar to what's already done for external project configuration.
Explicitly set CMAKE_MAKE_PROGRAM before the user flags so that they can
override it for the native build if they desire (though I can't fathom
why that would be useful).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322032 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 21:52:58 +00:00
Zachary Turner 3693c1f459 Fix uninitialized read error reported by MSAN.
The problem was that our Obj -> Yaml dumper had not been taught
to handle certain types of records.  This meant that when I
generated the test input files, the records were still there but
none of its fields were filled out.  So when it did the
Yaml -> Obj conversion as part of the test, it generated records
with garbage in them.

The patch here fixes the Obj <-> Yaml converter, and additionally
updates the test file with fresh Yaml generated by the fixed
converter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322029 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 21:38:50 +00:00
Justin Bogner bda2efb566 ArgPromotion: Allow setting MaxElements in the new-style pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322025 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 21:13:35 +00:00
Petar Jovanovic 29defdea8f Add lit.local.cfg in test/DebugInfo/MIR/Mips/
Add test/DebugInfo/MIR/Mips/lit.local.cfg so no tests are run if Mips is
not a supported target.
This should resolve buildbot failures seen after r322015.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322020 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-08 19:44:03 +00:00