Commit Graph

117362 Commits

Author SHA1 Message Date
Yaron Keren
a44933e6d0 Fix Visual C++ errors C2784, C2780, C2782 after r237678.
It does not like std::min(unsigned, uint32_t).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 11:18:10 +00:00
Michael Kuperstein
5440f2198d [X86] ABI change for x86-32: pass 3 vector arguments in-register instead of 4, except on Darwin.
This changes the ABI used on 32-bit x86 for passing vector arguments. 
Historically, clang passes the first 4 vector arguments in-register, and additional vector arguments on the stack, regardless of platform. That is different from the behavior of gcc, icc, and msvc, all of which pass only the first 3 arguments in-register.
The 3-register convention is documented, unofficially, in Agner's calling convention guide, and, officially, in the recently released version 1.0 of the i386 psABI.

Darwin is kept as is because the OS X ABI Function Call Guide explicitly documents the current (4-register) behavior.

This fixes PR21510

Differential revision: http://reviews.llvm.org/D9644

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 11:06:56 +00:00
Pawel Bylica
ef3ec7c783 Revert "Avoid size_t -> unsigned conversion in MathExtras.h header. NFC".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237680 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 10:51:24 +00:00
Pawel Bylica
8fae893373 Avoid size_t -> unsigned conversion in MathExtras.h header. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237678 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 10:35:32 +00:00
Artyom Skrobov
6aed5afbbb Fix documentation for Set-Like Containers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237677 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 10:21:12 +00:00
Pawel Bylica
4a9771567e Fix getSwappedBytes for double.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237673 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 08:44:15 +00:00
NAKAMURA Takumi
df11b54057 BrainF.cpp: Update CreateCall() according to r237624.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 06:50:19 +00:00
Tobias Grosser
d70b3aca8e Drop unnecessary ';' after namespace
The ';' was introduced in 237642. With it in place, we get a large number of
warnings in -pedantic mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237667 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 06:25:19 +00:00
Matthias Braun
42cff157db SelectionDAG: Cleanup and simplify FoldConstantArithmetic
This cleans up the FoldConstantArithmetic code by factoring out the case
of two ConstantSDNodes into an own function. This avoids unnecessary
complexity for many callers who already have ConstantSDNode arguments.

This also avoids an intermeidate SmallVector datastructure and a loop
over that datastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237651 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 01:40:21 +00:00
Filipe Cabecinhas
bf27e11e02 [BitcodeReader] Error out if we read an invalid function argument type
Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237650 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 01:21:06 +00:00
Kostya Serebryany
3b3cbed1b0 [lib/Fuzzer] more efficient reload logic; also don't spam git too much
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 01:06:07 +00:00
Filipe Cabecinhas
c3ccd67d72 [BitcodeReader] It's a malformed block if CodeLenWidth is too big
Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237646 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 00:34:17 +00:00
Matthias Braun
09f87b4a7b DAGCombiner: Factor common pattern into isOneConstant() function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 00:25:21 +00:00
Matthias Braun
91088c696d DAGCombiner: Factor common pattern into isAllOnesConstant() function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 00:25:20 +00:00
Matthias Braun
a6698bb5d4 DAGCombiner: Use isNullConstant() where possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 00:25:17 +00:00
Pete Cooper
a641a4a89e Store intrinsic ID by value in Function instead of a string lookup. NFC.
On 64-bit targets, Function has 4-bytes of padding in its struct layout.

This uses the space for the intrinsic ID. It is set and recalculated whenever the function name is set.  This is similar to the current behavior which clears the function from the intrinsic ID cache when its renamed.

The intrinsic cache itself is removed as the only purpose was to speedup calls to getIntrinsicID() which now just reading the new field in the struct.

Reviewed by Duncan.  http://reviews.llvm.org/D9836

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 00:24:26 +00:00
Pete Cooper
d42228154f Move Function::lookupIntrinsicID to a static method. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-19 00:02:25 +00:00
Reid Kleckner
37f1bba13a Re-land r237175: [X86] Always return the sret parameter in eax/rax ...
This reverts commit r237210.

Also fix X86/complex-fca.ll to match the code that we used to generate
on win32 and now generate everwhere to conform to SysV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 23:35:09 +00:00
Matthias Braun
42d8237570 Revert accidental change in r237633
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237635 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 23:18:13 +00:00
Jozef Kolek
1193b61df0 [mips][microMIPSr6] Implement LSA instruction
This patch implements LSA instruction using mapping.

Differential Revision: http://reviews.llvm.org/D8919


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 23:12:10 +00:00
Matthias Braun
4f5829ac4d DAGCombiner: Factor common pattern into isNullConstant() function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 23:07:27 +00:00
David Blaikie
ff4ab44626 Revert "[opaque pointer type] Provide a convenience for IRBuilder::CreateCall that accepts a Function without needing to take an explicit callee Type"
Creates ambiguity in Clang callers. Reverting while I figure it out.

