David Majnemer [Fri, 9 Jan 2015 10:33:23 +0000 (10:33 +0000)]
Sema: Don't crash when variable is redefined as a constexpr function
We have a diagnostic describing that constexpr changed in C++14 when
compiling in C++11 mode. While doing this, it examines the previous
declaration and assumes that it is a function. However it is possible,
in the context of error recovery, for this to not be the case.
llvm-svn: 225518
Suyog Sarda [Fri, 9 Jan 2015 10:23:48 +0000 (10:23 +0000)]
Assumption that "VectorizedValue" will always be an Instruction is not correct.
It can be a constant or a vector argument.
ex :
define i32 @hadd(<4 x i32> %a) #0 {
entry:
%vecext = extractelement <4 x i32> %a, i32 0
%vecext1 = extractelement <4 x i32> %a, i32 1
%add = add i32 %vecext, %vecext1
%vecext2 = extractelement <4 x i32> %a, i32 2
%add3 = add i32 %add, %vecext2
%vecext4 = extractelement <4 x i32> %a, i32 3
%add5 = add i32 %add3, %vecext4
ret i32 %add5
}
llvm-svn: 225517
Manuel Klimek [Fri, 9 Jan 2015 10:03:47 +0000 (10:03 +0000)]
Add the shifted cursor position to XML output, so it can be used by editor integrations.
llvm-svn: 225516
Olivier Goffart [Fri, 9 Jan 2015 09:42:32 +0000 (09:42 +0000)]
Fix test from my previous commit
(I should have re-run the test after running clang-format)
llvm-svn: 225515
David Majnemer [Fri, 9 Jan 2015 09:38:14 +0000 (09:38 +0000)]
Parse: Don't crash when namespace is in GNU statement expr
Parser::ParseNamespace can get a little confused when it found itself
inside a compound statement inside of a non-static data member
initializer.
Try to determine that the statement expression's scope makes sense
before trying to parse it's contents.
llvm-svn: 225514
Olivier Goffart [Fri, 9 Jan 2015 09:37:26 +0000 (09:37 +0000)]
Fix crash in typo correction while correcting enum within a struct in C
llvm-svn: 225513
Tobias Grosser [Fri, 9 Jan 2015 08:10:36 +0000 (08:10 +0000)]
Adjust test for the new 'distinct' metadata nodes
'distinct' was introduced in 225474. We now adjust the test cases
to match for the additional 'distinct' marker.
llvm-svn: 225512
David Majnemer [Fri, 9 Jan 2015 07:36:13 +0000 (07:36 +0000)]
Sema: RecordDecl shouldn't have a FunctionDecl as a Decl
RecordDecls should have things like CXXMethodDecls or FriendDecls as a
decl but not things like FunctionDecls.
llvm-svn: 225511
Saleem Abdulrasool [Fri, 9 Jan 2015 06:57:24 +0000 (06:57 +0000)]
ARM: add support for R_ARM_ABS16
Add support for R_ARM_ABS16 relocation mapping. Addresses PR22156.
llvm-svn: 225510
Saleem Abdulrasool [Fri, 9 Jan 2015 06:57:18 +0000 (06:57 +0000)]
test: add additional test for SVN r225507
Add an additional test case to ensure that we generate the relocation even if
the thumb target is used.
llvm-svn: 225509
David Majnemer [Fri, 9 Jan 2015 06:10:21 +0000 (06:10 +0000)]
Sema: Don't crash when specializing a global scope function in a class
We assumed that class-scope specializations would result in a
CXXMethodDecl for that class. However, globally qualified functions
will result in normal FunctionDecls.
llvm-svn: 225508
Saleem Abdulrasool [Fri, 9 Jan 2015 05:59:12 +0000 (05:59 +0000)]
ARM: add support for R_ARM_ABS8 relocations
Add support for R_ARM_ABS8 relocation. Addresses PR22126.
llvm-svn: 225507
David Majnemer [Fri, 9 Jan 2015 05:56:10 +0000 (05:56 +0000)]
Sema: Remove some dead code from CreateNewFunctionDecl
The same code is already in Sema::ActOnFunctionDeclarator, the only
caller of CreateNewFunctionDecl.
llvm-svn: 225506
David Majnemer [Fri, 9 Jan 2015 05:10:55 +0000 (05:10 +0000)]
Parse: Don't crash when trailing return type is missing
Sema::CheckParmsForFunctionDef can't cope with a null TypeSourceInfo.
Don't let the AST contain the malformed lambda.
This fixes PR22122.
llvm-svn: 225505
Saleem Abdulrasool [Fri, 9 Jan 2015 05:10:20 +0000 (05:10 +0000)]
Driver: begin threading frontend support for SymbolRewriter
Allow blessed access to the symbol rewriter from the driver. Although the
symbol rewriter could be invoked through tools like opt and llc, it would not
accessible from the frontend. This allows us to read the rewrite map files in
the frontend rather than the backend and enable symbol rewriting for actually
performing the symbol interpositioning.
llvm-svn: 225504
Matthias Braun [Fri, 9 Jan 2015 03:01:31 +0000 (03:01 +0000)]
RegisterCoalescer: Fix removeCopyByCommutingDef with subreg liveness
The code that eliminated additional coalescable copies in
removeCopyByCommutingDef() used MergeValueNumberInto() which internally
may merge A into B or B into A. In this case A and B had different Def
points, so we have to reset ValNo.Def to the intended one after merging.
llvm-svn: 225503
Matthias Braun [Fri, 9 Jan 2015 03:01:28 +0000 (03:01 +0000)]
RegisterCoalescer: Some cleanup in removeCopyByCommutingDef(), NFC
llvm-svn: 225502
Matthias Braun [Fri, 9 Jan 2015 03:01:26 +0000 (03:01 +0000)]
RegisterCoalescer: No need to set kill flags, they are recompute later anyway
llvm-svn: 225501
Matthias Braun [Fri, 9 Jan 2015 03:01:23 +0000 (03:01 +0000)]
RegisterCoalescer: Turn some impossible conditions into asserts
llvm-svn: 225500
Duncan P. N. Exon Smith [Fri, 9 Jan 2015 02:51:45 +0000 (02:51 +0000)]
Bitcode: Share logic for last instruction, NFC
Share logic for getting the last instruction emitted.
llvm-svn: 225499
Duncan P. N. Exon Smith [Fri, 9 Jan 2015 02:48:48 +0000 (02:48 +0000)]
Bitcode: Move the DEBUG_LOC record to DEBUG_LOC_OLD
Prepare to simplify the `DebugLoc` record.
llvm-svn: 225498
Hal Finkel [Fri, 9 Jan 2015 02:03:11 +0000 (02:03 +0000)]
[PowerPC] Add a flag for experimenting with subreg liveness tracking
This cannot yet be enabled by default, it causes ~50 miscompiles in the test
suite.
llvm-svn: 225497
Siva Chandra [Fri, 9 Jan 2015 01:54:44 +0000 (01:54 +0000)]
[InlineTest] getRerunArgs returns an empty string if the test was skipped.
Summary:
The main issue that this patch is trying to address is that the current
implementation of getRerunArgs of InlineTest relies on the attribute
'using_dsym' which could be absent if the test was skipped altogether.
[That is, if both dsym and dwarf tests were skipped.]
While at it, the use of deprecated Python module 'new' is eliminated.
Test Plan: [Linux] dotest.py -p TestExprPathSynthetic
Reviewers: vharron, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D6888
llvm-svn: 225496
Justin Bogner [Fri, 9 Jan 2015 01:46:40 +0000 (01:46 +0000)]
InstrProf: Don't emit counter increments in dead code
We were previously emitting counter increments even if we didn't have
an insertion point, which would result in a CallInst with no
parent. This leads to a crash, as in pr22166, if we try to do
GlobalDCE.
llvm-svn: 225495
David Majnemer [Fri, 9 Jan 2015 01:39:09 +0000 (01:39 +0000)]
Sema: Dependent array designators cannot be checked
We forgot to mark designated initializer expression that contain type
dependent array designators as type dependent. This would lead to
crashes when we try to determine which array element we were trying to
initialize.
This fixes PR22056.
llvm-svn: 225494
Hal Finkel [Fri, 9 Jan 2015 01:34:30 +0000 (01:34 +0000)]
[PowerPC] Fold [sz]ext with fp_to_int lowering where possible
On modern cores with lfiw[az]x, we can fold a sign or zero extension from i32
to i64 into the load necessary for an i64 -> fp conversion.
llvm-svn: 225493
Hal Finkel [Fri, 9 Jan 2015 01:29:29 +0000 (01:29 +0000)]
[DAGCombine] Remainder of fix to r225380 (More FMA folding opportunities)
As pointed out by Aditya (and Owen), when we elide an FP extend to form an FMA,
we need to extend the incoming operands so that the resulting node will really
be legal. This is currently enabled only for PowerPC, and it happens to work
there regardless, but this should fix the functionality for everyone else
should anyone else wish to use it.
llvm-svn: 225492
Chandler Carruth [Fri, 9 Jan 2015 01:24:36 +0000 (01:24 +0000)]
[x86] Add a flag to control the vector shuffle legality predicates that
complements the new vector shuffle lowering code path. This flag,
naturally, is *off* because we've not tested or evaluated the results of
this at all. However, the flag will make it much easier to evaluate
whether we can be this aggressive and whether there are missing vector
shuffle lowering optimizations.
llvm-svn: 225491
Richard Smith [Fri, 9 Jan 2015 01:19:56 +0000 (01:19 +0000)]
PR22117: Fix a case where we would get confused about which function parameter
we're instantiating, if there's a ParmVarDecl within a FunctionDecl context
that is not a parameter of that function. Add some asserts to catch this kind
of issue more generally, and fix another bug exposed by those asserts where we
were missing a local instantiation scope around substitution of
explicitly-specified template arguments.
llvm-svn: 225490
Richard Smith [Fri, 9 Jan 2015 00:59:40 +0000 (00:59 +0000)]
Don't invent a '$auto-x-y' name for auto types in generic lambdas. This is no
better than the 'template-parameter-x-y' name that we'd get in AST printing,
and is worse in several ways (it's harder to distinguish it from a
user-supplied name, it's wrong after substituting some number of outer
levels, it wastes time and space constructing an IdentifierInfo, ...).
llvm-svn: 225489
Richard Trieu [Fri, 9 Jan 2015 00:58:16 +0000 (00:58 +0000)]
Use APSInt::isSameValue instead of operator== in a place where two APSInt's
may have different sizes. Fixes PR22017
llvm-svn: 225488
Chandler Carruth [Fri, 9 Jan 2015 00:48:47 +0000 (00:48 +0000)]
Cleaup ValueHandle to no longer keep a PointerIntPair for the Value*.
This was used previously for metadata but is no longer needed there. Not
doing this simplifies ValueHandle and will make it easier to fix things
like AssertingVH's DenseMapInfo.
llvm-svn: 225487
Enrico Granata [Fri, 9 Jan 2015 00:47:24 +0000 (00:47 +0000)]
Dynamic values have been around (and stable and reliable) for long enough that we can turn them on by default
Change the default of prefer-dynamic-value to eDynamicDontRunTarget (i.e. enable dynamic values, but do not run code to do so)
Of course, disable this for the test suite, since testing no-dynamic-values is actually valuable
Fixes rdar://
17363061
llvm-svn: 225486
Hal Finkel [Fri, 9 Jan 2015 00:45:54 +0000 (00:45 +0000)]
Partial fix to r225380 (More FMA folding opportunities)
As pointed out by Aditya (and Owen), there are two things wrong with this code.
First, it adds patterns which elide FP extends when forming FMAs, and that might
not be profitable on all targets (it belongs behind the pre-existing
aggressive-FMA-formation flag). This is fixed by this change.
Second, the resulting nodes might have operands of different types (the
extensions need to be re-added). That will be fixed in the follow-up commit.
llvm-svn: 225485
Kuba Brecka [Fri, 9 Jan 2015 00:26:45 +0000 (00:26 +0000)]
[asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=368
llvm-svn: 225484
Philip Reames [Fri, 9 Jan 2015 00:26:45 +0000 (00:26 +0000)]
[REFACTOR] Push logic from MemDepPrinter into getNonLocalPointerDependency
Previously, MemDepPrinter handled volatile and unordered accesses without involving MemoryDependencyAnalysis. By making a slight tweak to the documented interface - which is respected by both callers - we can move this responsibility to MDA for the benefit of any future callers. This is basically just cleanup.
In the future, we may decide to extend MDA's non local dependency analysis to return useful results for ordered or volatile loads. I believe (but have not really checked in detail) that local dependency analyis does get useful results for ordered, but not volatile, loads.
llvm-svn: 225483
Hans Wennborg [Fri, 9 Jan 2015 00:21:26 +0000 (00:21 +0000)]
ReleaseNotes.rst: these are for 3.6
llvm-svn: 225482
Philip Reames [Fri, 9 Jan 2015 00:04:22 +0000 (00:04 +0000)]
[Refactor] Have getNonLocalPointerDependency take the query instruction
Previously, MemoryDependenceAnalysis::getNonLocalPointerDependency was taking a list of properties about the instruction being queried. Since I'm about to need one more property to be passed down through the infrastructure - I need to know a query instruction is non-volatile in an inner helper - fix the interface once and for all.
I also added some assertions and behaviour clarifications around volatile and ordered field accesses. At the moment, this is mostly to document expected behaviour. The only non-standard instructions which can currently reach this are atomic, but unordered, loads and stores. Neither ordered or volatile accesses can reach here.
The call in GVN is protected by an isSimple check when it first considers the load. The calls in MemDepPrinter are protected by isUnordered checks. Both utilities also check isVolatile for loads and stores.
llvm-svn: 225481
Tobias Grosser [Fri, 9 Jan 2015 00:01:33 +0000 (00:01 +0000)]
Add experimental support for unsigned expressions
This support is still incomplete and consequently hidden behind a switch that
needs to be enabled. One problem is ATM that we incorrectly interpret very large
unsigned values as negative values even if used in an unsigned comparision.
llvm-svn: 225480
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 23:50:26 +0000 (23:50 +0000)]
LangRef: Add usage points for distinct MDNodes
Omission pointed out by Sean Silva!
llvm-svn: 225479
Kostya Serebryany [Thu, 8 Jan 2015 23:37:09 +0000 (23:37 +0000)]
[asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
llvm-svn: 225478
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:43:19 +0000 (22:43 +0000)]
IR: Drop TODO now that PR22111 is finished
llvm-svn: 225477
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:42:30 +0000 (22:42 +0000)]
Utils: Keep distinct MDNodes distinct in MapMetadata()
Create new copies of distinct `MDNode`s instead of following the
uniquing `MDNode` logic.
Just like self-references (or other cycles), `MapMetadata()` creates a
new node. In practice most calls use `RF_NoModuleLevelChanges`, in
which case nothing is duplicated anyway.
Part of PR22111.
llvm-svn: 225476
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:39:28 +0000 (22:39 +0000)]
IR: Add 'distinct' MDNodes to bitcode and assembly (clang)
Update testcases for LLVM change in r225474 to make `MDNode`s explicitly
distinct (when they aren't uniqued).
Part of PR22111.
llvm-svn: 225475
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 22:38:29 +0000 (22:38 +0000)]
IR: Add 'distinct' MDNodes to bitcode and assembly
Propagate whether `MDNode`s are 'distinct' through the other types of IR
(assembly and bitcode). This adds the `distinct` keyword to assembly.
Currently, no one actually calls `MDNode::getDistinct()`, so these nodes
only get created for:
- self-references, which are never uniqued, and
- nodes whose operands are replaced that hit a uniquing collision.
The concept of distinct nodes is still not quite first-class, since
distinct-ness doesn't yet survive across `MapMetadata()`.
Part of PR22111.
llvm-svn: 225474
Sanjay Patel [Thu, 8 Jan 2015 22:36:56 +0000 (22:36 +0000)]
remove function names from comments; NFC
llvm-svn: 225473
Alexey Samsonov [Thu, 8 Jan 2015 22:31:14 +0000 (22:31 +0000)]
Fix memory leaks in GetListOfModules() users.
llvm-svn: 225472
Hal Finkel [Thu, 8 Jan 2015 22:11:49 +0000 (22:11 +0000)]
[PowerPC] Mark all instructions as non-cheap for MachineLICM
MachineLICM uses a callback named hasLowDefLatency to determine if an
instruction def operand has a 'low' latency. If all relevant operands have a
'low' latency, the instruction is considered too cheap to hoist out of loops
even in low-register-pressure situations. On PowerPC cores, both the embedded
cores and the others, there is no reason to believe that this is a good choice:
all instructions have a cost inside a loop, and hoisting them when not limited
by register pressure is a reasonable default.
llvm-svn: 225471
Hal Finkel [Thu, 8 Jan 2015 22:10:48 +0000 (22:10 +0000)]
[MachineLICM] A command-line option to hoist even cheap instructions
Add a command-line option to enable hoisting even cheap instructions (in
low-register-pressure situations). This is turned off by default, but has
proved useful for testing purposes.
llvm-svn: 225470
Alexey Samsonov [Thu, 8 Jan 2015 22:03:05 +0000 (22:03 +0000)]
[Sanitizer] Remove the hardcoded limit of address ranges in LoadedModule.
This should fix https://code.google.com/p/address-sanitizer/issues/detail?id=368.
llvm-svn: 225469
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 21:07:55 +0000 (21:07 +0000)]
CodeGen: Use handy new-fangled post-increment, NFC
Drive-by cleanup; I noticed this when reviewing the patch that became
r225466.
llvm-svn: 225468
Akira Hatanaka [Thu, 8 Jan 2015 20:44:50 +0000 (20:44 +0000)]
[ARM] Fix a bug in constant island pass that was triggering an assertion.
The assert was being triggered when the distance between a constant pool entry
and its user exceeded the maximally allowed distance after thumb2 branch
shortening. A padding was inserted after a thumb2 branch instruction was shrunk,
which caused the user to be out of range. This is wrong as the padding should
have been inserted by the layout algorithm so that the distance between two
instructions doesn't grow later during thumb2 instruction optimization.
This commit fixes the code in ARMConstantIslands::createNewWater to call
computeBlockSize and set BasicBlock::Unalign when a branch instruction is
inserted to create new water after a basic block. A non-zero Unalign causes
the worst-case padding to be inserted when adjustBBOffsetsAfter is called to
recompute the basic block offsets.
rdar://problem/
19130476
llvm-svn: 225467
Duncan P. N. Exon Smith [Thu, 8 Jan 2015 20:44:33 +0000 (20:44 +0000)]
CodeGen: Use range-based for loops, NFC
Patch by Ramkumar Ramachandra!
llvm-svn: 225466
Matt Arsenault [Thu, 8 Jan 2015 20:09:34 +0000 (20:09 +0000)]
Fix fcmp + fabs instcombines when using the intrinsic
This was only handling the libcall. This is another example
of why only the intrinsic should ever be used when it exists.
llvm-svn: 225465
Tobias Grosser [Thu, 8 Jan 2015 19:26:53 +0000 (19:26 +0000)]
Add support for pointer types in expressions
llvm-svn: 225464
Enrico Granata [Thu, 8 Jan 2015 19:11:43 +0000 (19:11 +0000)]
This patch fixes my think-o in ValueObject::UpdateValueIfNeeded() about the right thing to assert()
It also comes with a (rudimentary) test case that gets itself in a failed update scenario, and checks that we don't crash
This is the easiest case I could think of that forces the failed update case Zachary was seeing
llvm-svn: 225463
Eric Christopher [Thu, 8 Jan 2015 19:07:01 +0000 (19:07 +0000)]
The Kaleidoscope tutorial should be using "mcjit" for the library,
"jit" doesn't exist anymore.
llvm-svn: 225462
Tobias Grosser [Thu, 8 Jan 2015 19:03:10 +0000 (19:03 +0000)]
Fix a crash in our error reporting
AF = dyn_cast<SCEVAddRecExpr>(Pair.second) may be NULL for some SCEVs that we do
not support. When reporting the error we still want to pass a pointer that is
known to always be non-NULL.
I do not yet have a test case for this, unfortunately.
llvm-svn: 225461
Lang Hames [Thu, 8 Jan 2015 18:52:15 +0000 (18:52 +0000)]
[MCJIT] Remove a few redundant MCJIT tests, and drop the extraneous datalayout
strings from the copies that remain.
llvm-svn: 225460
Eric Christopher [Thu, 8 Jan 2015 18:18:57 +0000 (18:18 +0000)]
Make the TargetMachine in MipsSubtarget a reference rather
than a pointer to make unifying code a bit easier.
llvm-svn: 225459
Eric Christopher [Thu, 8 Jan 2015 18:18:54 +0000 (18:18 +0000)]
Update include - this class doesn't use the target machine, but
only the subtarget.
llvm-svn: 225458
Eric Christopher [Thu, 8 Jan 2015 18:18:53 +0000 (18:18 +0000)]
Fix a couple of odd formatting issues.
llvm-svn: 225457
Eric Christopher [Thu, 8 Jan 2015 18:18:50 +0000 (18:18 +0000)]
This routine is in InstrInfo, there's no need to access it again.
llvm-svn: 225456
Ahmed Bougacha [Thu, 8 Jan 2015 17:49:48 +0000 (17:49 +0000)]
[X86] Reflow comment. NFC.
llvm-svn: 225455
Rafael Espindola [Thu, 8 Jan 2015 16:25:01 +0000 (16:25 +0000)]
clang-format. NFC.
llvm-svn: 225454
Rafael Espindola [Thu, 8 Jan 2015 16:11:18 +0000 (16:11 +0000)]
Make this test a bit stricter.
It now checks for the end of the line or the opening '{'.
While at it, remove empty comments.
llvm-svn: 225451
Justin Hibbits [Thu, 8 Jan 2015 15:47:19 +0000 (15:47 +0000)]
Add saving and restoring of r30 to the prologue and epilogue, respectively
Summary: The PIC additions didn't update the prologue and epilogue code to save and restore r30 (PIC base register). This does that.
Test Plan: Tests updated.
Reviewers: hfinkel
Reviewed By: hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6876
llvm-svn: 225450
Rafael Espindola [Thu, 8 Jan 2015 15:39:50 +0000 (15:39 +0000)]
Explicitly handle LinkOnceODRAutoHideLinkage. NFC. We already have a test.
llvm-svn: 225449
Rafael Espindola [Thu, 8 Jan 2015 15:36:32 +0000 (15:36 +0000)]
Update naming style and clang-format. NFC.
llvm-svn: 225448
Manuel Klimek [Thu, 8 Jan 2015 15:29:03 +0000 (15:29 +0000)]
Improve clang-format.el.
- includes header/footer as required by MELPA
- correctly handles buffers that are not associated with a file
- displays stderr and exit code of clang-format process
- customizable via the emacs customization interface and file-/directory-
local variables
Patch by Johann Klähn.
llvm-svn: 225447
Kristof Beyls [Thu, 8 Jan 2015 15:09:14 +0000 (15:09 +0000)]
Fix large stack alignment codegen for ARM and Thumb2 targets
This partially fixes PR13007 (ARM CodeGen fails with large stack
alignment): for ARM and Thumb2 targets, but not for Thumb1, as it
seems stack alignment for Thumb1 targets hasn't been supported at
all.
Producing an aligned stack pointer is done by zero-ing out the lower
bits of the stack pointer. The BIC instruction was used for this.
However, the immediate field of the BIC instruction only allows to
encode an immediate that can zero out up to a maximum of the 8 lower
bits. When a larger alignment is requested, a BIC instruction cannot
be used; llvm was silently producing incorrect code in this case.
This commit fixes code generation for large stack aligments by
using the BFC instruction instead, when the BFC instruction is
available. When not, it uses 2 instructions: a right shift,
followed by a left shift to zero out the lower bits.
The lowering of ARM::Int_eh_sjlj_dispatchsetup still has code
that unconditionally uses BIC to realign the stack pointer, so it
very likely has the same problem. However, I wasn't able to
produce a test case for that. This commit adds an assert so that
the compiler will fail the assert instead of silently generating
wrong code if this is ever reached.
llvm-svn: 225446
Tom Stellard [Thu, 8 Jan 2015 15:08:17 +0000 (15:08 +0000)]
R600/SI: Remove SIISelLowering::legalizeOperands()
Its functionality has been replaced by calling
SIInstrInfo::legalizeOperands() from
SIISelLowering::AdjstInstrPostInstrSelection() and running the
SIFoldOperands and SIShrinkInstructions passes.
llvm-svn: 225445
Daniel Jasper [Thu, 8 Jan 2015 13:56:57 +0000 (13:56 +0000)]
clang-format: Force line break between "endl" and "<<".
This makes piped output easier to read in many instances.
Before:
llvm::errs() << aaaa << std::endl << bbbb << std::endl;
After:
llvm::errs() << aaaa << std::endl
<< bbbb << std::endl;
Also fix a few instance of "don't use else after return" as per the
coding standards.
llvm-svn: 225444
Viktor Kutuzov [Thu, 8 Jan 2015 13:28:22 +0000 (13:28 +0000)]
[Sanitizers] Fix internal_lseek() to work on FreeBSD
Differential Revision: http://reviews.llvm.org/D6825
llvm-svn: 225443
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