Hans Wennborg [Thu, 18 Jul 2013 21:00:12 +0000 (21:00 +0000)]
Fix -Wdocumentation warning
s/Tokenize/Tokenizer/ to make the comment correspond to the
parameter name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186608
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 18 Jul 2013 20:34:26 +0000 (20:34 +0000)]
Add a test for .secure_log_unique.
It also doubles a test that F_Append works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186606
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 18 Jul 2013 19:13:06 +0000 (19:13 +0000)]
Revert "Remove DIBuilder cache of variable TheCU and change the few"
This reverts commit r186599 as I didn't want to commit this yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186601
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 18 Jul 2013 19:11:41 +0000 (19:11 +0000)]
Equal means ==, not !=. Thanks to Benjamin for catching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186600
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 18 Jul 2013 19:11:29 +0000 (19:11 +0000)]
Remove DIBuilder cache of variable TheCU and change the few
uses that wanted it. Also change the interface for createCompileUnit
to compensate. Fix comments that refer to TheCU as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186599
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 18 Jul 2013 18:42:52 +0000 (18:42 +0000)]
Small improvement to the use of GetFileType:
* assert that the return value is one of the documented values on msdn.
* on FILE_TYPE_UNKNOWN, check GetLastError.
Unfortunately I can't think of a way to get a FILE_TYPE_UNKNOWN on a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186595
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Thu, 18 Jul 2013 18:35:22 +0000 (18:35 +0000)]
Update to CodeGen tests to use CHECK-LABEL for labels corresponding to function definitions for more informative error messages. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186594
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 18 Jul 2013 18:34:21 +0000 (18:34 +0000)]
Handle constants without going through SCEV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186593
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 18 Jul 2013 18:20:45 +0000 (18:20 +0000)]
SLPVectorizer: Speedup isConsecutive by manually checking GEPs with multiple indices.
This brings the compile time of the SLP-Vectorizer to about 2.5% of OPT for my testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186592
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 18 Jul 2013 17:00:54 +0000 (17:00 +0000)]
Windows/Path.inc: Introduce file_type::character_file and file_type::fifo_file in sys::fs::getStatus(HANDLE).
It fixes llvm/test/Other/close-stderr.ll on msys.
FIXME: Provide unittests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186588
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 18 Jul 2013 16:52:05 +0000 (16:52 +0000)]
[Support] Beef up and expose the response file parsing in llvm::cl
The plan is to use it for clang and lld.
Major behavior changes:
- We can now parse UTF-16 files that have a byte order mark.
- PR16209: Don't drop backslashes on the floor if they don't escape
anything.
The actual parsing loop was based on code from Clang's driver.cpp,
although it's been rewritten to track its state with control flow rather
than state variables.
Reviewers: hans
Differential Revision: http://llvm-reviews.chandlerc.com/D1170
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186587
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 18 Jul 2013 15:38:50 +0000 (15:38 +0000)]
llvm/test/Other/close-stderr.ll: Mark this as XFAIL on msys, since r186560.
sys::fs::status() doesn't work on pipes. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186586
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 18 Jul 2013 13:17:26 +0000 (13:17 +0000)]
Forgot 'svn add' again, sorry!
Tests for r186574.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186580
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 18 Jul 2013 12:00:25 +0000 (12:00 +0000)]
Change 'n' to 'N' to keep consistent with other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186576
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 18 Jul 2013 11:53:22 +0000 (11:53 +0000)]
[ARMv8] Add NEON instructions VCVT{A, N, P, M}.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186574
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 18 Jul 2013 10:40:35 +0000 (10:40 +0000)]
[SystemZ] Use RNSBG
This should be the last of the R.SBG patches for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186573
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 18 Jul 2013 10:20:25 +0000 (10:20 +0000)]
Add Thumb tests for the ARMv8 FP instructions that I recently added.
Also, fix the namespace for two instructions that I missed previously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186572
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 18 Jul 2013 10:14:55 +0000 (10:14 +0000)]
[SystemZ] Generalize RxSBG SRA case
The original code only folded SRA into ROTATE ... SELECTED BITS
if there was no outer shift. This patch splits out that check
and generalises it slightly. The extra cases aren't really that
interesting, but this is paving the way for RNSBG support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186571
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 18 Jul 2013 10:06:15 +0000 (10:06 +0000)]
[SystemZ] Use RXSBG
Extend the previous R.SBG patches to handle XORs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186570
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Sandiford [Thu, 18 Jul 2013 09:45:08 +0000 (09:45 +0000)]
[SystemZ] Rename and formatting fixes
In hindsight, using "RISBG" for something that can be any type of
R.SBG instruction was a bit confusing, so this renames it to RxSBG.
That might not be the best choice either, since there is an instruction
called RXSBG, but hopefully the lower-case letter stands out enough.
While there I fixed a couple of GNUisms that had crept in --
sorry about that!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186569
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Thu, 18 Jul 2013 09:34:35 +0000 (09:34 +0000)]
Remove the extra leading 0 from VMAXNMND.
The N3VDIntnp pattern takes bits<5> and I gave it 6 bits.
Thanks to Jiangning Liu for spotting it!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186568
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Thu, 18 Jul 2013 09:28:35 +0000 (09:28 +0000)]
This patch extends mips register parsing methods to allow indexed register parsing. The corresponding test cases are added to the patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186567
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 18 Jul 2013 07:16:44 +0000 (07:16 +0000)]
Fix copy and paste bug from r186491 to make v2f64 use MOVAPD/MOVUPD as it should.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186566
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 18 Jul 2013 07:15:00 +0000 (07:15 +0000)]
Reapply r186316 with a fix for one bug where the code could walk off the
end of a vector. This was found with ASan. I've had one other report of
a crasher, but thus far been unable to reproduce the crash. It may well
be fixed with this version, and if not I'd like to get more information
from the build bots about what is happening.
See r186316 for the full commit log for the new implementation of the
SROA algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186565
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 18 Jul 2013 04:33:20 +0000 (04:33 +0000)]
SLPVectorizer: Speedup isConsecutive (that checks if two addresses are consecutive in memory) by checking for additional patterns that don't need to go through SCEV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186563
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 18 Jul 2013 04:28:21 +0000 (04:28 +0000)]
PPC: Support dynamic allocas with large alignment
Support for dynamic stack alignments in the PPC backend has been unfinished, in
part because it depends on dynamic stack realignment (which I only just
recently implemented fully). Now we can also support dynamic allocas with
higher than the default target stack alignment (16 bytes).
In order to round-up the requested size to the maximum requested alignment, we
need an additional register to hold the rounded-up size. We're already using one
scavenged register to hold the previous stack-pointer value (which needs to be
stored with the signal-safe stdux update), and so when we have dynamic allocas
and a large alignment, we allocate two emergency spill slots for the scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186562
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 18 Jul 2013 03:29:51 +0000 (03:29 +0000)]
Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186561
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 18 Jul 2013 03:04:20 +0000 (03:04 +0000)]
Convert two uses if fstat with sys::fs::status.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186560
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 18 Jul 2013 02:42:40 +0000 (02:42 +0000)]
Fix a regression I introduced back in r178147.
We don't want cast and dyn_cast to work on temporaries. They don't extend
lifetime like a direct bind to a reference would, so they can introduce
hard to find bugs.
I added tests to make sure we don't regress this. Thanks to Eli Friedman for
noticing this and for his suggestions on how to test it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186559
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 18 Jul 2013 02:34:51 +0000 (02:34 +0000)]
Give 'hasPath' a longer but clearer name 'isPotentiallyReachable'. Also expand
the comment. No functionality change. This change broken out of
http://llvm-reviews.chandlerc.com/D996 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186558
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 18 Jul 2013 00:27:46 +0000 (00:27 +0000)]
Get rid of the Dis/EnableDebugLocations() API.
I'm moving this functionality into clang instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186549
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 18 Jul 2013 00:23:50 +0000 (00:23 +0000)]
Update comment slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186548
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 17 Jul 2013 23:50:51 +0000 (23:50 +0000)]
PPC: Add base-pointer support to builtin setjmp/longjmp
First, this changes the base-pointer implementation to remove an unnecessary
complication (and one that is incompatible with how builtin SjLj is
implemented): instead of using r31 as the base pointer when it is not needed as
a frame pointer, now the base pointer will always be r30 when needed.
Second, we introduce another pseudo register, BP, which is used just like the FP
pseudo register to refer to the base register before we know for certain what
register it will be.
Third, we now save BP into the jmp_buf, and restore r30 from that slot in
longjmp. If the function that called setjmp did not use a base pointer, then
r30 will be overwritten by the setjmp-calling-function's restore code. FP
restoration (which is restored into r31) works the same way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186545
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 17 Jul 2013 23:25:22 +0000 (23:25 +0000)]
Add comparison operators for DIDescriptors to fix c++98 fallout
of operator bool change.
Also convert a variable in DebugIR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186544
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 17 Jul 2013 22:53:05 +0000 (22:53 +0000)]
Add an explicit operator bool conversion to DIDescriptor to make
it clear what we want to do. Unfortunately the conversion to
pointer operator fires now instead and chasing down all of the
conversions and making them explicit and handled is a large task
so add a FIXME with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186543
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 17 Jul 2013 22:41:16 +0000 (22:41 +0000)]
Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186541
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Wed, 17 Jul 2013 22:17:29 +0000 (22:17 +0000)]
Handle '.' correctly in hex float literal parsing.
There were a couple of different loops that were not handling
'.' correctly in APFloat::convertFromHexadecimalString; these mistakes
could lead to assertion failures and incorrect rounding for overlong
hex float literals.
Fixes PR16643.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186539
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Wed, 17 Jul 2013 22:13:44 +0000 (22:13 +0000)]
Add some uncovered attribute tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186538
91177308-0d34-0410-b5e6-
96231b3b80d8
Stephen Lin [Wed, 17 Jul 2013 20:06:03 +0000 (20:06 +0000)]
Restore r181216, which was partially reverted in r182499.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186533
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Jul 2013 19:58:28 +0000 (19:58 +0000)]
Fix a funny typo. Thanks to Aaron Ballman for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186532
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 17 Jul 2013 19:52:25 +0000 (19:52 +0000)]
Add a micro optimization to catch cases where the PtrA equals PtrB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186531
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Jul 2013 19:44:07 +0000 (19:44 +0000)]
Add FILE_SHARE_WRITE to openFileForRead.
This should fix the windows bots. It looks like the failing tests are of the
form
prog1 > file
prog2 file
and prog2 fails trying to read the file. The best fix would probably be to close
stdout/stderr in prog1, but it was not the intention of 186511 to change this,
so just restore the old behavior for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186530
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Wed, 17 Jul 2013 19:43:13 +0000 (19:43 +0000)]
Silencing an MSVC warning about signed vs unsigned comparison mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186529
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Wed, 17 Jul 2013 19:09:27 +0000 (19:09 +0000)]
[mips] Use "foreach" loop to make register definitions more concise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186528
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Gottesman [Wed, 17 Jul 2013 18:53:29 +0000 (18:53 +0000)]
Add -*- C++ -*- to InstrEmitter.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186527
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Wed, 17 Jul 2013 16:26:38 +0000 (16:26 +0000)]
OptParser.td: typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186517
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Wed, 17 Jul 2013 15:00:42 +0000 (15:00 +0000)]
This patch checks for valid mnemonics at the beginning of parseInstruction method, thus giving the user the right error message for non-existing instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186512
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Jul 2013 14:58:25 +0000 (14:58 +0000)]
Split openFileForRead into Windows and Unix versions.
This has some advantages:
* Lets us use native, utf16 windows functions.
* Easy to produce good errors on windows about trying to use a
directory when we want a file.
* Simplifies the unix version a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186511
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 17 Jul 2013 14:32:41 +0000 (14:32 +0000)]
Fix comparisons of alloca alignment in inliner merging
Duncan pointed out a mistake in my fix in r186425 when only one of the allocas
being compared had the target-default alignment. This is essentially his
suggested solution. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186510
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Medic [Wed, 17 Jul 2013 14:05:19 +0000 (14:05 +0000)]
Implement eret and deret(return from exception) instructions for Mips. Test examples are given.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186507
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Wed, 17 Jul 2013 14:03:49 +0000 (14:03 +0000)]
Add the tests that I forgot to 'svn add' with my previous commit (r186504).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186506
91177308-0d34-0410-b5e6-
96231b3b80d8
Joey Gouly [Wed, 17 Jul 2013 13:59:38 +0000 (13:59 +0000)]
[ARMv8] Add support for the NEON instructions vmaxnm/vminnm.
This adds a new class for non-predicable NEON instructions and a
new DecoderNamespace for v8 NEON instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186504
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 17 Jul 2013 12:31:50 +0000 (12:31 +0000)]
llvm-ar: doExtract(): Write extracted files with F_Binary. It should fix llvm/test/Object/extract.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186503
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 17 Jul 2013 11:01:05 +0000 (11:01 +0000)]
Ensure sys::getProcessTriple always uses a normalized triple. Patch by
Thomas B. Jablin, from PR16636.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186501
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Osborne [Wed, 17 Jul 2013 10:58:37 +0000 (10:58 +0000)]
[XCore] Ensure implicit operands aren't lost on the return instruction.
Patch by Robert Lytton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186500
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Wed, 17 Jul 2013 09:34:51 +0000 (09:34 +0000)]
Tweak the cmake interaction between CMAKE_BUILD_TYPE and LLVM_ENABLE_ASSERTIONS.
The issue is that CMAKE_BUILD_TYPE=RelWithDebInfo LLVM_ENABLE_ASSERTIONS=ON was
not building with assertions enabled. (I was unable to find what in the LLVM
source tree was adding -DNDEBUG to the build line in this case, so decided that
it must be cmake itself that was adding it - this may depend on the cmake
version). The fix treats any mode that is not Debug as being the same as
Release for this purpose (previously it was being assumed that cmake would only
add -DNDEBUG for Release and not for RelWithDebInfo or MinSizeRel). If other
versions of cmake don't add -DNDEBUG for RelWithDebInfo then that's OK: with
this change you just get a useless but harmless -UNDEBUG or -DNDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186499
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2013 06:58:23 +0000 (06:58 +0000)]
Teach x86 fast-isel to use AVX opcodes for vector stores when AVX is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186496
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 17 Jul 2013 06:53:51 +0000 (06:53 +0000)]
LLVMSymbolize.cpp: Fix build. Triple::ArchType is not a namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186494
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Wed, 17 Jul 2013 06:45:36 +0000 (06:45 +0000)]
llvm-symbolizer: be more careful with colons in file names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186493
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2013 05:57:45 +0000 (05:57 +0000)]
Make x86 fast-isel correctly choose between aligned and unaligned operations for vector stores. Fixes PR16640.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186491
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 17 Jul 2013 05:46:46 +0000 (05:46 +0000)]
Fix ARMFastISel::ARMEmitIntExt shift emission
My patch 'r183551 - ARM FastISel integer sext/zext improvements' was incorrect when emitting ARM register-immediate ASR, LSL, LSR instructions: they are pseudo-instructions in ARMInstrInfo.td and I should have used MOVsi instead.
This is not an issue when code is generated through a .s file, but is an issue when generated straight to a .o (-filetype=obj).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186489
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 17 Jul 2013 05:35:44 +0000 (05:35 +0000)]
PPC: Add CTR-register clobber to builtin setjmp
Because the builtin longjmp implementation uses a CTR-based indirect jump, when
the control flow arrives at the builtin setjmp call, the CTR register has
necessarily been clobbered. Correspondingly, this adds CTR to the list of
implicit definitions of the builtin setjmp pseudo instruction.
We don't need to add CTR to the implicit definitions of builtin longjmp
because, even though it does clobber the CTR register, the control flow cannot
return to inside the loop unless there is also a builtin setjmp call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186488
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Jul 2013 04:20:49 +0000 (04:20 +0000)]
Add simpler version of is_directory. It will be used in clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186486
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2013 03:54:53 +0000 (03:54 +0000)]
Mark a method 'const' and another 'static'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186485
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2013 03:43:10 +0000 (03:43 +0000)]
Make a few more static string pointers constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186484
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 17 Jul 2013 03:33:41 +0000 (03:33 +0000)]
Don't fallback to copy + delete in rename.
Rename's documentation says "Files are renamed as if by POSIX rename()". and it
is used for atomically updating output files from a temporary. Having rename
fallback to a non atomic copy has the potential to hide bugs, like using
a temporary file in /tmp instead of a unique name next to the final destination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186483
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2013 03:11:32 +0000 (03:11 +0000)]
Make constant string pointer into an array to remove a pointer lookup for every access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186482
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 17 Jul 2013 02:21:10 +0000 (02:21 +0000)]
raw_ostream.cpp: Introduce <fcntl.h> to let O_BINARY provided. Or, llvm::outs() would be set to O_TEXT by default.
llvm/test/Object/check_binary_output.ll is expected to pass on win32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186480
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 17 Jul 2013 00:48:31 +0000 (00:48 +0000)]
SLPVectorizer: Accelerate the isConsecutive check by replacing the subtraction of the two values with a simple SCEV expression that adds the offset to one of the pointers that we compare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186479
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 17 Jul 2013 00:45:52 +0000 (00:45 +0000)]
PPC: Implement base pointer and stack realignment
This builds on some frame-lowering code that has existed since 2005 (r24224)
but was disabled in 2008 (r48188) because it needed base pointer support to
function correctly. This implementation follows the strategy suggested by Dale
Johannesen in r48188 where the following comment was added:
This does not currently work, because the delta between old and new stack
pointers is added to offsets that reference incoming parameters after the
prolog is generated, and the code that does that doesn't handle a variable
delta. You don't want to do that anyway; a better approach is to reserve
another register that retains to the incoming stack pointer, and reference
parameters relative to that.
And now we do exactly that. If we don't need a frame pointer, then we use r31
as a base pointer. If we do need a frame pointer, then we use r30 as a base
pointer. The base pointer retains the value of the stack pointer before it was
decremented in the prologue. We then use the base pointer to resolve all
negative frame indicies. The basic scheme follows that for base pointers in the
X86 backend.
We use a base pointer when we need to dynamically realign the incoming stack
pointer. This currently applies only to static objects (dynamic allocas with
large alignments, and base-pointer support in SjLj lowering will come in future
commits).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186478
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 17 Jul 2013 00:42:37 +0000 (00:42 +0000)]
llvm/test/CodeGen/X86/vec_setcc.ll: Add explicit -mtriple=x86_64-unknown-unknown to satisfy win32-targeted configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186477
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2013 00:31:35 +0000 (00:31 +0000)]
Move string pointer from being a static class member to just a static global in the one file its needed in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186476
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 16 Jul 2013 23:21:16 +0000 (23:21 +0000)]
Add getModuleFlag(StringRef Key) to query a module flag given Key.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186470
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 16 Jul 2013 23:17:22 +0000 (23:17 +0000)]
llvm/test/Object/ar-create.test: Relax a CHECK line to satisfy localized message catalogue.
For example, 'No such file or directory' cannot be seen on Japanese version of msvcrt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186469
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 16 Jul 2013 23:16:57 +0000 (23:16 +0000)]
llvm/test/Object/check_binary_output.ll: Mark it as XFAIL on Windows. Investigating.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186468
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 16 Jul 2013 22:57:06 +0000 (22:57 +0000)]
flip the scev minus direction to simplify the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186466
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 16 Jul 2013 22:51:07 +0000 (22:51 +0000)]
SLPVectorizer: Improve the compile time of isConsecutive by adding a simple constant-gep check before using SCEV.
This check does not always work because not all of the GEPs use a constant offset, but it happens often enough to reduce the number of times we use SCEV.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186465
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 16 Jul 2013 22:01:40 +0000 (22:01 +0000)]
Related to r181161 - Indirect branches may not be the last branch in a basic
block. Blocks that have an indirect branch terminator, even if it's not the
last terminator, should still be treated as unanalyzable.
<rdar://problem/
14437274>
Reducing a useful regression test case is proving difficult - I hope to have
one soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186461
91177308-0d34-0410-b5e6-
96231b3b80d8
Tilmann Scheller [Tue, 16 Jul 2013 21:52:34 +0000 (21:52 +0000)]
ARM: Add support for the Thumb2 PLI alternate literal form.
This adds an instruction alias to make the assembler recognize the alternate literal form: pli [PC, #+/-<imm>]
See A8.8.129 in the ARM ARM (DDI 0406C.b).
Fixes <rdar://problem/
14403733>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186459
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 16 Jul 2013 20:22:35 +0000 (20:22 +0000)]
Update the examples for an API change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186453
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 16 Jul 2013 19:44:17 +0000 (19:44 +0000)]
Add a wrapper for open.
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186447
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 16 Jul 2013 19:22:07 +0000 (19:22 +0000)]
Finally, force the target for this test. Should unbreak non-x86 buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186445
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 16 Jul 2013 19:20:29 +0000 (19:20 +0000)]
XFAIL this test on mingw.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186444
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 16 Jul 2013 18:54:21 +0000 (18:54 +0000)]
Label names also differ between platforms. Use a relaxed regex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186442
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 16 Jul 2013 18:42:01 +0000 (18:42 +0000)]
Fix test not to fail when the target doesn't use leading underscores on symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186439
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 16 Jul 2013 18:26:48 +0000 (18:26 +0000)]
Cleanup testing case by using a shorter name for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186436
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:18 +0000 (18:26 +0000)]
Remove floats from live range splitting costs.
These floats all represented block frequencies anyway, so just use the
BlockFrequency class directly.
Some floating point computations remain in tryLocalSplit(). They are
estimating spill weights which are still floats.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186435
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 16 Jul 2013 18:26:15 +0000 (18:26 +0000)]
Reapply r185393.
Original commit message:
Remove floating point computations from SpillPlacement.cpp.
Patch by Benjamin Kramer!
Use the BlockFrequency class instead of floats in the Hopfield network
computations. This rescales the node Bias field from a [-2;2] float
range to two block frequencies BiasN and BiasP pulling in opposite
directions. This construct has a more predictable behavior when block
frequencies saturate.
The per-node scaling factors are no longer necessary, assuming the block
frequencies around a bundle are consistent.
This patch can cause the register allocator to make different spilling
decisions. The differences should be small.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186434
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 16 Jul 2013 18:20:45 +0000 (18:20 +0000)]
[X86] Use min/max to optimze unsigend vector comparison on X86
Use PMIN/PMAX for UGE/ULE vector comparions to reduce the number of required
instructions. This trick also works for UGT/ULT, but there is no advantage in
doing so. It wouldn't reduce the number of instructions and it would actually
reduce performance.
Reviewer: Ben
radar:
5972691
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186432
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 16 Jul 2013 17:56:07 +0000 (17:56 +0000)]
Make SpecialCaseList match full strings, as documented, using anchors.
Differential Revision: http://llvm-reviews.chandlerc.com/D1149
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186431
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Tue, 16 Jul 2013 17:44:23 +0000 (17:44 +0000)]
Test commit to verify write access.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186429
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 16 Jul 2013 17:14:33 +0000 (17:14 +0000)]
[Support] Add a Unicode conversion wrapper from UTF16 to UTF8
This is to support parsing UTF16 response files in LLVM/lib/Option for
lld and clang.
Reviewers: hans
Differential Revision: http://llvm-reviews.chandlerc.com/D1138
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186426
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 16 Jul 2013 17:10:55 +0000 (17:10 +0000)]
When the inliner merges allocas, it must keep the larger alignment
For safety, the inliner cannot decrease the allignment on an alloca when
merging it with another.
I've included two variants of the test case for this: one with DataLayout
available, and one without. When DataLayout is not available, if only one of
the allocas uses the default alignment (getAlignment() == 0), then they cannot
be safely merged.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186425
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 16 Jul 2013 16:00:32 +0000 (16:00 +0000)]
On error, close the temporary file descriptor.
With this change llvm-ar can remove the temporary file on windows too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186423
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 16 Jul 2013 15:25:17 +0000 (15:25 +0000)]
SLPVectorizer: Reduce the compile time of the consecutive store lookup.
Process groups of stores in chunks of 16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186420
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 16 Jul 2013 14:10:07 +0000 (14:10 +0000)]
Create files with mode 666. This matches the behavior of other unix tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186414
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Tue, 16 Jul 2013 14:04:08 +0000 (14:04 +0000)]
[Support] Fix some warnings when self-hosting clang on Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186413
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 16 Jul 2013 13:03:25 +0000 (13:03 +0000)]
[APFloat] PR16573: Avoid losing mantissa bits in ppc_fp128 to double truncation
When truncating to a format with fewer mantissa bits, APFloat::convert
will perform a right shift of the mantissa by the difference of the
precision of the two formats. Usually, this will result in just the
mantissa bits needed for the target format.
One special situation is if the input number is denormal. In this case,
the right shift may discard significant bits. This is usually not a
problem, since truncating a denormal usually results in zero (underflow)
after normalization anyway, since the result format's exponent range is
usually smaller than the target format's.
However, there is one case where the latter property does not hold:
when truncating from ppc_fp128 to double. In particular, truncating
a ppc_fp128 whose first double of the pair is denormal should result
in just that first double, not zero. The current code however
performs an excessive right shift, resulting in lost result bits.
This is then caught in the APFloat::normalize call performed by
APFloat::convert and causes an assertion failure.
This patch checks for the scenario of truncating a denormal, and
attempts to (possibly partially) replace the initial mantissa
right shift by decrementing the exponent, if doing so will still
result in a valid *target format* exponent.
Index: test/CodeGen/PowerPC/pr16573.ll
===================================================================
--- test/CodeGen/PowerPC/pr16573.ll (revision 0)
+++ test/CodeGen/PowerPC/pr16573.ll (revision 0)
@@ -0,0 +1,11 @@
+; RUN: llc < %s | FileCheck %s
+
+target triple = "powerpc64-unknown-linux-gnu"
+
+define double @test() {
+ %1 = fptrunc ppc_fp128 0xM818F2887B9295809800000000032D000 to double
+ ret double %1
+}
+
+; CHECK: .quad -
9111018957755033591
+
Index: lib/Support/APFloat.cpp
===================================================================
--- lib/Support/APFloat.cpp (revision 185817)
+++ lib/Support/APFloat.cpp (working copy)
@@ -1956,6 +1956,23 @@
X86SpecialNan = true;
}
+ // If this is a truncation of a denormal number, and the target semantics
+ // has larger exponent range than the source semantics (this can happen
+ // when truncating from PowerPC double-double to double format), the
+ // right shift could lose result mantissa bits. Adjust exponent instead
+ // of performing excessive shift.
+ if (shift < 0 && isFiniteNonZero()) {
+ int exponentChange = significandMSB() + 1 - fromSemantics.precision;
+ if (exponent + exponentChange < toSemantics.minExponent)
+ exponentChange = toSemantics.minExponent - exponent;
+ if (exponentChange < shift)
+ exponentChange = shift;
+ if (exponentChange < 0) {
+ shift -= exponentChange;
+ exponent += exponentChange;
+ }
+ }
+
// If this is a truncation, perform the shift before we narrow the storage.
if (shift < 0 && (isFiniteNonZero() || category==fcNaN))
lostFraction = shiftRight(significandParts(), oldPartCount, -shift);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186409
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Osborne [Tue, 16 Jul 2013 12:48:34 +0000 (12:48 +0000)]
[XCore] Fix printing of inline asm operands.
Previously an asm operand with no operand modifier would give the error
"invalid operand in inline asm".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186407
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Tue, 16 Jul 2013 12:15:36 +0000 (12:15 +0000)]
ARM: allow printing of ARM atomic DAG nodes.
We'd forgotten to provide string representations for the special ARMISD atomic
nodes; this adds them in. No effect on CodeGen, just makes the output of
"-view-whatever-dags" slightly more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186406
91177308-0d34-0410-b5e6-
96231b3b80d8