Commit Graph

121781 Commits

Author SHA1 Message Date
Chandler Carruth
1f97273f8f [FunctionAttrs] Factor the logic to test for a known non-null return out
of a method and into a re-usable static helper. We can potentially use
this function from the implementation of a new pass manager oriented
version of the pass. Also add some better documentation of exactly what
the semantic model of this routine is (it isn't trivial) and use a more
modern naming convention for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247524 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 08:17:14 +00:00
Elena Demikhovsky
b21635658f AVX-512: Fixed a bug in OR/XOR operations for 512-bit FP values on KNL.
KNL does not have VXORPS, VORPS for 512-bit values.
I use integer VPXOR, VPOR that actually do the same.

X86ISD::FXOR/FOR are generated as a result of FSUB combining.

Differential Revision: http://reviews.llvm.org/D12753



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247523 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 08:15:15 +00:00
Chandler Carruth
28b6c23c41 [FunctionAttrs] Make the per-function attribute inference a boring
static function rather than a method. It just needed access to
TargetLibraryInfo, and this way it can be easily reused between the
current FunctionAttrs implementation and any port for the new pass
manager.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247522 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 08:03:23 +00:00
Chandler Carruth
821e7c7737 [FunctionAttrs] Collect utility functions as static helpers rather than
methods. They don't need anything from the class anyways.

Also, collect the declarations into the private section of the pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 07:50:43 +00:00
Chandler Carruth
69bfddd191 Clean up doxygen comments in FunctionAttrs, promoting some non-doxygen
comments, deleting duplicate comments, moving comments to consistently
live on the definition since these are all really internal routines,
etc. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247520 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 06:57:25 +00:00
Chandler Carruth
10b4880de3 Do some spring cleaning on FunctionAttrs.cpp with clang-format prior to
other refactorings and cleanups here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247519 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 06:47:20 +00:00
Davide Italiano
92148557f7 [llvm-mc] More meaningful error if input file doesn't exist.
Before we just printed on stderr the program name. Now at least we
print the name of the file that doesn't exist. There's probably room
for improvement of error handling in llvm-mc (and the tools in general),
but still this is a step forward.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247518 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-13 04:09:40 +00:00
Sanjay Patel
d8fd22b7ec [x86] enable machine combiner reassociations for 128-bit vector logical integer insts (2nd try)
The changes in:
test/CodeGen/X86/machine-cp.ll
are just due to scheduling differences after some logic instructions were reassociated.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247516 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 19:47:50 +00:00
Ahmed Bougacha
3034c71409 [CodeGen] Fix AtomicExpand invalidation issue caused by r247429.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247514 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 18:51:23 +00:00
Simon Pilgrim
b43332c8d1 [X86] Renamed lowerVectorShuffleAsUnpack NFCI.
Renamed to lowerVectorShuffleAsPermuteAndUnpack to make it clear that it lowers to more than just a UNPCK instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247513 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 18:26:47 +00:00
Joerg Sonnenberger
0f17418ff9 Don't use bashism/kshism of test ==. From Kamil Rytarowski.
Differential Revision: http://reviews.llvm.org/D12642


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247512 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 16:30:32 +00:00
Simon Pilgrim
9114b92030 [X86] Moved lowerVectorShuffleWithUNPCK earlier to make reuse easier. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247511 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 16:03:06 +00:00
Simon Pilgrim
1b1bacb118 [X86] Added i1 vector sextload tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247509 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 15:36:41 +00:00
Simon Pilgrim
21e0b1f45b [X86][FMA] Refreshed fma tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247508 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 15:33:05 +00:00
Sanjay Patel
69f08e598c revert r247506; need to verify changes in existing tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247507 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 15:27:31 +00:00
Sanjay Patel
e6c453bf2d [x86] enable machine combiner reassociations for 128-bit vector logical integer insts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247506 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 14:58:04 +00:00
Simon Pilgrim
427fe356da Fixed unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247505 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 14:00:17 +00:00
Simon Pilgrim
231ed70f86 [InstCombine] CVTPH2PS Vector Demanded Elements + Constant Folding
Improved InstCombine support for CVTPH2PS (F16C half 2 float conversion):

<4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16>) - only uses the bottom 4 i16 elements for the conversion.

Added constant folding support.

Differential Revision: http://reviews.llvm.org/D12731

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247504 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 13:39:53 +00:00
Simon Pilgrim
9029773cee [X86][SSE] Use general sext IR for (v)pmovsx stack folding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247502 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 11:45:24 +00:00
Chandler Carruth
e73e5b49f9 [PM] Port SROA to the new pass manager.
In some ways this is a very boring port to the new pass manager as there
are no interesting analyses or dependencies or other oddities.

