Commit Graph

94709 Commits

Author SHA1 Message Date
Richard Sandiford 3e2cbf18b7 Stablize MCK_Reg ordering in AsmMatcherEmitter
clang bootstraps intermittently failed for me due a difference in
the MCK_Reg ordering in ARMGenAsmMatcher.inc.  E.g. in my latest
run the stage 1 and stage 3 versions were the same but the stage 2
one was different (though still functionally correct).  This meant
that the .o comparison failed.

MCK_Regs were assigned by iterating over a std::set< std::set<Record*> >,
and since std::set is sorted lexicographically, the order depended on the
order of the pointer values.  This patch replaces the pointer ordering
with LessRecordByID.

llvm-svn: 188164
2013-08-12 10:39:45 +00:00
Richard Sandiford 564681c88d [SystemZ] Use CLC and IPM to implement memcmp
For now this is restricted to fixed-length comparisons with a length
in the range [1, 256], as for memcpy() and MVC.

llvm-svn: 188163
2013-08-12 10:28:10 +00:00
Richard Sandiford 761703a248 [SystemZ] Add a definition of the CLC instruction
llvm-svn: 188162
2013-08-12 10:17:33 +00:00
Richard Sandiford 87326c73c6 [SystemZ] Add a definition of the IPM instruction
llvm-svn: 188161
2013-08-12 10:05:58 +00:00
Chandler Carruth f11f1e43de Target a minimal terminfo library rather than necessarily a full curses
library for color support detection. This still will use a curses
library if that is all we have available on the system. This change
tries to use a smaller subset of the curses library, specifically the
subset that is on some systems split off into a separate library. For
example, if you install ncurses configured --with-tinfo, a 'libtinfo' is
install that provides just the terminfo querying functionality. That
library is now used instead of curses when it is available.

This happens to fix a build error on systems with that library because
when we tried to link ncurses into the binary, we didn't pull tinfo in
as well. =]

It should also provide an easy path for supporting the NetBSD
libterminfo library, but as I don't have access to a NetBSD system I'm
leaving adding that support to those folks.

llvm-svn: 188160
2013-08-12 09:49:17 +00:00
Tim Northover 707d68f082 Allow compatible extension attributes for tail calls
If the tail-callee and caller give the same bits via the same signext/zeroext
attribute then a tail-call should be allowed, since the extension has already
been done by the callee.

llvm-svn: 188159
2013-08-12 09:45:46 +00:00
Benjamin Kramer c9b7d47b21 Remove global construction. const char* is sufficient here.
No functionality change.

llvm-svn: 188158
2013-08-12 09:37:29 +00:00
Alexey Samsonov 34894630a1 Relax conditions of test added in r188156 to fix it on Windows
llvm-svn: 188157
2013-08-12 09:04:58 +00:00
Alexey Samsonov 9e4fdd2656 Introduce factory methods for SpecialCaseList
Summary:
Doing work in constructors is bad: this change suggests to
call SpecialCaseList::create(Path, Error) instead of
"new SpecialCaseList(Path)". Currently the latter may crash with
report_fatal_error, which is undesirable - sometimes we want to report
the error to user gracefully - for example, if he provides an incorrect
file as an argument of Clang's -fsanitize-blacklist flag.

Reviewers: pcc

Reviewed By: pcc

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1327

llvm-svn: 188156
2013-08-12 07:49:36 +00:00
Richard Sandiford feb34713d5 Fix big-endian handling of integer-to-vector bitcasts in InstCombine
These functions used to assume that the lsb of an integer corresponds
to vector element 0, whereas for big-endian it's the other way around:
the msb is in the first element and the lsb is in the last element.

Fixes MultiSource/Benchmarks/mediabench/gsm/toast for z.

llvm-svn: 188155
2013-08-12 07:26:09 +00:00
Reed Kotler d265e88827 Don't generate floating point stubs for mips16 code if the function
is actually an instrinsic that will not occur in libc. This list here
is not exhaustive but fixes the one places in test-suite where this occurs.
I have filed a bug against myself to research the full list and add them
to the array of such cases. In the future, actual stub generation will occur
in a later phase and we won't need this code because we will know at that time
during the compilation that in fact no helper function was even needed.