This reverts commit r237627.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:40:13 +00:00
Filipe Cabecinhas
b2bf278152 [BitcodeReader] Make sure the type of the inserted value matches the type of the aggregate at those indices
Bug found with AFL-fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237628 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:27:11 +00:00
David Blaikie
4d632b44e2 [opaque pointer type] Provide a convenience for IRBuilder::CreateCall that accepts a Function without needing to take an explicit callee Type
The common case is a direct call, so don't make all those users have to
explicitly pass the result of llvm::Function::getFunctionType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:25:14 +00:00
David Blaikie
042dd34f9c Simplify IRBuilder::CreateCall* by using ArrayRef+initializer_list/braced init only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:13:54 +00:00
Eric Christopher
300c594636 80-col fixup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237623 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:12:43 +00:00
Eric Christopher
847a488261 Fix grammar in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237622 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:12:41 +00:00
Tim Northover
6b57892624 AArch64: work around ld64 bug more aggressively.
ld64 currently mishandles internal pointer relocations (i.e.
ARM64_RELOC_UNSIGNED referred to by section & offset rather than symbol). The
existing __cfstring clause was an early discovery and workaround for this, but
the problem is wider and we should avoid such relocations wherever possible for
now.

This code should be reverted to allowing internal relocations as soon as
possible.

PR23437.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237621 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 22:07:20 +00:00
Eric Christopher
8b6f5f0909 Fix some odd whitespace and formatting errors while making
changes in ConstantsContext.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237620 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 21:49:02 +00:00
Filipe Cabecinhas
70a2c7260a Extract the load/store type verification to a separate function.
Summary:
Added isLoadableOrStorableType to PointerType.

We were doing some checks in some places, occasionally assert()ing instead
of telling the caller. With this patch, I'm putting all type checking in
the same place for load/store type instructions, and verifying the same
thing every time.

I also added a check for load/store of a function type.

Applied extracted check to Load, Store, and Cmpxcg.

I don't have exhaustive tests for all of these, but all Error() calls in
TypeCheckLoadStoreInst are being tested (in invalid.test).

Reviewers: dblaikie, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9785

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237619 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 21:48:55 +00:00
Kostya Serebryany
05ef67b6b9 [lib/Fuzzer] when -sync_command=<CMD> is given, periodically execute 'CMD CORPUS' to synchronize with other processes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 21:34:20 +00:00
Benjamin Kramer
825a528bbe [YAML] Plug a memory leak
The destructor of BlockScalarNode is never called. Store the contained
string in BumpPtrAllocated memory instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237614 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 21:11:27 +00:00
Matthias Braun
e4603f0daf MachineInstr: Change return value of getOpcode() to unsigned.
This was previously returning int. However there are no negative opcode
numbers and more importantly this was needlessly different from
MCInstrDesc::getOpcode() (which even is the value returned here) and
SDValue::getOpcode()/SDNode::getOpcode().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 20:27:55 +00:00
Chen Li
881547e01b [Verifier] Assert gc_relocate always return a pointer type
Summary: Add an assertion in verifier.cpp to make sure gc_relocate relocate a gc pointer, and its return type has the same address space with the relocated pointer.

Reviewers: reames, AndyAyers, sanjoy, pgavlin

Reviewed By: pgavlin

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237605 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 19:50:14 +00:00
Chen Li
2306579644 [PlaceSafepoints] Assertion on that gc_result can not have preceding phis should only apply to invoke statepoint
Summary: When PlaceSafepoints pass replaces old return result with gc_result from statepoint, it asserts that gc_result can not have preceding phis in its parent block. This is only true on invoke statepoint, which terminates the block and puts its result at the beginning of the normal successor block. Call statepoint does not terminate the block and thus its result is in the same block with it. There should be no restriction on whether there are phis or not.

Reviewers: reames, igor-laevsky

Reviewed By: igor-laevsky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9803

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237597 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 19:02:25 +00:00
Jim Grosbach
7b81f734ee MC: clang-format MCContext. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237595 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 18:43:23 +00:00
Jim Grosbach
19696daa21 MC: Clean up method names in MCContext.
The naming was a mish-mash of old and new style. Update to be consistent
with the new. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237594 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 18:43:14 +00:00
Sanjoy Das
0799eb1140 Exploit dereferenceable_or_null attribute in LICM pass
Summary:
Allow hoisting of loads from values marked with dereferenceable_or_null
attribute. For values marked with the attribute perform
context-sensitive analysis to determine whether it's known-non-null or
not.

Patch by Artur Pilipenko!