However, this does introduce the first good example of a transformation
pass with non-trivial state porting to the new pass manager. I've tried
to carve out patterns here to replicate elsewhere, and would appreciate
comments on whether folks like these patterns:

- A common need in the new pass manager is to effectively lift the pass
  class and some of its state into a public header file. Prior to this,
  LLVM used anonymous namespaces to provide "module private" types and
  utilities, but that doesn't scale to cases where a public header file
  is needed and the new pass manager will exacerbate that. The pattern
  I've adopted here is to use the namespace-cased-name of the core pass
  (what would be a module if we had them) as a module-private namespace.
  Then utility and other code can be declared and defined in this
  namespace. At some point in the future, we could even have
  (conditionally compiled) code that used modules features when
  available to do the same basic thing.

- I've split the actual pass run method in two in order to expose
  a private method usable by the old pass manager to wrap the new class
  with a minimum of duplicated code. I actually looked at a bunch of
  ways to automate or generate these, but they are all quite terrible
  IMO. The fundamental need is to extract the set of analyses which need
  to cross this interface boundary, and that will end up being too
  unpredictable to effectively encapsulate IMO. This is also
  a relatively small amount of boiler plate that will live a relatively
  short time, so I'm not too worried about the fact that it is boiler
  plate.

The rest of the patch is totally boring but results in a massive diff
(sorry). It just moves code around and removes or adds qualifiers to
reflect the new name and nesting structure.

Differential Revision: http://reviews.llvm.org/D12773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247501 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 09:09:14 +00:00
Larisse Voufo
e5c2842a7c Clean up: Refactoring the hardcoded value of 6 for FindAvailableLoadedValue()'s parameter MaxInstsToScan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247497 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 01:41:55 +00:00
Bruce Mitchener
767c34a919 Fix typos.
Summary: This fixes a variety of typos in docs, code and headers.

Subscribers: jholewinski, sanjoy, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D12626

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247495 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 01:17:08 +00:00
Hal Finkel
6adacc9233 Move asserts from PHINode::addIncoming to PHINode::setIncoming*
We had asserts in PHINode::addIncoming to check that the value types matched
the type of the PHI, and that the associated BB was not null. These did not
catch, however, later uses of setIncomingValue and setIncomingBlock (which are
called by addIncoming as well). Moving the asserts to PHINode::setIncoming*
provides better coverage. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-12 00:08:21 +00:00
Adrian Prantl
0a0a960468 dsymutil: Factor out the relocation handling into a RelocationManager (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247490 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 23:45:30 +00:00
Davide Italiano
830d0f8976 [MC] Fix style bugs introduced in r247471. Reported by Rafael Espindola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247483 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 22:04:21 +00:00
Davide Italiano
125be70dbf [MC] Don't crash on division by zero.
Differential Revision:	http://reviews.llvm.org/D12776


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247471 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 20:47:35 +00:00
Yunzhong Gao
7ba3323aff Add a non-exiting diagnostic handler for LTO.
This is in order to give LTO clients a chance to do some clean-up before
terminating the process.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247461 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 20:01:53 +00:00
Sanjay Patel
4d5d1dcf1d typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 19:29:18 +00:00
Akira Hatanaka
8e2b613ef0 Use function attribute "stackrealign" to decide whether stack
realignment should be forced.

With this commit, we can now force stack realignment when doing LTO and
do so on a per-function basis. Also, add a new cl::opt option
"stackrealign" to CommandFlags.h which is used to force stack
realignment via llc's command line.

Out-of-tree projects currently using -force-align-stack to force stack
realignment should make changes to attach the attribute to the functions
in the IR.

Differential Revision: http://reviews.llvm.org/D11814


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247450 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 18:54:38 +00:00
Chris Bieneman
d917fe01ab [CMake] [Darwin] Need to set lto_library on CMAKE_MODULE_LINKER_FLAGS as well
This is a follow-on to r247308.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247443 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 18:39:19 +00:00
David Majnemer
4c53124330 [X86] Make sure startproc/endproc are paired
We used different conditions to determine if we should emit startproc vs
endproc.  Use the same condition to ensure that they will always be
paired.

This fixes PR24374.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247435 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 17:34:34 +00:00
Reid Kleckner
8ae5f645e7 [IR] Print the label operands of a catchpad like an invoke
The rest of the EH pads are fine, since they have at most one label and
take fewer operands for the personality.

Old catchpad vs. new:
  %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)] to label %__except.ret.10 unwind label %catchendblock.9