llvm-svn: 188149
2013-08-11 21:30:27 +00:00
Elena Demikhovsky 5fed3b95db AVX-512: Added more tests for BROADCAST
llvm-svn: 188148
2013-08-11 12:29:16 +00:00
Elena Demikhovsky cf5b1458e6 AVX-512: Added VPERM* instructons and MOV* zmm-to-zmm instructions.
Added a test for shuffles using VPERM.

llvm-svn: 188147
2013-08-11 07:55:09 +00:00
Chandler Carruth d7cd7e367e Re-instate r187323 which fast-tracks promotable allocas as soon as the
SROA-based analysis has enough information. This should work now that
both mem2reg *and* the SSAUpdater-based AllocaPromoter have been updated
to be able to promote the types of allocas that the SROA analysis
detects.

I've included tests for the AllocaPromoter that were only possible to
write once we fast-tracked promotable allocas without rewriting them.
This includes a test both for r187347 and r188145.

Original commit log for r187323:
"""
Now that mem2reg understands how to cope with a slightly wider set of uses of
an alloca, we can pre-compute promotability while analyzing an alloca for
splitting in SROA. That lets us short-circuit the common case of a bunch of
trivially promotable allocas. This cuts 20% to 30% off the run time of SROA for
typical frontend-generated IR sequneces I'm seeing. It gets the new SROA to
within 20% of ScalarRepl for such code. My current benchmark for these numbers
is PR15412, but it fits the general pattern of IR emitted by Clang so it should
be widely applicable.
"""

llvm-svn: 188146
2013-08-11 02:17:11 +00:00
Chandler Carruth c17283b407 Finish fixing the SSAUpdater-based AllocaPromoter strategy in SROA to cope with
the more general set of patterns that are now handled by mem2reg and that we
can detect quickly while doing SROA's initial analysis. Notably, this allows it
to promote through no-op bitcast and GEP sequences. A core part of the
SSAUpdater approach is the ability to test whether a particular instruction is
part of the set being promoted. Testing this becomes significantly more complex
in the world where the operand to every load and store isn't the alloca itself.
I ended up using the approach of walking up the def-chain until we find the
alloca. I benchmarked this against keeping a set of pointer operands and
keeping a set of the loads and stores we care about, and this one seemed faster
although the difference was very small.

No test case yet because currently the rewriting always "fixes" the inputs to
not require this. The next patch which re-enables early promotion of easy cases
in SROA will include a test case that specifically exercises this aspect of the
alloca promoter.

llvm-svn: 188145
2013-08-11 01:56:15 +00:00
Chandler Carruth 45b136f4cf Reformat some bits of AllocaPromoter and simplify the name and type of
our visiting datastructures in the AllocaPromoter/SSAUpdater path of
SROA. Also shift the order if clears around to be more consistent.

No functionality changed here, this is just a cleanup.

llvm-svn: 188144
2013-08-11 01:03:18 +00:00
Reed Kotler 705c5951ca Incorrect JAL instruction attributes caused the optimizer to make a wrong
instruction move. Just affects static relocation. -static works fine now
with mips16 for the most part.

llvm-svn: 188143
2013-08-10 22:18:22 +00:00
Arnold Schwaighofer 3dcdb89d69 Revert r188119 "Kill some duplicated code for removing unreachable BBs."
It is breaking builbots with libgmalloc enabled on Mac OS X.

$ cd llvm ; mkdir release ; cd release
$ ../configure --enable-optimized —prefix=$PWD/install
$ make
$ make check
$ Release+Asserts/bin/llvm-lit -v --param use_gmalloc=1 --param \
  gmalloc_path=/usr/lib/libgmalloc.dylib \
  ../test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll

