143856 Commits

Author SHA1 Message Date
Craig Topper
c144a2489f [X86] Remove Undef handling from extractSubVector. This is now handled inside getNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 02:43:54 +00:00
Craig Topper
8a3705cb10 [SelectionDAG] Teach getNode to simplify a couple easy cases of EXTRACT_SUBVECTOR
Summary:
This teaches getNode to simplify extracting from Undef. This is similar to what is done for EXTRACT_VECTOR_ELT. It also adds support for extracting from CONCAT_VECTOR when we can reuse one of the inputs to the concat. These seem like simple non-target specific optimizations.

For X86 we currently handle undef in extractSubvector, but not all EXTRACT_SUBVECTOR creations go through there.

Ultimately, my motivation here is to simplify extractSubvector and remove custom lowering for EXTRACT_SUBVECTOR since we don't do anything but handle undef and BUILD_VECTOR optimizations, but those should be DAG combines.

Reviewers: RKSimon, delena

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 02:36:59 +00:00
Craig Topper
6ca6b72830 [APInt] Remove calls to clearUnusedBits from XorSlowCase and operator^=
Summary:
There's a comment in XorSlowCase that says "0^0==1" which isn't true. 0 xored with 0 is still 0. So I don't think we need to clear any unused bits here.

Now there is no difference between XorSlowCase and AndSlowCase/OrSlowCase other than the operation being performed

Reviewers: majnemer, MatzeB, chandlerc, bkramer

Reviewed By: MatzeB

Subscribers: chfast, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292873 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 02:10:15 +00:00
Davide Italiano
5e7aac4918 [PM] Try to make all three compilers happy when it comes to pretty printing.
Modeled after a similar change from Michael Kuperstein. Let's hope this
sticks together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 01:45:53 +00:00
Matthias Braun
5862c98d09 LiveIntervalAnalysis: Calculate liveness even if a superreg is reserved.
A register unit may be allocatable and non-reserved but some of the
register(tuples) built with it are reserved. We still need to calculate
liveness in this case.

Note to out of tree targets: If you start seeing machine verifier errors
with this commit, it probably means that you do not properly mark super
registers of reserved register as reserved. See for example r292836 or
r292870 for example on how to fix that.

rdar://29996737

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 01:12:58 +00:00
Matthias Braun
71d3257864 PowerPC: Mark super regs of reserved regs reserved.
When a register like R1 is reserved, X1 should be reserved as well. This
was already done "manually" when 64bit code was enabled, however using
the markSuperRegs() function on the base register is more convenient and
allows to use the checksAllSuperRegsMarked() function even in 32bit mode
to avoid accidental breakage in the future.

This is also necessary to allow https://reviews.llvm.org/D28881

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 01:12:30 +00:00
Davide Italiano
71d2fd7c90 [LTO] Add test to show up we don't support ThinLTO yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 00:59:00 +00:00
Davide Italiano
fa5f3e4eeb [LTO] Teach lib/LTO about the new pass manager.
Differential Revision:  https://reviews.llvm.org/D28997

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 00:58:24 +00:00
Davide Italiano
6fe089fa68 [PM] Flesh out the new pass manager LTO pipeline.
Differential Revision:  https://reviews.llvm.org/D28996

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 00:57:39 +00:00
Kostya Serebryany
42d07d086c [sanitizer-coverage] emit __sanitizer_cov_trace_pc_guard w/o a preceding 'if' by default. Update the docs, also add deprecation notes around other parts of sanitizer coverage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 00:57:31 +00:00
Tim Shen
3796f1e0b8 [APFloat] Add PPCDoubleDouble multiplication
Reviewers: echristo, hfinkel, kbarton, iteratee

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 00:19:45 +00:00
Derek Schuff
e5f6421c94 [WebAssembly] Update LibFunc::Func -> LibFunc
Fixes compile failures after r292848

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 00:01:18 +00:00
Matt Arsenault
cdd4c09d7b SimplifyLibCalls: Replace more unary libcalls with intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:55:08 +00:00
Michael Kuperstein
e78d6b0640 [LoopUnroll] First form LCSSA, then loop-simplify
Running non-LCSSA-preserving LoopSimplify followed by LCSSA on (roughly) the
same loop is incorrect, since LoopSimplify may break LCSSA arbitrarily higher
in the loop nest. Instead, run LCSSA first, and then run LCSSA-preserving
LoopSimplify on the result.