-----
  %5 = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@main@@" to i8*)]
          to label %__except.ret.10 unwind label %catchendblock.9

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247433 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 17:27:52 +00:00
Ahmed Bougacha
74869be273 [CodeGen] Refactor TLI/AtomicExpand interface to make LLSC explicit.
We used to have this magic "hasLoadLinkedStoreConditional()" callback,
which really meant two things:
- expand cmpxchg (to ll/sc).
- expand atomic loads using ll/sc (rather than cmpxchg).

Remove it, and, instead, introduce explicit callbacks:
- bool shouldExpandAtomicCmpXchgInIR(inst)
- AtomicExpansionKind shouldExpandAtomicLoadInIR(inst)

Differential Revision: http://reviews.llvm.org/D12557

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 17:08:28 +00:00
Ahmed Bougacha
f3d2de3832 [CodeGen] Rename AtomicRMWExpansionKind to AtomicExpansionKind.
This lets us generalize its usage to the other atomic instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247428 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 17:08:17 +00:00
NAKAMURA Takumi
dee68c80b9 [PR24785] Appease MSC18 to tweak optimizations.
This brings a warning.

  cl : Command line warning D9035: option 'Og-' has been deprecated and will be removed in a future release

We should resolve PR11951 to remove this tweak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247427 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 17:08:02 +00:00
Kostya Serebryany
18320e5c91 [libFuzzer] mention more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247425 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 16:34:14 +00:00
Daniel Sanders
5ab98c2cdf [mips] Add missing disassembler tests for MIPS64-MIPS64R5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247422 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 16:24:11 +00:00
Daniel Sanders
79f755355c [mips] Add missing MIPS32 - MIPS32R5 disassembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247420 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 15:28:19 +00:00
Daniel Sanders
b43119d746 [mips] Attempt to fix llvm-s390x-linux1
It doesn't seem to like the '|&' in the test command.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247418 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 14:57:54 +00:00
Daniel Sanders
8aa6e22f95 [mips] Add missing MIPS-IV disassembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247417 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 14:54:58 +00:00
Daniel Sanders
335f5c313b [mips] Add missing MIPS-III disassembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247416 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 14:48:46 +00:00
Arnaud A. de Grandmaison
7f81eabc26 Tweak 2 x86 gold tests so they can run on non-x86 platforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 14:45:34 +00:00
Daniel Sanders
5694c5fdb1 [mips] Add missing MIPS-II disassembler tests.
These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and were verified by checking the disassembler output is accepted by GAS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247414 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 14:34:41 +00:00
Yaron Keren
05d48de4fe Add #include llvm-config.h to Locale.cpp which depends on LLVM_ON_WIN32.
Source code was assuming that llvm-config.h would be included somehow but
up to r247253 that added #include "llvm/Support/Compiler.h" to StringRef.h
the config file was not actually included. The inclusion of llvm-config.h
caused a change of behaviour in tools/clang/test/Frontend/source-col-map.c:
previously it would output the original UTF-8 but now it outputs <U+03B1>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247409 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 13:22:47 +00:00
Daniel Sanders
f9c4a2d3bf Re-commit r247405: [mips] Add missing MIPS-I disassembler tests.
These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and verified by checking the disassembler output is accepted by GAS.

The problematic tests from the previous commit have been moved to
valid-xfail.txt for now.

Also, give invalid instructions some coverage. invalid-xfail.txt contains
instructions that should be invalid but successfully disassemble.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247407 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 12:59:03 +00:00
Daniel Sanders
0207031d90 Revert r247405: [mips] Add missing MIPS-I disassembler tests.
A small number of the added tests have operands that change on each round trip.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247406 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 12:42:38 +00:00
Daniel Sanders
2d14cb6f7a [mips] Add missing MIPS-I disassembler tests.
These tests were found by llvm-mc-fuzzer (see http://reviews.llvm.org/D12723)
and verified by checking the disassembler output is accepted by GAS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247405 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 12:24:06 +00:00
NAKAMURA Takumi
595af7ed85 PPCFrameLowering::emitEpilogue(): Avoid manipulating MBBI on iterator end.
It caused crash in MachineInstr::hasPropertyInBundle() since r247237.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247395 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 08:20:56 +00:00
NAKAMURA Takumi
15125487c5 Fix llvm/test/tools/gold/X86/bad-alias.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247391 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 08:03:17 +00:00
Frederic Riss
5f69f9fb81 [dsymutil] Discard useless location attributes.
When cloning the debug info for a function that hasn't been linked,
strip the DIEs from all location attributes that wouldn't contain any
meaningful information anyway.

This kind of situation can happen when a function got discarded by the
linker, but its debug information is still wanted in the final link
because it was marked as required as some other DIE dependency. The easiest
way to get into that situation is to have using directives. They get
linked unconditionally, but their targets might not always be present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247386 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-11 04:17:30 +00:00