Logan Chien [Thu, 8 Jan 2015 13:19:07 +0000 (13:19 +0000)]
Frontend: Fix SourceColumnMap assertion failure on non-ascii characters.
If there are some non-ascii character in the input source code, the
column index might be smallar than the byte index. This will result
in two possible assertion failures. This CL fixes the computation of
the column index and byte index.
1. The assertion in startOfNextColumn() and startOfPreviousColumn()
should not be raised when the byte index is greater than the column
index since the non-ascii characters may use more than one bytes to
store a character in a column.
2. The length of the caret line should be equal to the number of columns
of source line, instead of the length of the source line. Otherwise,
the assertion in selectInterestingSourceRegion will be raised because
the removed columns plus the kept columns are not greater than the max
column, which means that we should not remove any column at all.
llvm-svn: 225442
Elena Demikhovsky [Thu, 8 Jan 2015 12:29:19 +0000 (12:29 +0000)]
Masked Load/Store - fixed a bug in type legalization.
llvm-svn: 225441
Michael Kuperstein [Thu, 8 Jan 2015 12:05:02 +0000 (12:05 +0000)]
Fix a think-o in the test for r225438.
llvm-svn: 225440
Michael Kuperstein [Thu, 8 Jan 2015 11:59:43 +0000 (11:59 +0000)]
Fix include ordering, NFC.
llvm-svn: 225439
Michael Kuperstein [Thu, 8 Jan 2015 11:50:58 +0000 (11:50 +0000)]
[X86] Don't try to generate direct calls to TLS globals
The call lowering assumes that if the callee is a global, we want to emit a direct call.
This is correct for regular globals, but not for TLS ones.
Differential Revision: http://reviews.llvm.org/D6862
llvm-svn: 225438
Michael Kuperstein [Thu, 8 Jan 2015 11:04:38 +0000 (11:04 +0000)]
Move SPAdj logic from PEI into the targets (NFC)
PEI tries to keep track of how much starting or ending a call sequence adjusts the stack pointer by, so that it can resolve frame-index references. Currently, it takes a very simplistic view of how SP adjustments are done - both FrameStartOpcode and FrameDestroyOpcode adjust it exactly by the amount written in its first argument.
This view is in fact incorrect for some targets (e.g. due to stack re-alignment, or because it may want to adjust the stack pointer in multiple steps). However, that doesn't cause breakage, because most targets (the only in-tree exception appears to be 32-bit ARM) rely on being able to simplify the call frame pseudo-instructions earlier, so this code is never hit.
Moving the computation into TargetInstrInfo allows targets to override the way the adjustment is computed if they need to have a non-zero SPAdj.
Differential Revision: http://reviews.llvm.org/D6863
llvm-svn: 225437
Mohit K. Bhakkad [Thu, 8 Jan 2015 09:46:29 +0000 (09:46 +0000)]
[LLDB][MIPS] Adding SoftwareBreakpointTrapOpcode and RelocationJumpSlotType for MIPS
Patch by Bhushan Attarde
Reviewers: clayborg
Reviewed By: clayborg
Subscribers: petarj, dsanders, mohit.bhakkad, lldb-commits
Differential Revision: http://reviews.llvm.org/D6861
llvm-svn: 225436
Daniel Jasper [Thu, 8 Jan 2015 08:48:21 +0000 (08:48 +0000)]
clang-format: Improve template parameter detection.
Before:
struct A < std::enable_if<sizeof(T2) <sizeof(int32)>::type>;
After:
struct A<std::enable_if<sizeof(T2) < sizeof(int32)>::type>;
llvm-svn: 225435
Craig Topper [Thu, 8 Jan 2015 07:57:27 +0000 (07:57 +0000)]
Fix test case I missed in r225432.
llvm-svn: 225434
Andrew Wilkins [Thu, 8 Jan 2015 07:49:28 +0000 (07:49 +0000)]
[llgo] irgen: generate switch instructions
Summary:
With this patch, llgo uses ssautil.Switches
to reconstitute (and synthesise) switches,
which can then be lowered to lookup tables,
trees, etc.
We currently only handle integer const case
switches. We erase the comparison blocks (other
than the initial block), and generate a switch
instruction at the end of the block starting
the if-else-if chain. ssautil.Switches does
not remove duplicate const cases (e.g. same
operands for "||"), so we do this in llgo for
now.
Test Plan: lit test added
Reviewers: pcc
Reviewed By: pcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6831
llvm-svn: 225433
Craig Topper [Thu, 8 Jan 2015 07:41:30 +0000 (07:41 +0000)]
[X86] Don't print 'dword ptr' or 'qword ptr' on the operand to some of the LEA variants in Intel syntax. The memory operand is inherently unsized.
llvm-svn: 225432
Jason Molenda [Thu, 8 Jan 2015 06:41:12 +0000 (06:41 +0000)]
Have AssemblyParse_x86::get_non_call_site_unwind_plan track
which registers have been spilled (saved to the stack) - and
if we see that same register being saved to the stack again,
don't record that, it's something specific to this stack frame.
I found a code sequence for i386 where clang did a push %esi
and then later in the function it did movl %esi, -0x7c(%ebp)
and that second save of a scratch value overrode the original
push location.
<rdar://problem/
19171178>
llvm-svn: 225431
Marshall Clow [Thu, 8 Jan 2015 06:36:41 +0000 (06:36 +0000)]
In early C++11 standard drafts, std::function derived from std::unary_function or std::binary_function if there was only one (or two) parameters. Before C++11 shipped, this restiction was lifted, but libc++ still does this (which is fine). However, the tests still check for this outdated requiremnt. Change then to check for the nested typedefs instead (which are still required by the standard). No change to the library.
llvm-svn: 225430
Marshall Clow [Thu, 8 Jan 2015 06:18:59 +0000 (06:18 +0000)]
Add checks to make sure the hash functor has the right typedefs
llvm-svn: 225429
Saleem Abdulrasool [Thu, 8 Jan 2015 04:19:08 +0000 (04:19 +0000)]
PE/COFF: add support to import functions in ARM NT
This is necessary to support linking a basic program which references symbols
outside of the module itself. Add the import thunk for ARM NT style imports.
This allows us to create the reference. However, it is still insufficient to
generate executables that will run due to base relocations not being emitted for
the import.
llvm-svn: 225428
Jason Molenda [Thu, 8 Jan 2015 03:57:48 +0000 (03:57 +0000)]
Rearrange RegisterContextLLDB::SavedLocationForRegister a tiny bit
so that we will use the UnwindPlan's rule for providing the stack
pointer BEFORE we use the trick of using the callee's CFA address
as the stack pointer. When we're in a _sigtramp frame, the CFA of
the _sigtramp stack frame is not the same as the stack pointer value
when the async interrupt occurred -- we need to use the eh_frame
rules for retrieving the correct value.
<rdar://problem/
18913548>
llvm-svn: 225427
Richard Trieu [Thu, 8 Jan 2015 02:40:08 +0000 (02:40 +0000)]
Attempt to fix test from r225423 to get build bots green.
llvm-svn: 225426
Vince Harron [Thu, 8 Jan 2015 02:11:26 +0000 (02:11 +0000)]
Added documentation for test timeout
Differential Revision: http://reviews.llvm.org/D6669
Submitted for Chaoren Lin
llvm-svn: 225425
Adrian Prantl [Thu, 8 Jan 2015 02:02:00 +0000 (02:02 +0000)]
Revert "Reapply: Teach SROA how to update debug info for fragmented variables."
This reverts commit r225379 while investigating an assertion failure reported
by Alexey.
llvm-svn: 225424
Richard Trieu [Thu, 8 Jan 2015 01:27:03 +0000 (01:27 +0000)]
When the diagnostic text is simply "%0", sanitize the string for any
unprintable characters. Fixes PR22048.
llvm-svn: 225423
Quentin Colombet [Thu, 8 Jan 2015 01:16:39 +0000 (01:16 +0000)]
[RegAllocGreedy] Introduce a late pass to repair broken hints.
A broken hint is a copy where both ends are assigned different colors. When a
variable gets evicted in the neighborhood of such copies, it is likely we can
reconcile some of them.
** Context **
Copies are inserted during the register allocation via splitting. These split
points are required to relax the constraints on the allocation problem. When
such a point is inserted, both ends of the copy would not share the same color
with respect to the current allocation problem. When variables get evicted,
the allocation problem becomes different and some split point may not be
required anymore. However, the related variables may already have been colored.
This usually shows up in the assembly with pattern like this:
def A
...
save A to B
def A
use A
restore A from B
...
use B
Whereas we could simply have done:
def B
...
def A
use A
...
use B
** Proposed Solution **
A variable having a broken hint is marked for late recoloring if and only if
selecting a register for it evict another variable. Indeed, if no eviction
happens this is pointless to look for recoloring opportunities as it means the
situation was the same as the initial allocation problem where we had to break
the hint.
Finally, when everything has been allocated, we look for recoloring
opportunities for all the identified candidates.
The recoloring is performed very late to rely on accurate copy cost (all
involved variables are allocated).
The recoloring is simple unlike the last change recoloring. It propagates the
color of the broken hint to all its copy-related variables. If the color is
available for them, the recoloring uses it, otherwise it gives up on that hint
even if a more complex coloring would have worked.
The recoloring happens only if it is profitable. The profitability is evaluated
using the expected frequency of the copies of the currently recolored variable
with a) its current color and b) with the target color. If a) is greater or
equal than b), then it is profitable and the recoloring happen.
** Example **
Consider the following example:
BB1:
a =
b =
BB2:
...
= b
= a
Let us assume b gets split:
BB1:
a =
b =
BB2:
c = b
...
d = c
= d
= a
Because of how the allocation work, b, c, and d may be assigned different
colors. Now, if a gets evicted to make room for c, assuming b and d were
assigned to something different than a.
We end up with:
BB1:
a =
st a, SpillSlot
b =
BB2:
c = b
...
d = c
= d
e = ld SpillSlot
= e
This is likely that we can assign the same register for b, c, and d,
getting rid of 2 copies.
** Performances **
Both ARM64 and x86_64 show performance improvements of up to 3% for the
llvm-testsuite + externals with Os and O3. There are a few regressions too that
comes from the (in)accuracy of the block frequency estimate.
<rdar://problem/
18312047>
llvm-svn: 225422
Ahmed Bougacha [Thu, 8 Jan 2015 00:51:32 +0000 (00:51 +0000)]
[SelectionDAG] Allow targets to specify legality of extloads' result
type (in addition to the memory type).
The *LoadExt* legalization handling used to only have one type, the
memory type. This forced users to assume that as long as the extload
for the memory type was declared legal, and the result type was legal,
the whole extload was legal.
However, this isn't always the case. For instance, on X86, with AVX,
this is legal:
v4i32 load, zext from v4i8
but this isn't:
v4i64 load, zext from v4i8
Whereas v4i64 is (arguably) legal, even without AVX2.
Note that the same thing was done a while ago for truncstores (r46140),
but I assume no one needed it yet for extloads, so here we go.
Calls to getLoadExtAction were changed to add the value type, found
manually in the surrounding code.
Calls to setLoadExtAction were mechanically changed, by wrapping the
call in a loop, to match previous behavior. The loop iterates over
the MVT subrange corresponding to the memory type (FP vectors, etc...).
I also pulled neighboring setTruncStoreActions into some of the loops;
those shouldn't make a difference, as the additional types are illegal.
(e.g., i128->i1 truncstores on PPC.)
No functional change intended.
Differential Revision: http://reviews.llvm.org/D6532
llvm-svn: 225421
Nick Lewycky [Thu, 8 Jan 2015 00:47:03 +0000 (00:47 +0000)]
Remove empty statement. No functionality change.
llvm-svn: 225420
Matthias Braun [Thu, 8 Jan 2015 00:33:48 +0000 (00:33 +0000)]
X86: VZeroUpperInserter: shortcut should not trigger if we have any function live-ins.
llvm-svn: 225419
Enrico Granata [Thu, 8 Jan 2015 00:29:12 +0000 (00:29 +0000)]
Fix a problem where a ValueObject could fail to update itself, but since it was previously valid, we'd have an old checksum to compare aginst no new checksum (because failure to update), and assert() and die. Fix the problem by only caring about this assertion logic if updates succeed
llvm-svn: 225418
Kevin Enderby [Thu, 8 Jan 2015 00:25:24 +0000 (00:25 +0000)]
Run clang-format on tools/llvm-objdump/MachODump.cpp again as some of my
previous changes got in with incorrect formatting. No functional change.
llvm-svn: 225417
Matthias Braun [Thu, 8 Jan 2015 00:21:23 +0000 (00:21 +0000)]
RegisterCoalescer: Do not remove IMPLICIT_DEFS if they are required for subranges.
The register coalescer used to remove implicit_defs when they are
covered by the main range anyway. With subreg liveness tracking we can't
do that anymore in places where the IMPLICIT_DEF is required as begin of
a subregister liverange.
llvm-svn: 225416
Matthias Braun [Wed, 7 Jan 2015 23:58:38 +0000 (23:58 +0000)]
RegisterCoalescer: Fix valuesIdentical() in some subrange merge cases.
I got confused and assumed SrcIdx/DstIdx of the CoalescerPair is a
subregister index in SrcReg/DstReg, but they are actually subregister
indices of the coalesced register that get you back to SrcReg/DstReg
when applied.
Fixed the bug, improved comments and simplified code accordingly.
Testcase by Tom Stellard!
llvm-svn: 225415
Nico Weber [Wed, 7 Jan 2015 23:50:05 +0000 (23:50 +0000)]
Wrap to 80 columns. No behavior change.
llvm-svn: 225414
Matthias Braun [Wed, 7 Jan 2015 23:35:11 +0000 (23:35 +0000)]
LiveInterval: Implement feedback by Quentin Colombet.
llvm-svn: 225413
Philip Reames [Wed, 7 Jan 2015 22:48:01 +0000 (22:48 +0000)]
[GC] improve testing around gc.relocate and fix a test
Patch by: Ramkumar Ramachandra <artagnon@gmail.com>
"This patch started out as an exploration of gc.relocate, and an attempt
to write a simple test in call-lowering. I then noticed that the
arguments of gc.relocate were not checked fully, so I went in and fixed
a few things. Finally, the most important outcome of this patch is that
my new error handling code caught a bug in a callsite in
stackmap-format."
Differential Revision: http://reviews.llvm.org/D6824
llvm-svn: 225412
Ahmed Bougacha [Wed, 7 Jan 2015 22:47:46 +0000 (22:47 +0000)]
[CodeGen] Add MVT::isValid to replace manual validity checks. NFC.
Now that we have MVT::FIRST_VALUETYPE (r225362), we can provide a method
checking that the MVT is valid, that is, it's in
[FIRST_VALUETYPE, LAST_VALUETYPE[.
This commit also uses it in a few asserts, that would previously accept
invalid MVTs, such as the default constructed -1. In that case,
the code following those asserts would do an out-of-bounds array access.
Using MVT::isValid, those assertions fail as expected when passed
invalid MVTs.
It feels clunky to have such a validity checking function, but it's
at least better than the alternative of broken manual checks.
llvm-svn: 225411
Tom Stellard [Wed, 7 Jan 2015 22:44:19 +0000 (22:44 +0000)]
R600/SI: Commute instructions to enable more folding opportunities
llvm-svn: 225410
Nico Weber [Wed, 7 Jan 2015 22:40:55 +0000 (22:40 +0000)]
Add help text for mmacosx-version-min=, mios-version-min=.
I keep forgetting the exact spelling of -macosx-version-min=, and now I can
run `bin/clang --help | grep version -A 2` to remind myself. While here,
also document -mios-version-min=. Don't document -mios-simulator-version-min=
as it's just an alias for -mios-version-min= these days.
llvm-svn: 225409
Marshall Clow [Wed, 7 Jan 2015 22:26:48 +0000 (22:26 +0000)]
Missed a typename
llvm-svn: 225408
Greg Clayton [Wed, 7 Jan 2015 22:25:50 +0000 (22:25 +0000)]
Fix inlined test cases so they print out the correct command to run when they fail instead of printing out incorrect information.
To fix this I added a new method to TestBase:
def getRerunArgs(self):
return " -f %s.%s" % (self.__class__.__name__, self._testMethodName)
The InlineTest which inherits from TestBase then overrides this function with a custom version which does the right thing.
llvm-svn: 225407
Duncan P. N. Exon Smith [Wed, 7 Jan 2015 22:24:46 +0000 (22:24 +0000)]
IR: Add MDNode::getDistinct()
Allow distinct `MDNode`s to be explicitly created. There's no way (yet)
of representing their distinctness in assembly/bitcode, however, so this
still isn't first-class.
Part of PR22111.
llvm-svn: 225406
Tom Stellard [Wed, 7 Jan 2015 22:18:27 +0000 (22:18 +0000)]
R600/SI: Only fold immediates that have one use
Folding the same immediate into multiple instruction will increase
program size, which can hurt performance.
llvm-svn: 225405
Sean Silva [Wed, 7 Jan 2015 22:07:33 +0000 (22:07 +0000)]
Test commit.
Hopefully this one won't kill the git mirror...
llvm-svn: 225404
Marshall Clow [Wed, 7 Jan 2015 21:53:23 +0000 (21:53 +0000)]
libc++ implements its' hash objects as deriving from std::unary_function, and the tests test for that. STL @ MS pointed out that the standard doesn't requie these objects to derive from unary_function, and so the tests should not require that either. Change the tests to check for the embedded typedefs - which ARE required. No change to the library.
llvm-svn: 225403
Marshall Clow [Wed, 7 Jan 2015 21:51:30 +0000 (21:51 +0000)]
In C++03, a bunch of the arithmetic/logical/comparison functors (such as negate/bit_not.pass/logical_not) were defined as deriving from unary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
llvm-svn: 225402
Duncan P. N. Exon Smith [Wed, 7 Jan 2015 21:35:38 +0000 (21:35 +0000)]
IR: Add MDNode::isDistinct()
Add API to indicate whether an `MDNode` is distinct. A distinct node is
not stored in the MDNode uniquing tables, and will never be returned by
`MDNode::get()`.
Although distinct nodes are only currently created by uniquing
collisions (when operands change), PR22111 will allow these nodes to be
explicitly created.
llvm-svn: 225401
Sean Silva [Wed, 7 Jan 2015 21:35:14 +0000 (21:35 +0000)]
[LangRef] PR22118: Hyphen is allowed in IR identifiers.
E.g. %-foo and %fo-o.
Thanks to eagle-eyed reporter Tomas Brukner.
llvm-svn: 225400
Adrian Prantl [Wed, 7 Jan 2015 21:35:13 +0000 (21:35 +0000)]
Update a comment.
llvm-svn: 225399
Vince Harron [Wed, 7 Jan 2015 21:35:07 +0000 (21:35 +0000)]
lldb-platform - static link all llvm dependencies
Differential Revision: http://reviews.llvm.org/D6797
lldb-gdbserver statically links all llvm dependencies. This allows
dead stripping code and reduces total binary size.
This change modifies lldb-plaform to static link llvm dependencies
like lldb-gdbserver.
llvm-svn: 225398
Duncan P. N. Exon Smith [Wed, 7 Jan 2015 21:32:27 +0000 (21:32 +0000)]
Linker: Don't use MDNode::replaceOperandWith()
`MDNode::replaceOperandWith()` changes all instances of metadata. Stop
using it when linking module flags, since (due to uniquing) the flag
values could be used by other metadata.
Instead, use new API `NamedMDNode::setOperand()` to update the reference
directly.
llvm-svn: 225397
Tobias Grosser [Wed, 7 Jan 2015 21:28:44 +0000 (21:28 +0000)]
todo: Remove some redundant topics
llvm-svn: 225395
Chandler Carruth [Wed, 7 Jan 2015 21:28:10 +0000 (21:28 +0000)]
Test commit to check the new git mirror.
llvm-svn: 225394
Alexey Samsonov [Wed, 7 Jan 2015 21:27:26 +0000 (21:27 +0000)]
XFAIL several MCJIT EH tests under ASan and MSan bootstrap.
llvm-svn: 225393
Ahmed Bougacha [Wed, 7 Jan 2015 21:27:10 +0000 (21:27 +0000)]
[CodeGen] Use MVT iterator_ranges in legality loops. NFC intended.
A few loops do trickier things than just iterating on an MVT subset,
so I'll leave them be for now.
Follow-up of r225387.
llvm-svn: 225392
Tobias Grosser [Wed, 7 Jan 2015 21:21:55 +0000 (21:21 +0000)]
www: Make sure the main content pane does not overlap with the menu
llvm-svn: 225391
Tobias Grosser [Wed, 7 Jan 2015 21:18:35 +0000 (21:18 +0000)]
todo: Adding native OpenSCoP support to Polly does not seem desirable
This would add another library dependency to Polly. In many cases the
JSCoP interface we have should be enough and an external JSCoP <> OpenSCoP
converter could be written. We can reconsider this if new use cases show up.
llvm-svn: 225390
Kaelyn Takata [Wed, 7 Jan 2015 21:16:39 +0000 (21:16 +0000)]
Handle OpaqueValueExprs more intelligently in the TransformTypos tree
transform.
Also diagnose typos in the initializer of an invalid C++ declaration.
Both issues were hit using the same line of test code, depending on
whether the code was treated as C or C++.
Fixes PR22092.
llvm-svn: 225389
Tobias Grosser [Wed, 7 Jan 2015 21:16:33 +0000 (21:16 +0000)]
Add updated TODO list
llvm-svn: 225388
Ahmed Bougacha [Wed, 7 Jan 2015 21:15:38 +0000 (21:15 +0000)]
[CodeGen] Add iterator_range for the MVT::SimpleValueType enum.
This commit adds a simple iterator over that enum, and a few
functions to create iterator ranges over the most common types.
Differential Revision: http://reviews.llvm.org/D6537
llvm-svn: 225387
Alexey Samsonov [Wed, 7 Jan 2015 21:13:30 +0000 (21:13 +0000)]
Fix uninitialized memory read in llvm-dsymutil for the second time.
This was already fixed by r224481, but apparently was accidentally
reverted in r225207.
llvm-svn: 225386
Rafael Espindola [Wed, 7 Jan 2015 21:10:25 +0000 (21:10 +0000)]
Add a test that would have found the issue in r224935.
llvm-svn: 225385
Chandler Carruth [Wed, 7 Jan 2015 21:08:54 +0000 (21:08 +0000)]
[git] Mark the llgo directory in the LLVM gitignore.
llvm-svn: 225384
Kevin Enderby [Wed, 7 Jan 2015 21:02:18 +0000 (21:02 +0000)]
Slightly refactor things for llvm-objdump and the -macho option so it can be used with
options other than just -disassemble so that universal files can be used with other
options combined with -arch options.
No functional change to existing options and use. One test case added for the
additional functionality with a universal file an a -arch option.
llvm-svn: 225383
Tom Stellard [Wed, 7 Jan 2015 20:59:25 +0000 (20:59 +0000)]
R600/SI: Remove VReg_32 register class
Use VGPR_32 register class instead. These two register classes were
identical and having separate classes was causing
SIInstrInfo::isLegalOperands() to be overly conservative in some cases.
This change is necessary to prevent future paches from missing a folding
opportunity in fneg-fabs.ll.
llvm-svn: 225382
Marshall Clow [Wed, 7 Jan 2015 20:54:51 +0000 (20:54 +0000)]
Add tests to check the typedefs from the result of std::owner_less
llvm-svn: 225381
Olivier Sallenave [Wed, 7 Jan 2015 20:54:17 +0000 (20:54 +0000)]
More FMA folding opportunities.
llvm-svn: 225380
Adrian Prantl [Wed, 7 Jan 2015 20:52:22 +0000 (20:52 +0000)]
Reapply: Teach SROA how to update debug info for fragmented variables.
The two buildbot failures were addressed in LLVM r225378 and CFE r225359.
This rapplies commit 225272 without modifications.
llvm-svn: 225379
Adrian Prantl [Wed, 7 Jan 2015 20:48:58 +0000 (20:48 +0000)]
Debug info: Allow aggregate types to be described by constants.
llvm-svn: 225378
Colin LeMahieu [Wed, 7 Jan 2015 20:43:38 +0000 (20:43 +0000)]
[Hexagon] Fix 225372 USR register is not fully complete. Removing Uses = [USR] maintains existing functionality to old instructions without encodings.
llvm-svn: 225377
Marshall Clow [Wed, 7 Jan 2015 20:40:28 +0000 (20:40 +0000)]
Missed one comparison test in r225375
llvm-svn: 225376
Marshall Clow [Wed, 7 Jan 2015 20:31:06 +0000 (20:31 +0000)]
In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion.
llvm-svn: 225375
Colin LeMahieu [Wed, 7 Jan 2015 20:28:57 +0000 (20:28 +0000)]
[Hexagon] Adding floating point classification and creation.
llvm-svn: 225374
Tom Stellard [Wed, 7 Jan 2015 20:27:25 +0000 (20:27 +0000)]
R600/SI: Add a V_MOV_B64 pseudo instruction
This is used to simplify the SIFoldOperands pass and make it easier to
fold immediates.
llvm-svn: 225373
Colin LeMahieu [Wed, 7 Jan 2015 20:24:09 +0000 (20:24 +0000)]
[Hexagon] Adding encodings for v5 floating point instructions.
llvm-svn: 225372
Colin LeMahieu [Wed, 7 Jan 2015 20:07:28 +0000 (20:07 +0000)]
[Hexagon] Adding encoding for popcount, fastcorner, dword asr with rounding.
llvm-svn: 225371
Renato Golin [Wed, 7 Jan 2015 20:03:47 +0000 (20:03 +0000)]
XFAIL AArch64 UBsan test, just like ARM
llvm-svn: 225370
Tom Stellard [Wed, 7 Jan 2015 19:56:17 +0000 (19:56 +0000)]
R600/SI: Teach SIFoldOperands to split 64-bit constants when folding
This allows folding of sequences like:
s[0:1] = s_mov_b64 4
v_add_i32 v0, s0, v0
v_addc_u32 v1, s1, v1
into
v_add_i32 v0, 4, v0
v_add_i32 v1, 0, v1
llvm-svn: 225369
Olivier Sallenave [Wed, 7 Jan 2015 19:45:17 +0000 (19:45 +0000)]
Test commit
llvm-svn: 225368
Ahmed Bougacha [Wed, 7 Jan 2015 19:38:50 +0000 (19:38 +0000)]
[X86] Fix 512->256 typo in comments. NFC.
llvm-svn: 225367
Philip Reames [Wed, 7 Jan 2015 19:13:28 +0000 (19:13 +0000)]
Add a missing file from 225365
llvm-svn: 225366
Philip Reames [Wed, 7 Jan 2015 19:07:50 +0000 (19:07 +0000)]
Introduce an example statepoint GC strategy
This change includes the most basic possible GCStrategy for a GC which is using the statepoint lowering code. At the moment, this GCStrategy doesn't really do much - aside from actually generate correct stackmaps that is - but I went ahead and added a few extra correctness checks as proof of concept. It's mostly here to provide documentation on how to do one, and to provide a point for various optimization legality hooks I'd like to add going forward. (For context, see the TODOs in InstCombine around gc.relocate.)
Most of the validation logic added here as proof of concept will soon move in to the Verifier. That move is dependent on http://reviews.llvm.org/D6811
There was discussion in the review thread about addrspace(1) being reserved for something. I'm going to follow up on a seperate llvmdev thread. If needed, I'll update all the code at once.
Note that I am deliberately not making a GCStrategy required to use gc.statepoints with this change. I want to give folks out of tree - including myself - a chance to migrate. In a week or two, I'll make having a GCStrategy be required for gc.statepoints. To this end, I added the gc tag to one of the test cases but not others.
Differential Revision: http://reviews.llvm.org/D6808
llvm-svn: 225365
Nico Weber [Wed, 7 Jan 2015 18:47:51 +0000 (18:47 +0000)]
Slightly simplify the test from r225361.
Shorter and doesn't need -O2 -- but still suboptimal as it's still doing
-emit-obj. dblaikie says he'll improve this when he'll reland his change
with a fix.
llvm-svn: 225364
Nico Weber [Wed, 7 Jan 2015 18:41:10 +0000 (18:41 +0000)]
clang-format: Let Chromium use the Google default for AlignTrailingComments.
r225141 changed the defaults of AllowShortIfStatementsOnASingleLine and
AlignTrailingComments for Google style and added explicit overrides for
Chromium style to undo these changes. For AllowShortIfStatementsOnASingleLine
that's good as the Android style guide (which Chromium uses for Java) explicitly
permits single-line ifs. But it's silent on trailing comments, to it makes
sense for Chromium style to just follow Google style.
llvm-svn: 225363
Ahmed Bougacha [Wed, 7 Jan 2015 18:39:00 +0000 (18:39 +0000)]
[CodeGen] Add MVT::FIRST_VALUETYPE to avoid explicit 0. NFC.
Many places reference MVT::LAST_VALUETYPE when iterating over all
valid MVTs, but they usually start with 0.
With FIRST_VALUETYPE, we can avoid explicit constants when we really
should be using MVT::SimpleValueType.
llvm-svn: 225362
Nico Weber [Wed, 7 Jan 2015 18:23:08 +0000 (18:23 +0000)]
Revert r225085, it caused PR22096.
PR22096 has several test cases that assert that look fairly different. I'm
adding one of those as an automated test, but when relanding the other cases
should probably be checked as well.
llvm-svn: 225361
David Majnemer [Wed, 7 Jan 2015 18:14:07 +0000 (18:14 +0000)]
X86: Allow the stack probe size to be configurable per function
LLVM emits stack probes on Windows targets to ensure that the stack is
correctly accessed. However, the amount of stack allocated before
emitting such a probe is hardcoded to 4096.
It is desirable to have this be configurable so that a function might
opt-out of stack probes. Our level of granularity is at the function
level instead of, say, the module level to permit proper generation of
code after LTO.
Patch by Andrew H!
N.B. The inliner needs to be updated to properly consider what happens
after inlining a function with a specific stack-probe-size into another
function with a different stack-probe-size.
llvm-svn: 225360
Adrian Prantl [Wed, 7 Jan 2015 17:49:30 +0000 (17:49 +0000)]
Debug info: pass in the correct size for a pointer to a member function.
This corrects a bug I introduced in r224781.
llvm-svn: 225359
Tom Stellard [Wed, 7 Jan 2015 17:42:16 +0000 (17:42 +0000)]
R600/SI: Refactor SIFoldOperands to simplify immediate folding
This will make a future patch much less intrusive.
llvm-svn: 225358
Ahmed Bougacha [Wed, 7 Jan 2015 17:33:03 +0000 (17:33 +0000)]
[X86] Teach FCOPYSIGN lowering to recognize constant magnitudes.
For code like:
float foo(float x) { return copysign(1.0, x); }
We used to generate:
andps <-0.000000e+00,0,0,0>, %xmm0
movss <1.000000e+00>, %xmm1
andps <nan>, %xmm1
orps %xmm0, %xmm1
Basically doing an abs(1.0f) in the two middle instructions.
We now generate:
andps <-0.000000e+00,0,0,0>, %xmm0
orps <1.000000e+00,0,0,0>, %xmm0
Builds on cleanups r223415, r223542.
rdar://
19049548
Differential Revision: http://reviews.llvm.org/D6555
llvm-svn: 225357
Rafael Espindola [Wed, 7 Jan 2015 15:52:51 +0000 (15:52 +0000)]
Improvements to emacs packages for llvm and tablegen mode.
* Both files have valid package headers and footers (you can verify
with M-x checkdoc).
* Fixed style warnings generated by checkdoc.
* Fixed a byte-compiler warning in llvm-mode.el.
* Ensure that the modes are autoloaded, so users do not need to
(require 'llvm-mode) to use them.
Patch by Wilfred Hughes.
llvm-svn: 225356
Aaron Ballman [Wed, 7 Jan 2015 14:47:12 +0000 (14:47 +0000)]
Reverting r225319; since there is a folder named Examples, attempting to add a target of the same name causes problems for IDEs like Visual Studio.
llvm-svn: 225355
Aaron Ballman [Wed, 7 Jan 2015 14:26:07 +0000 (14:26 +0000)]
Manually specify the folder that Kaleidescope should reside in for CMake-produced solutions that care about such things (like MSVC). This takes the Kaleidescope target out of the root solution folder and places it into the Examples folder where it belongs.
llvm-svn: 225354
Aaron Ballman [Wed, 7 Jan 2015 14:19:15 +0000 (14:19 +0000)]
Manually specify the folder that llvm-ranlib should reside in for CMake-produced solutions that care about such things (like MSVC). This takes llvm-ranlib out of the root solution folder and places it into the Tools folder where it belongs.
llvm-svn: 225353
Daniel Jasper [Wed, 7 Jan 2015 14:00:11 +0000 (14:00 +0000)]
clang-format: Understand single-line comments at the end of blocks.
This prevents clang-format from moving/aligning the comment in the
snippet:
void f() {
int i; // some comment
// some unrelated comment
}
llvm-svn: 225352
Jonas Paulsson [Wed, 7 Jan 2015 13:38:29 +0000 (13:38 +0000)]
New method SDep::isNormalMemoryOrBarrier() in ScheduleDAGInstrs.cpp.
Used to iterate over previously added memory dependencies in
adjustChainDeps() and iterateChainSucc().
SDep::isCtrl() was previously used in these places, that also gave
anti and output edges. The code may be worse if these are followed,
because MisNeedChainEdge() will conservatively return true since a
non-memory instruction has no memory operands, and a false chain dep
will be added. It is also unnecessary since all memory accesses of
interest will be reached by memory dependencies, and there is a budget
limit for the number of edges traversed.
This problem was found on an out-of-tree target with enabled alias
analysis. No test case for an in-tree target has been found.
Reviewed by Hal Finkel.
llvm-svn: 225351
Jonas Paulsson [Wed, 7 Jan 2015 13:20:57 +0000 (13:20 +0000)]
Fix typos in comment and option help texts.
For -enable-aa-sched-mi and -use-tbaa-in-sched-mi.
llvm-svn: 225350
Daniel Jasper [Wed, 7 Jan 2015 12:19:53 +0000 (12:19 +0000)]
clang-format: Fix unary operator detection.
Before:
** outparam = 1;
After:
**outparam = 1;
llvm-svn: 225349
Charlie Turner [Wed, 7 Jan 2015 11:37:40 +0000 (11:37 +0000)]
[ARM] Add missing Tag_DIV_use tests.
llvm-svn: 225348
Asiri Rathnayake [Wed, 7 Jan 2015 11:22:58 +0000 (11:22 +0000)]
Fix regression in r225266.
The change in r225266 was reviewed under D6722. But the commit r225266 has a
typo, causing some MCHammer failures. This patch fixes it.
Change-Id: I573efcff25003af7478ac02548ebbe929fc7f5fd
llvm-svn: 225347
Chandler Carruth [Wed, 7 Jan 2015 11:14:51 +0000 (11:14 +0000)]
[PM] Give slightly less horrible names to the utility pass templates for
requiring and invalidating specific analyses. Also make their printed
names match their class names. Writing these out as prose really doesn't
make sense to me any more.
llvm-svn: 225346
Craig Topper [Wed, 7 Jan 2015 08:10:38 +0000 (08:10 +0000)]
[X86] Merge a switch statement inside a default case of another switch statement on the same variable. There was no additional code in the default so this should be no functional change.
llvm-svn: 225345
Craig Topper [Wed, 7 Jan 2015 08:10:36 +0000 (08:10 +0000)]
[X86] Don't mark the shift by 1 instructions as isConvertibleToThreeAddress. There is no handling for them.
llvm-svn: 225344
Craig Topper [Wed, 7 Jan 2015 07:47:52 +0000 (07:47 +0000)]
[X86] Remove some unused TYPE enums from the disassembler.
llvm-svn: 225343
Tobias Grosser [Wed, 7 Jan 2015 07:43:34 +0000 (07:43 +0000)]
Use explicit StringRef Type
We previously used a Twine here, but as pointed out by David Blaikie
and Mehdi Amini storing a temporary StringRef in a Twine is not a good
idea, as the StringRef will be freed before the Twine is used leaving
a Twine that points to uninitialized memory. We now make it explicit that
we use a StringRef here.
llvm-svn: 225342