This fixes PR31718.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:45:42 +00:00
Eugene Zelenko
c58ca72907 [AMDGPU] Fix obsolete comments, spotted by Malcolm Parsons. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:41:16 +00:00
Dehao Chen
32a651b84f Makes promoteIndirectCall an external function.
Summary: promoteIndirectCall should be a utility function that could be invoked by other optimization passes.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292850 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:18:24 +00:00
David L. Jones
32028c8f08 [Analysis] Add LibFunc_ prefix to enums in TargetLibraryInfo. (NFC)
Summary:
The LibFunc::Func enum holds enumerators named for libc functions.
Unfortunately, there are real situations, including libc implementations, where
function names are actually macros (musl uses "#define fopen64 fopen", for
example; any other transitively visible macro would have similar effects).

Strictly speaking, a conforming C++ Standard Library should provide any such
macros as functions instead (via <cstdio>). However, there are some "library"
functions which are not part of the standard, and thus not subject to this
rule (fopen64, for example). So, in order to be both portable and consistent,
the enum should not use the bare function names.

The old enum naming used a namespace LibFunc and an enum Func, with bare
enumerators. This patch changes LibFunc to be an enum with enumerators prefixed
with "LibFFunc_". (Unfortunately, a scoped enum is not sufficient to override
macros.)

There are additional changes required in clang.

Reviewers: rsmith

Subscribers: mehdi_amini, mzolotukhin, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:16:46 +00:00
Matt Arsenault
50ca9e146b AMDGPU: Custom lower more vector operations
This avoids stack usage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292846 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:09:58 +00:00
Krzysztof Parzyszek
8614146660 [RDF] Add registers to live set even if they are live already
When calculating kills, a register may be considered live because a part
of it is live, but if there is a use of that (whole) register, the whole
register (and its subregisters) need to be added to the live set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292845 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 23:03:49 +00:00
Kostya Serebryany
72e0240a06 [libFuzzer] mutate empty input using the regular mutators (instead of a custom dummy one). This way when we mutate an empty input there is a chance we will get a dictionary word
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292843 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:52:13 +00:00
Matt Arsenault
1f1c4b3f65 DAG: Don't fold vector extract into load if target doesn't want to
Fixes turning a 32-bit scalar load into an extending vector load
for AMDGPU when dynamically indexing a vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:48:53 +00:00
Sanjay Patel
ad539e7fe2 [InstSimplify] add tests to show missing folds from 'icmp (add nsw)'; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292841 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:42:55 +00:00
Evgeniy Stepanov
35de1443fc Revert "Refactor SampleProfile.cpp to move computation inside a branch. (NFC)"
Causes MSan failures on the buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:40:08 +00:00
Tim Shen
207a20dda4 [APFloat] Switch from (PPCDoubleDoubleImpl, IEEEdouble) layout to (IEEEdouble, IEEEdouble)
Summary:
This patch changes the layout of DoubleAPFloat, and adjust all
operations to do either:
1) (IEEEdouble, IEEEdouble) -> (uint64_t, uint64_t) -> PPCDoubleDoubleImpl,
   then run the old algorithm.
2) Do the right thing directly.

1) includes multiply, divide, remainder, mod, fusedMultiplyAdd, roundToIntegral,
   convertFromString, next, convertToInteger, convertFromAPInt,
   convertFromSignExtendedInteger, convertFromZeroExtendedInteger,
   convertToHexString, toString, getExactInverse.
