OSDN Git Service
NAKAMURA Takumi [Mon, 14 Sep 2015 11:14:39 +0000 (11:14 +0000)]
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247543
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 14 Sep 2015 06:16:44 +0000 (06:16 +0000)]
GlobalsAAResult: Try to fix crash.
DeletionCallbackHandle holds GAR in its creation. It assumes;
- It is registered as CallbackVH. It should not be moved in its life.
- Its parent, GAR, may be moved.
To move list<DeletionCallbackHandle> GlobalsAAResult::Handles,
GAR must be updated with the destination in GlobalsAAResult(&&).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247534
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 13 Sep 2015 18:01:25 +0000 (18:01 +0000)]
[TableGen] Use range-based for loops and make a helper function static. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247529
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 13 Sep 2015 18:01:20 +0000 (18:01 +0000)]
[TableGen] Simplify some code by using StringRef::find instead of std::find. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247528
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 13 Sep 2015 18:01:09 +0000 (18:01 +0000)]
[TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247527
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 13 Sep 2015 11:28:45 +0000 (11:28 +0000)]
[X86][MMX] Added shuffle decodes for MMX/3DNow! shuffles.
Added shuffle decodes for MMX PUNPCK + PSHUFW shuffles.
Added shuffle decodes for 3DNow! PSWAPD shuffles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247526
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 13 Sep 2015 08:23:27 +0000 (08:23 +0000)]
[FunctionAttrs] Move the malloc-like test to a static helper function
that could be used from a new pass manager. This one makes particular
sense as a static helper as it doesn't even need TLI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247525
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sun, 13 Sep 2015 08:17:14 +0000 (08:17 +0000)]
[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
Elena Demikhovsky [Sun, 13 Sep 2015 08:15:15 +0000 (08:15 +0000)]
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
Chandler Carruth [Sun, 13 Sep 2015 08:03:23 +0000 (08:03 +0000)]
[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
Chandler Carruth [Sun, 13 Sep 2015 07:50:43 +0000 (07:50 +0000)]
[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
Chandler Carruth [Sun, 13 Sep 2015 06:57:25 +0000 (06:57 +0000)]
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
Chandler Carruth [Sun, 13 Sep 2015 06:47:20 +0000 (06:47 +0000)]
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
Davide Italiano [Sun, 13 Sep 2015 04:09:40 +0000 (04:09 +0000)]
[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
Sanjay Patel [Sat, 12 Sep 2015 19:47:50 +0000 (19:47 +0000)]
[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
Ahmed Bougacha [Sat, 12 Sep 2015 18:51:23 +0000 (18:51 +0000)]
[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
Simon Pilgrim [Sat, 12 Sep 2015 18:26:47 +0000 (18:26 +0000)]
[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
Joerg Sonnenberger [Sat, 12 Sep 2015 16:30:32 +0000 (16:30 +0000)]
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
Simon Pilgrim [Sat, 12 Sep 2015 16:03:06 +0000 (16:03 +0000)]
[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
Simon Pilgrim [Sat, 12 Sep 2015 15:36:41 +0000 (15:36 +0000)]
[X86] Added i1 vector sextload tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247509
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 12 Sep 2015 15:33:05 +0000 (15:33 +0000)]
[X86][FMA] Refreshed fma tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247508
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 12 Sep 2015 15:27:31 +0000 (15:27 +0000)]
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
Sanjay Patel [Sat, 12 Sep 2015 14:58:04 +0000 (14:58 +0000)]
[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
Simon Pilgrim [Sat, 12 Sep 2015 14:00:17 +0000 (14:00 +0000)]
Fixed unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247505
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 12 Sep 2015 13:39:53 +0000 (13:39 +0000)]
[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
Simon Pilgrim [Sat, 12 Sep 2015 11:45:24 +0000 (11:45 +0000)]
[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
Chandler Carruth [Sat, 12 Sep 2015 09:09:14 +0000 (09:09 +0000)]
[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
Larisse Voufo [Sat, 12 Sep 2015 01:41:55 +0000 (01:41 +0000)]
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
Bruce Mitchener [Sat, 12 Sep 2015 01:17:08 +0000 (01:17 +0000)]
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
Hal Finkel [Sat, 12 Sep 2015 00:08:21 +0000 (00:08 +0000)]
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
Adrian Prantl [Fri, 11 Sep 2015 23:45:30 +0000 (23:45 +0000)]
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
Davide Italiano [Fri, 11 Sep 2015 22:04:21 +0000 (22:04 +0000)]
[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
Davide Italiano [Fri, 11 Sep 2015 20:47:35 +0000 (20:47 +0000)]
[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
Yunzhong Gao [Fri, 11 Sep 2015 20:01:53 +0000 (20:01 +0000)]
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
Sanjay Patel [Fri, 11 Sep 2015 19:29:18 +0000 (19:29 +0000)]
typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247454
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 11 Sep 2015 18:54:38 +0000 (18:54 +0000)]
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
Chris Bieneman [Fri, 11 Sep 2015 18:39:19 +0000 (18:39 +0000)]
[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
David Majnemer [Fri, 11 Sep 2015 17:34:34 +0000 (17:34 +0000)]
[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
Reid Kleckner [Fri, 11 Sep 2015 17:27:52 +0000 (17:27 +0000)]
[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
Ahmed Bougacha [Fri, 11 Sep 2015 17:08:28 +0000 (17:08 +0000)]
[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
Ahmed Bougacha [Fri, 11 Sep 2015 17:08:17 +0000 (17:08 +0000)]
[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
NAKAMURA Takumi [Fri, 11 Sep 2015 17:08:02 +0000 (17:08 +0000)]
[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
Kostya Serebryany [Fri, 11 Sep 2015 16:34:14 +0000 (16:34 +0000)]
[libFuzzer] mention more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247425
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Sep 2015 16:24:11 +0000 (16:24 +0000)]
[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
Daniel Sanders [Fri, 11 Sep 2015 15:28:19 +0000 (15:28 +0000)]
[mips] Add missing MIPS32 - MIPS32R5 disassembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247420
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Sep 2015 14:57:54 +0000 (14:57 +0000)]
[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
Daniel Sanders [Fri, 11 Sep 2015 14:54:58 +0000 (14:54 +0000)]
[mips] Add missing MIPS-IV disassembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247417
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Fri, 11 Sep 2015 14:48:46 +0000 (14:48 +0000)]
[mips] Add missing MIPS-III disassembler tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247416
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Fri, 11 Sep 2015 14:45:34 +0000 (14:45 +0000)]
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
Daniel Sanders [Fri, 11 Sep 2015 14:34:41 +0000 (14:34 +0000)]
[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
Yaron Keren [Fri, 11 Sep 2015 13:22:47 +0000 (13:22 +0000)]
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
Daniel Sanders [Fri, 11 Sep 2015 12:59:03 +0000 (12:59 +0000)]
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
Daniel Sanders [Fri, 11 Sep 2015 12:42:38 +0000 (12:42 +0000)]
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
Daniel Sanders [Fri, 11 Sep 2015 12:24:06 +0000 (12:24 +0000)]
[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
NAKAMURA Takumi [Fri, 11 Sep 2015 08:20:56 +0000 (08:20 +0000)]
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
NAKAMURA Takumi [Fri, 11 Sep 2015 08:03:17 +0000 (08:03 +0000)]
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
Frederic Riss [Fri, 11 Sep 2015 04:17:30 +0000 (04:17 +0000)]
[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
Frederic Riss [Fri, 11 Sep 2015 04:17:25 +0000 (04:17 +0000)]
[dsymutil] Rename some variables NFC.
lldb doesn't like having variables named as an existing type. In order to
ease debugging, rename those variables to avoid that conflict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247385
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 11 Sep 2015 03:28:37 +0000 (03:28 +0000)]
Fix the gold test cases after alias changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247381
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 11 Sep 2015 03:22:04 +0000 (03:22 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter for global aliases
update.py:
import fileinput
import sys
import re
alias_match_prefix = r"(.*(?:=|:|^)\s*(?:external |)(?:(?:private|internal|linkonce|linkonce_odr|weak|weak_odr|common|appending|extern_weak|available_externally) )?(?:default |hidden |protected )?(?:dllimport |dllexport )?(?:unnamed_addr |)(?:thread_local(?:\([a-z]*\))? )?alias"
plain = re.compile(alias_match_prefix + r" (.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|addrspacecast|\[\[[a-zA-Z]|\{\{).*$)")
cast = re.compile(alias_match_prefix + r") ((?:bitcast|inttoptr|addrspacecast)\s*\(.* to (.*?)(| addrspace\(\d+\) *)\*\)\s*(?:;.*)?$)")
gep = re.compile(alias_match_prefix + r") ((?:getelementptr)\s*(?:inbounds)?\s*\((?P<type>.*), (?P=type)(?:\s*addrspace\(\d+\)\s*)?\* .*\)\s*(?:;.*)?$)")
def conv(line):
m = re.match(cast, line)
if m:
return m.group(1) + " " + m.group(3) + ", " + m.group(2)
m = re.match(gep, line)
if m:
return m.group(1) + " " + m.group(3) + ", " + m.group(2)
m = re.match(plain, line)
if m:
return m.group(1) + ", " + m.group(2) + m.group(3) + "*" + m.group(4) + "\n"
return line
for line in sys.stdin:
sys.stdout.write(conv(line))
apply.sh:
for name in "$@"
do
python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
rm -f "$name.tmp"
done
The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247378
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 11 Sep 2015 03:14:00 +0000 (03:14 +0000)]
[modules] Move ConvertUTF.h to a separate submodule that doesn't require C++.
The former setup once resulted in us ignoring the module for C compilations,
but Clang now errors on this if the header is included from C code (which it is).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247377
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Fri, 11 Sep 2015 02:47:30 +0000 (02:47 +0000)]
Fixed a bug that BranchProbability is not defined in BlockFrequency.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247376
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 11 Sep 2015 01:34:59 +0000 (01:34 +0000)]
AsmWriter: Avoid O(N^2) processing of metadata
Fix embarrassing bugs I introduced to the `SlotTracker` in or around
r235785. I had us iterating through every instruction in a function
(and hitting a map in the LLVMContext) for every basic block in the
function.
While there, completely avoid the call to
`SlotTracker::processFunctionMetadata()` from
`SlotTracker::processFunction()` if we've speculatively done this
already in `SlotTracker::processModule()` by checking
`ShouldInitializeAllMetadata` (this wasn't an algorithmic problem, but
it's touching the same line of code).
Fixes PR24699.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247372
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 11 Sep 2015 01:33:48 +0000 (01:33 +0000)]
Revert "[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite"
This reverts commit r247356.
Breaks test/Transforms/InstCombine/pr8547.ll with:
Wrong types for attribute: byval inalloca nest noalias nocapture nonnull readnone readonly sret dereferenceable(1) dereferenceable_or_null(1)
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 nonnull %conv2) #0
LLVM ERROR: Broken function found, compilation aborted!
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247371
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 11 Sep 2015 00:20:58 +0000 (00:20 +0000)]
[libFuzzer] perform fewer crossover operations compared to plain mutations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247364
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Sep 2015 23:59:45 +0000 (23:59 +0000)]
Add .exe check to Execute to fix clang-modernize tests broken in r247358
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247361
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 10 Sep 2015 23:30:27 +0000 (23:30 +0000)]
[modules] Add another .def file to our list of textual headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247359
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Sep 2015 23:28:06 +0000 (23:28 +0000)]
ScanDirForExecutable on Windows fails to find executables with the "exe" extension in name
When the driver tries to locate a program by its name, e.g. a linker, it
scans the paths provided by the toolchain using the ScanDirForExecutable
function. If the lookup fails, the driver uses
llvm::sys::findProgramByName. Unlike llvm::sys::findProgramByName,
ScanDirForExecutable is not aware of file extensions. If the program has
the "exe" extension in its name, which is very common on Windows,
ScanDirForExecutable won't find it under the toolchain-provided paths.
This patch changes the Windows version of the "`can_execute`" function
called by ScanDirForExecutable to respect file extensions, similarly to
llvm::sys::findProgramByName.
Patch by Oleg Ranevskyy
Reviewers: rnk
Differential Revision: http://reviews.llvm.org/D12711
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247358
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Thu, 10 Sep 2015 23:10:42 +0000 (23:10 +0000)]
Pass BranchProbability/BlockMass by value instead of const& as they are small. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247357
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Thu, 10 Sep 2015 23:04:49 +0000 (23:04 +0000)]
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of passing arguments at callsite
Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of passing arguments at callsite. In this way it can handle cases where the argument does not have nonnull attribute but has a dominating null check from the CFG.
Reviewers: reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12779
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247356
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 10 Sep 2015 22:46:38 +0000 (22:46 +0000)]
Mark another method const. Sorry for missing this one the first time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247354
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Thu, 10 Sep 2015 22:35:41 +0000 (22:35 +0000)]
[InstCombineCalls] Use isKnownNonNullAt() to check nullness of gc.relocate return value
Summary: This patch replaces isKnownNonNull() with isKnownNonNullAt() when checking nullness of gc.relocate return value. In this way it can handle cases where the relocated value does not have nonnull attribute but has a dominating null check from the CFG.
Reviewers: reames
Subscribers: llvm-commits, sanjoy
Differential Revision: http://reviews.llvm.org/D12772
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247353
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Thu, 10 Sep 2015 22:34:39 +0000 (22:34 +0000)]
Remove gcc warning when comparing an unsigned var for >= 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247352
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Sep 2015 22:00:02 +0000 (22:00 +0000)]
[WinEH] Push and pop EBP for 32-bit funclets
The Win32 EH runtime caller does not preserve EBP, even though it does
preserve the CSRs (EBX, ESI, EDI) for us. The result was that each
finally funclet call would leave the frame pointer off by 12 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247348
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 10 Sep 2015 21:51:19 +0000 (21:51 +0000)]
AMDGPU: Simplify debug printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247345
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 10 Sep 2015 21:51:15 +0000 (21:51 +0000)]
AMDGPU: Use StringRef value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247344
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Thu, 10 Sep 2015 21:49:06 +0000 (21:49 +0000)]
[SPARC] Switch to the Machine Scheduler.
The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler
was making poor scheduling decisions, causing high register pressure and
extraneous register spills.
Switching to the newer machine scheduler generates better code -- even
without there being a machine model defined for SPARC yet.
(Actually committing the test changes too, this time, unlike r247315)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247343
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 10 Sep 2015 21:48:36 +0000 (21:48 +0000)]
Mark two methods const.
While at it, optimize getOffset a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247342
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Sep 2015 21:46:36 +0000 (21:46 +0000)]
Fix SEH state numbering algorithm to handle cleanupendpads
WinEHPrepare's new coloring algorithm really expects to see
cleanupendpads now, so Clang will start emitting them soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247341
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Thu, 10 Sep 2015 21:12:57 +0000 (21:12 +0000)]
[LV] Relax Small Size Reduction Type Requirement
This patch enables small size reductions in which the source types are smaller
than the reduction type (e.g., computing an i16 sum from the values in an i8
array). The previous behavior was to only allow small size reductions if the
source types and reduction type were the same. The change accounts for the fact
that the existing sign- and zero-extend instructions in these cases should
still be included in the cost model.
Differential Revision: http://reviews.llvm.org/D12770
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247337
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 10 Sep 2015 21:05:58 +0000 (21:05 +0000)]
[RuntimeDyld] Support non-zero addends for the MachO X86_64 SUBTRACTOR reloc.
This functionality was accidentally left out of r247119.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247336
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 10 Sep 2015 20:44:36 +0000 (20:44 +0000)]
[RuntimeDyld] Fix a bug in debugging output: all sections should be dumped
before any relocations have been applied, and again after all relocations have
been applied.
Previously each section was dumped before and after relocations targetting it
were applied, but this only shows the impact of relocations that point to other
symbols in the same section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247335
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 10 Sep 2015 20:34:57 +0000 (20:34 +0000)]
Add an explicit 'inline' specifier to these static functions. GCC is
warning on them having always_inline attribute for reasons I don't fully
understand -- static functions are just as inlinable as inline
functions in terms of linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247334
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 10 Sep 2015 20:07:25 +0000 (20:07 +0000)]
Correct the return type of CreateCleanupEndPad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247331
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Thu, 10 Sep 2015 19:42:03 +0000 (19:42 +0000)]
Revert "[SPARC] Switch to the Machine Scheduler."
This reverts commit r247315.
Accidentally omitted test changes; will resubmit full change shortly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247328
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 10 Sep 2015 18:50:09 +0000 (18:50 +0000)]
[IR] Conservatively mark 'catchpad' as accessing memory
The exact semantics of 'catchpad' are really in the hands of the
personality routine so we shouldn't assume that they have no side
effects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247322
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 10 Sep 2015 18:48:38 +0000 (18:48 +0000)]
[libFuzzer] refactor the code to allow building libFuzzer on platforms that don't have dfsan and don't support weak functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247321
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 10 Sep 2015 18:22:33 +0000 (18:22 +0000)]
[CMake] Add lto subdirectory explicitly.
This is required because ExternalProject_Add requires all targets specified in the DEPENDS argument must exist before calling ExternalProject_Add.
I have a follow-up patch to clang that enables using the just-built libLTO in bootstrap builds, so we need to be able to add the LTO target as a dependency in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247316
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Thu, 10 Sep 2015 18:20:45 +0000 (18:20 +0000)]
[SPARC] Switch to the Machine Scheduler.
The (mostly-deprecated) SelectionDAG-based ILPListDAGScheduler scheduler
was making poor scheduling decisions, causing high register pressure and
extraneous register spills.
Switching to the newer machine scheduler generates better code -- even
without there being a machine model defined for SPARC yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247315
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthew Simpson [Thu, 10 Sep 2015 18:12:47 +0000 (18:12 +0000)]
[SCEV] Consistently Handle Expressions That Cannot Be Divided
This patch addresses the issue of SCEV division asserting on some
input expressions (e.g., non-affine expressions) and quietly giving
up on others. When giving up, we set the quotient to be equal to
zero and the remainder to be equal to the numerator. With this
patch, we always quietly give up when we cannot perform the
division.
This patch also adds a test case for DependenceAnalysis that
previously caused an assertion.
Differential Revision: http://reviews.llvm.org/D11725
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247314
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Thu, 10 Sep 2015 18:08:35 +0000 (18:08 +0000)]
[MergeFuncs] Fix callsite attributes in thunk generation
This change correctly sets the attributes on the callsites
generated in thunks. This makes sure things such as sret, sext, etc.
are correctly set, so that the call can be a proper tailcall.
Also, the transfer of attributes in the replaceDirectCallers function
appears to be unnecessary, but until this is confirmed it will remain.
Author: jrkoenig
Reviewers: dschuff, jfb
Subscribers: llvm-commits, nlewycky
Differential revision: http://reviews.llvm.org/D12581
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247313
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 10 Sep 2015 18:03:45 +0000 (18:03 +0000)]
Tidy up some alias syntax to make explicit pointer type migration easier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247312
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 10 Sep 2015 17:55:02 +0000 (17:55 +0000)]
[CMake] s/LLVM_SOURCE_DIR/LLVM_MAIN_SRC_DIR/
Fix-up for r247305 to use the right variable. There's another use of
LLVM_SOURCE_DIR in this file that is probably also questionable, but it's
for Windows so I'm going to leave it alone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247311
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 10 Sep 2015 17:44:47 +0000 (17:44 +0000)]
[SimplifyCFG] Use known bits to eliminate dead switch defaults
This is a follow up to http://reviews.llvm.org/D11995 implementing the suggestion by Hans.
If we know some of the bits of the value being switched on, we know that the maximum number of unique cases covers the unknown bits. This allows to eliminate switch defaults for large integers (i32) when most bits in the value are known.
Note that I had to make the transform contingent on not having any dead cases. This is conservatively correct with the old code, but required for the new code since we might have a dead case which varies one of the known bits. Counting that towards our number of covering cases would be bad. If we do have dead cases, we'll eliminate them first, then revisit the possibly dead default.
Differential Revision: http://reviews.llvm.org/D12497
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247309
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 10 Sep 2015 17:28:51 +0000 (17:28 +0000)]
[CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247308
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 10 Sep 2015 17:23:32 +0000 (17:23 +0000)]
[CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overridden
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247306
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 10 Sep 2015 17:18:51 +0000 (17:18 +0000)]
[CMake] Fix Xcode build with LLVM_ENABLE_OBJLIB.
This amends chapuni's r246156 to handle an Xcode quirk, one even called out
in the CMake documentation:
Some native build systems may not like targets that have only object files,
so consider adding at least one real source file to any target that
references $<TARGET_OBJECTS:objlib>.
I've limited the scope of this hack to Xcode for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247305
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 10 Sep 2015 17:13:58 +0000 (17:13 +0000)]
Debug Info: Allow a DIModule to appear as the scope of other entities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247304
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 10 Sep 2015 17:03:10 +0000 (17:03 +0000)]
[docs][PerformanceTips] Add text on allocas and alignment
This summarizes two recent llvm-dev discussions. Most of the text provided by David Chisnall and Benoit Belley with minor editting by me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247301
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 10 Sep 2015 16:57:57 +0000 (16:57 +0000)]
[libFuzzer] add two more variants of FuzzerDriver for convenience
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247300
91177308-0d34-0410-b5e6-
96231b3b80d8