Reviewers: hfinkel, sanjoy, reames

Reviewed By: reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9253

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237593 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 18:07:00 +00:00
Tim Northover
9962fd0e2e ARM: allow jump tables to be placed as constant islands.
Previously, they were forced to immediately follow the actual branch
instruction. This was usually OK (the LEAs actually accessing them got emitted
nearby, and weren't usually separated much afterwards). Unfortunately, a
sufficiently nasty phi elimination dumps many instructions right before the
basic block terminator, and this can increase the range too much.

This patch frees them up to be placed as usual by the constant islands pass,
and consequently has to slightly modify the form of TBB/TBH tables to refer to
a PC-relative label at the final jump. The other jump table formats were
already position-independent.

rdar://20813304

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237590 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 17:10:40 +00:00
Jingyue Wu
2703007b7b [ScalarEvolution] refactor: extract interface getGEPExpr
Summary:
This allows other passes (such as SLSR) to compute the SCEV expression for an
imaginary GEP.

Test Plan: no regression

Reviewers: atrick, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D9786

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237589 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 17:03:25 +00:00
Hans Wennborg
febe7813c8 Fix llvm::BumpPtrAllocatorImpl::Reset()
BumpPtrAllocator's Reset wouldn't clear CustomSizedSlabs if Slabs.size() == 0.

Patch by Kal <b17c0de@gmail.com>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237588 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:54:17 +00:00
Andrew Trick
0b9ee775f5 indvars cruft: don't replace phi nodes for no reason.
Don't replace a phi with an identical phi. This was done long ago to
"preserve" IVUsers analysis. The code has already called
SE->forgetValue(PN) so I see no purpose in creating a new value for
the phi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237587 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:49:34 +00:00
Andrew Trick
688ae334a3 SimplifyIV comments and dead argument cleanup.
Remove crufty comments. IVUsers hasn't been used here for a long time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:49:31 +00:00
James Y Knight
ccafe05df1 Sparc: support the "set" synthetic instruction.
This pseudo-instruction expands into 'sethi' and 'or' instructions,
or, just one of them, if the other isn't necessary for a given value.

Differential Revision: http://reviews.llvm.org/D9089

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237585 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:43:33 +00:00
Hal Finkel
292c78ba68 Preserve the order of READ_REGISTER and WRITE_REGISTER
At the present time, we don't have a way to represent general dependency
relationships, so everything is represented using memory dependency. In order
to preserve the data dependency of a READ_REGISTER on WRITE_REGISTER, we need
to model WRITE_REGISTER as writing (which we had been doing) and model
READ_REGISTER as reading (which we had not been doing). Fix this, and also the
way that the chain operands were generated at the SDAG level.

Patch by Nicholas Paul Johnson, thanks! Test case by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237584 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:42:10 +00:00
Oliver Stannard
0139af335f Revert r237579, as it broke windows buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237583 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:39:16 +00:00
James Y Knight
1467a41471 Sparc: Support PSR, TBR, WIM read/write instructions.
Differential Revision: http://reviews.llvm.org/D8971

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237582 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:38:47 +00:00
James Y Knight
ee058202fa Sparc: Add the "alternate address space" load/store instructions.
- Adds support for the asm syntax, which has an immediate integer
  "ASI" (address space identifier) appearing after an address, before
  a comma.

- Adds the various-width load, store, and swap in alternate address
  space instructions. (ldsba, ldsha, lduba, lduha, lda, stba, stha,
  sta, swapa)

This does not attempt to hook these instructions up to pointer address
spaces in LLVM, although that would probably be a reasonable thing to
do in the future.

Differential Revision: http://reviews.llvm.org/D8904

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:35:04 +00:00
James Y Knight
f272788a95 Add support for the Sparc implementation-defined "ASR" registers.
(Note that register "Y" is essentially just ASR0).

Also added some test cases for divide and multiply, which had none before.

Differential Revision: http://reviews.llvm.org/D8670

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237580 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:29:48 +00:00
Oliver Stannard
d811b4bacb [LLVM - ARM/AArch64] Add ACLE special register intrinsics
This patch implements LLVM support for the ACLE special register intrinsics in
section 10.1, __arm_{w,r}sr{,p,64}.

This patch is intended to lower the read/write_register instrinsics, used to
implement the special register intrinsics in the clang patch for special
register intrinsics (see http://reviews.llvm.org/D9697), to ARM specific
instructions MRC,MCR,MSR etc. to allow reading an writing of coprocessor
registers in AArch32 and AArch64. This is done by inspecting the register
string passed to the intrinsic and then lowering to the appropriate
instruction.

Patch by Luke Cheeseman.

Differential Revision: http://reviews.llvm.org/D9699



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237579 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-18 16:23:33 +00:00