2) includes makeZero, makeLargest, makeSmallest, makeSmallestNormalized,
   compare, bitwiseIsEqual, bitcastToAPInt, isDenormal, isSmallest,
   isLargest, isInteger, ilogb, scalbn, frexp, hash_value, Profile.

I could split this into two patches, e.g. use
1) for all operatoins first, then incrementally change some of them to
2). I didn't do that, because 1) involves code that converts data between
PPCDoubleDoubleImpl and (IEEEdouble, IEEEdouble) back and forth, and may
pessimize the compiler. Instead, I find easy functions and use
approach 2) for them directly.

Next step is to implement move multiply and divide from 1) to 2). I don't
have plans for other functions in 1).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:39:35 +00:00
Matt Arsenault
f3a691f0b0 AMDGPU: Combine fp16/fp64 subtarget features
The same control register controls both, and are set to
the same defaults. Keep the old names around as aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292837 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:31:03 +00:00
Krzysztof Parzyszek
924f39dc83 [Hexagon] Explicitly reserve aliases of reserved registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:13:05 +00:00
Kostya Serebryany
fc4ec25a17 [libFuzzer] make sure we use the feedback from std::string operator ==
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 22:11:04 +00:00
Kevin Enderby
af0e1c5e93 Add support for the x86_thread_state32_t and
in llvm-objdump for Mach-O files add the printing of the
x86_thread_state32_t in the same format as
otool-classic(1) on darwin.

To do this the 32-bit x86 general tread state
needed to be defined in include/llvm/Support/MachO.h .

rdar://30110111


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292829 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:13:29 +00:00
Ahmed Bougacha
11b1a4ae36 [AArch64][GlobalISel] Legalize narrow scalar fp->int conversions.
Since we're now avoiding operations using narrow scalar integer types,
we have to legalize the integer side of the FP conversions.

This requires teaching the legalizer how to do that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292828 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:10:14 +00:00
Ahmed Bougacha
868b1fe194 [AArch64][GlobalISel] Legalize narrow scalar ops again.
Since r279760, we've been marking as legal operations on narrow integer
types that have wider legal equivalents (for instance, G_ADD s8).
Compared to legalizing these operations, this reduced the amount of
extends/truncates required, but was always a weird legalization decision
made at selection time.

So far, we haven't been able to formalize it in a way that permits the
selector generated from SelectionDAG patterns to be sufficient.

Using a wide instruction (say, s64), when a narrower instruction exists
(s32) would introduce register class incompatibilities (when one narrow
generic instruction is selected to the wider variant, but another is
selected to the narrower variant).

It's also impractical to limit which narrow operations are matched for
which instruction, as restricting "narrow selection" to ranges of types
clashes with potentially incompatible instruction predicates.

Concerns were also raised regarding  MIPS64's sign-extended register
assumptions, as well as wrapping behavior.
See discussions in https://reviews.llvm.org/D26878.

Instead, legalize the operations.

Should we ever revert to selecting these narrow operations, we should
try to represent this more accurately: for instance, by separating
a "concrete" type on operations, and an "underlying" type on vregs, we
could move the "this narrow-looking op is really legal" decision to the
legalizer, and let the selector use the "underlying" vreg type only,
which would be guaranteed to map to a register class.