llvm-svn: 188142
2013-08-10 20:16:06 +00:00
Venkatraman Govindaraju b50bf5a0e3 [Sparc] Enable xword directive in sparcv9.
llvm-svn: 188141
2013-08-10 20:13:20 +00:00
Matt Arsenault f55e5e7954 Teach ValueTracking about address spaces
llvm-svn: 188140
2013-08-10 17:34:08 +00:00
Niels Ole Salscheider d3a039fed2 R600/SI: FMA is faster than fmul and fadd for f64
llvm-svn: 188136
2013-08-10 10:38:54 +00:00
Niels Ole Salscheider 6509ac65a9 R600/SI: Add FMA pattern
llvm-svn: 188135
2013-08-10 10:38:47 +00:00
Rafael Espindola 6ee163875c Check for $PWD in llvm::sys::current_path.
Some users (clang, libTooling) require this. After this patch we can remove
the calls to getenv("PWD") from clang.

llvm-svn: 188125
2013-08-10 00:50:57 +00:00
Michael Gottesman d6ce6cbdac [objc-arc] Track if we encountered an additive overflow while computing {TopDown,BottomUp}PathCounts and do nothing if it occurred.
I fixed the aforementioned problems that came up on some of the linux boxes.
Major thanks to Nick Lewycky for his help debugging!

rdar://14590914

llvm-svn: 188122
2013-08-09 23:22:27 +00:00
Peter Collingbourne 32090aba06 Kill some duplicated code for removing unreachable BBs.
This moves removeUnreachableBlocksFromFn from SimplifyCFGPass.cpp
to Utils/Local.cpp and uses it to replace the implementation of
llvm::removeUnreachableBlocks, which appears to do a strict subset
of what removeUnreachableBlocksFromFn does.

Differential Revision: http://llvm-reviews.chandlerc.com/D1334

llvm-svn: 188119
2013-08-09 22:47:24 +00:00
Peter Collingbourne ae66d57bcf DataFlowSanitizer: Remove unreachable BBs so IR continues to verify
under the args ABI.

Differential Revision: http://llvm-reviews.chandlerc.com/D1316

llvm-svn: 188113
2013-08-09 21:42:53 +00:00
Daniel Dunbar 6dac00702c [lit] Remove old ExamplesTests directory.
- The actual tests have better coverage than those, and they weren't useful
   anymore.

llvm-svn: 188110
2013-08-09 21:39:36 +00:00
Daniel Dunbar ab320a673f [lit] Move ManyTests examples to lit/examples/many-tests.
llvm-svn: 188109
2013-08-09 21:39:28 +00:00
Daniel Dunbar c38c6f068b [lit] Drop deprecated aliases for lit and old module names.
llvm-svn: 188108
2013-08-09 21:39:24 +00:00
Daniel Dunbar 72868c74f3 [lit] Update lit's own tests to use lit_config and lit package, as appropriate.
llvm-svn: 188107
2013-08-09 21:39:17 +00:00
Reed Kotler be316cffa7 Add another intrinsic that LLVM gives an incorrect prototype to.
I need to go through all the runtime routine list and see if there
are any more I need to add for mips16 floating point. Prototypes must
be correct or else I don't know to add a helper function call.

llvm-svn: 188106
2013-08-09 21:33:41 +00:00
Michael Gottesman 8afcf3a408 [stackprotector] Simplify SP Pass so that we emit different fail basic blocks for each fail condition.
This patch decouples the stack protector pass so that we can support stack
protector implementations that do not use the IR level generated stack protector
fail basic block.

No codesize increase is caused by this change since the MI level tail merge pass
properly merges together the fail condition blocks (see the updated test).

llvm-svn: 188105
2013-08-09 21:26:18 +00:00
Jakub Staszak 23ec6a97d1 Mark obviously const methods. Also use reference for parameters when possible.
llvm-svn: 188103
2013-08-09 20:53:48 +00:00
Daniel Dunbar 04388afd41 [docs] Update TestingGuide's note on how to run with Valgrind.
llvm-svn: 188097
2013-08-09 19:39:48 +00:00
Daniel Dunbar 2fc495370a [lit] Fix typo.
- Noticed by edward-san (IRC).

llvm-svn: 188096
2013-08-09 19:39:42 +00:00
Benjamin Kramer 21585fd9c1 Add a overload to CostTable which allows it to infer the size of the table.
Use it to avoid repeating ourselves too often. Also store MVT::SimpleValueType
in the TTI tables so they can be statically initialized, MVT's constructors
create bloated initialization code otherwise.