In any case, we eventually should mitigate:
- the performance impact by selecting no-op extract/truncates to COPYs
  (which we currently do), and the COPYs to register reuses (which we
  don't do yet).
- the compile-time impact by optimizing away extract/truncate sequences
  in the legalizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:10:05 +00:00
Steven Wu
5aa636d3fa Attempt to fix the testcase in r292824
Try fix the testcase r292824 (failing on some bots) by reduce it to the
minimal. If this fix doesn't work, I will revert this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292826 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 20:42:17 +00:00
Javed Absar
f8d5c73567 [ARM] Classification Improvements to ARM Sched-Models. NFCI.
This is a series of patches to enable adding of machine sched
models for ARM processors easier and compact. They define new
sched-readwrites for groups of ARM instructions. This has been
missing so far, and as a consequence, machine scheduler models
for individual sub-targets have tended to be larger than they
needed to be. 

The current patch focuses on floating-point instructions.

Reviewers: Diana Picus (rovka), Renato Golin (rengolin)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 20:20:39 +00:00
Steven Wu
6d5a027d71 Add LC_BUILD_VERSION load command
Summary:
Add a new load command LC_BUILD_VERSION. It is a generic version of
LC_*_VERSION_MIN load_command used on Apple platforms. Instead of having
a seperate load command for each platform, LC_BUILD_VERSION is recording
platform info as an enum. It also records SDK version, min_os, and tools
that used to build the binary.

rdar://problem/29781291

Reviewers: enderby

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292824 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 20:07:55 +00:00
Alexey Bataev
2394101f1d [SLP] Additional test with extra args in horizontal reductions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292821 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:28:23 +00:00
Matt Arsenault
8611e02394 AMDGPU: Propagate fast math flags in fneg combines
Can't for fma/mad since it seems they can't have flags currently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:08:34 +00:00
Matthias Braun
46a1e8bc14 Add unittests for empty bitvectors.
Addendum to r292575

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292817 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:06:54 +00:00
Matt Arsenault
18ea372741 AMDGPU: Remove unnecessary check
There are no scalar FP types that can be extended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292816 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 19:00:15 +00:00
Xinliang David Li
83c73f565d [PGO] add debug option to view annotated cfg after prof use annotation
Differential Revision: http://reviews.llvm.org/D28967 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 18:58:24 +00:00
Matt Arsenault
41e0c1e88e DAG: Allow legalization of fcanonicalize vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 18:52:26 +00:00
Kostya Serebryany
f7ac01d0a0 [libFuzzer] deflake a test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 18:44:40 +00:00
Sanjay Patel
f2f72bf178 [InstSimplify] refactor finding limits for icmp with binop; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292812 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 18:22:26 +00:00
Dehao Chen
e6f6334df4 Refactor SampleProfile.cpp to move computation inside a branch. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292803 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 17:09:02 +00:00
Chris Bieneman
274c106a4c Post-commit review feedback from dblaikie
Use ASSERT_* instead of EXPECT_* for error condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292798 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 16:49:34 +00:00
Piotr Padlewski
d0675bd5cb [MemorySSA] Add new tests for invariant.groups
Summary:
Next round of extra tests for MSSA.
I have a prototype invariant.group handling implementation
that fixes all the FIXMEs, and I think it will be
easier to see what is the difference if I firstly
post this, and then only fix fixits.

Reviewers: george.burgess.iv, dberlin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 16:38:10 +00:00
Simon Pilgrim
2f752ea083 [InstCombine][X86] Add MULDQ/MULUDQ constant folding support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292793 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 15:22:59 +00:00
Amaury Sechet
e6b387f02d Tweak ASCII art in Simplify CFG. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292792 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 15:13:01 +00:00
Jonas Paulsson
d7599ee3b1 [SystemZ] Mark vector immediate load instructions with useful flags.
Vector immediate load instructions should have the isAsCheapAsAMove, isMoveImm
and isReMaterializable flags set. With them, these instruction will get
hoisted out of loops.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292790 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 14:09:58 +00:00
Eugene Leviant
9c3e633489 RuntimeDyldELF: add LDST128_ABS_LO12_NC reloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292788 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 13:52:08 +00:00
Eugene Leviant
ece7697261 RuntimeDyldELF: add LDST8_ABS_LO12_NC and LDST16_ABS_LO12_NC relocs
Differential revision: https://reviews.llvm.org/D28863


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292785 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 13:13:47 +00:00
Simon Pilgrim
dc0a1d53ba [InstCombine][X86] MULDQ/MULUDQ undef -> zero
Match generic mul behaviour so that <X x i64> multiply and muldq/muludq pattern act the same

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292784 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 12:07:32 +00:00