llvm-svn: 188095
2013-08-09 19:33:32 +00:00
Andrea Di Biagio 9b5d23bccb Add description of function attribute 'minsize' in LangRef.rst.
llvm-svn: 188091
2013-08-09 18:42:18 +00:00
Stephen Lin 5532f9a9c3 CHECK-LABEL-ify tests
llvm-svn: 188087
2013-08-09 17:50:15 +00:00
David Blaikie f103c2f946 DebugInfo: provide the ability to add members to a class after it has been constructed
This is necessary to allow Clang to only emit implicit members when
there is code generated for them, rather than whenever they are ODR
used.

llvm-svn: 188082
2013-08-09 17:17:12 +00:00
Benjamin Kramer eeeb4828bb Make directory iterator sentinels free.
This trades some complexity in operator== for not introducing static objects
into any functions using recursive directory iterators.

llvm-svn: 188081
2013-08-09 17:03:39 +00:00
Hans Wennborg 735d0dcccf ELFObjectFile.h: Silence warning on Windows
The compiler was warning about using | on a uintptr_t and bool:

  Object/ELFObjectFile.h(131) : warning C4805: '|' : unsafe
  mix of type 'uintptr_t' and type 'bool' in operation

I think the warning might be useful in other cases, so I added
a cast instead of disabling it altogether.

llvm-svn: 188079
2013-08-09 16:48:21 +00:00
Daniel Dunbar c65848caa5 [tests] Update to use lit_config and lit package, as appropriate.
llvm-svn: 188076
2013-08-09 16:22:05 +00:00
Benjamin Kramer df03449a0a Make helper static and fix formatting.
llvm-svn: 188074
2013-08-09 14:44:41 +00:00
Mihai Popa 4c2801f7fd This fixes the Thumb2 CPS assembly syntax.
In Thumb1, only one variant is supported: CPS{effect} {flags}

Thumb2 supports three:
CPS{effect}.W {flags}
CPS{effect} {flags} {mode}
CPS {mode}

Canonically, .W should be used only when ambiguity is present between encodings of different width.
The wide suffix is still accepted for the latter two forms via aliases.

llvm-svn: 188071
2013-08-09 13:52:32 +00:00
Mihai Popa ad18d3ce53 Fix assembling of Thumb2 branch instructions.
The long encoding for Thumb2 unconditional branches is broken.
Additionally, there is no range checking for target operands; as such 
for instructions originating in assembly code, only short Thumb encodings
are generated, regardless of the bitsize needed for the offset.

Adding range checking is non trivial due to the representation of Thumb
branch instructions. There is no true difference between conditional and
unconditional branches in terms of operands and syntax - even unconditional
branches have a predicate which is expected to match that of the IT block
they are in. Yet, the encodings and the permitted size of the offset differ.

Due to this, for any mnemonic there are really 4 encodings to choose for.

The problem cannot be handled in the parser alone or by manipulating td files.
Because the parser builds first a set of match candidates and then checks them
one by one, whatever tablegen-only solution might be found will ultimately be
dependent of the parser's evaluation order. What's worse is that due to the fact
that all branches have the same syntax and the same kinds of operands, that 
order is governed by the lexicographical ordering of the names of operand 
classes...

To circumvent all this, any necessary disambiguation is added to the instruction
validation pass.

llvm-svn: 188067
2013-08-09 10:38:32 +00:00
Benjamin Kramer 054f422dc5 Remove byte order mark from source file.
llvm-svn: 188066
2013-08-09 10:31:14 +00:00
Ulrich Weigand 173ae88a55 Add back missing PPC relocation types.
llvm-svn: 188064
2013-08-09 09:42:14 +00:00
Richard Sandiford 9140910be8 [SystemZ] Update README
llvm-svn: 188062
2013-08-09 09:25:57 +00:00
Alexey Samsonov e7c765fe52 Try to unbreak Windows build after r188022
llvm-svn: 188057
2013-08-09 07:34:06 +00:00
Craig Topper 215b00a66a Add missing 'v' prefix in front of palignr on one of checks.
llvm-svn: 188054
2013-08-09 05:41:12 +00:00