Commit Graph

122060 Commits

Author SHA1 Message Date
Igor Laevsky
ebe9301ae1 [DeadStoreElimination] Remove dead zero store to calloc initialized memory
This change allows dead store elimination to remove zero and null stores into memory freshly allocated with calloc-like function.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248374 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 11:38:44 +00:00
Benjamin Kramer
39a9cdb8b7 [dsymutil] Plug a memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248372 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 10:38:59 +00:00
Oliver Stannard
425f047fd1 [ARM] Add option to force fast-isel
The ARM backend has some logic that only allows the fast-isel to be enabled for
subtargets where it is known to be stable. This adds a backend option to
override this and force the fast-isel to be used for any target, to allow it to
be tested.

This is an ARM-specific option, because no other backend disables the fast-isel
on a per-subtarget basis.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 09:19:54 +00:00
Simon Pilgrim
e0a23dddf0 [X86][SSE] Replace 128-bit SSE41 PMOVSX intrinsics with native IR
This patches removes the x86.sse41.pmovsx* intrinsics, provides a suitable upgrade path and updates relevant tests to sign extend a subvector instead.

LLVM counterpart to D12835

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248368 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 08:48:33 +00:00
Sanjoy Das
6d6e2b5a35 [SCEV] Introduce ScalarEvolution::getOne and getZero.
Summary:
It is fairly common to call SE->getConstant(Ty, 0) or
SE->getConstant(Ty, 1); this change makes such uses a little bit
briefer.

I've refactored the call sites I could find easily to use getZero /
getOne.

Reviewers: hfinkel, majnemer, reames

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248362 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 01:59:04 +00:00
Evgeniy Stepanov
1be7ea773a Revert "Android support for SafeStack."
test/Transforms/SafeStack/abi.ll breaks when target is not supported;
needs refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248358 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 01:23:22 +00:00
Evgeniy Stepanov
c7b6dc0535 Android support for SafeStack.
Add two new ways of accessing the unsafe stack pointer:

* At a fixed offset from the thread TLS base. This is very similar to
  StackProtector cookies, but we plan to extend it to other backends
  (ARM in particular) soon. Bionic-side implementation here:
  https://android-review.googlesource.com/170988.
* Via a function call, as a fallback for platforms that provide
  neither a fixed TLS slot, nor a reasonable TLS implementation (i.e.
  not emutls).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248357 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 01:03:51 +00:00
Cong Hou
8641a304d1 Add a test case for the fix of profile update issue when lowering switch statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248356 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 00:34:56 +00:00
Cong Hou
20afacc059 Fixed an issue on updating profile data when lowering switch statement.
Fixed the issue that when there is an edge from the jump table to the default statement, we should check it directly instead of checking if the sibling of the jump table header is a successor of the jump table header, which may not be the default statment but a successor of it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 00:20:27 +00:00
NAKAMURA Takumi
826813ee9f dsymutil: Fix a comment. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-23 00:19:20 +00:00
Adrian Prantl
5df8499ae5 Add a unit test for r248341.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248348 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 23:42:47 +00:00
Adrian Prantl
02aa134d92 IR: Add a setDWOId() method to DICompileUnit.
Tested via clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 23:21:06 +00:00
Adrian Prantl
c3ff2abcb0 IR: Fix the return value of DICompileUnit::getDWOId.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 23:21:03 +00:00
Adrian Prantl
0800f64c6b Debug Info: Emit the dwo_name only in skeleton CUs, not in DWOs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 23:21:00 +00:00
Matthias Braun
6404850444 LiveIntervalAnalysis: Avoid multiple connected liveness components
We may have subregister defs which are unused but not discovered and
cleaned up prior to liveness analysis. This creates multiple connected
components in the resulting live range which are forbidden in the
MachineVerifier because they would unnecesarily constrain the register
allocator. Rewrite those dead definitions to define a newly created
virtual register.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 22:37:44 +00:00
Matthias Braun
c047a22017 LiveInterval: Distribute subregister liveranges to new intervals in ConnectedVNInfoEqClasses::Distribute()
This improves ConnectedVNInfoEqClasses::Distribute() to distribute the
segments and value numbers in the subranges instead of conservatively
clearing all subregister info.

No separate test here, just clearing the subrange instead of properly
distributing them would however break my upcoming fix regarding dead super
register definitions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 22:37:42 +00:00
Michael Zolotukhin
3286c1f693 [Unroll] Do not crash trying to propagate a value to vector load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 22:27:12 +00:00
Adrian Prantl
d2136b34aa dsymutil: Follow references to clang modules and recursively clone the
debug info.

This does not yet resolve external type references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 22:20:50 +00:00
Michael Zolotukhin
831687d157 [Unroll] Follow-up for r247769: fix a bug in UnrolledInstAnalyzer::visitLoad.
Apart from checking that GlobalVariable is a constant, we should check
that it's not a weak constant, in which case we can't propagate its
value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 21:41:29 +00:00
Aaron Ballman
9800f4ca6e Instead of defining the operator delete() function, it is better to delete the function so that any uses (even from within Node or its subclasses) do not accidentally call it. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 21:00:35 +00:00
Adrian Prantl
45b0eeb56d dsymutil: Make -oso-prepend-path available to DwarfLinker.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248312 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 18:51:01 +00:00
Adrian Prantl
d6d5ed0ca8 dsymutil: Make resolveDIEReference and getUnitForOffset static functions.
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 18:50:58 +00:00
Adrian Prantl
6db2b2be10 dsymutil: Make DwarfLinker::reportWarning() public. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248310 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 18:50:51 +00:00
Davide Italiano
36caf0659f Remove macho-dump. Its functionality is now covered by llvm-readobj.
Approved by: Rafael Espindola, Eric Christopher, Jim Grosbach, 
             Alex Rosenberg


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 17:46:10 +00:00
Ahmed Bougacha
16a661561f [ARM] Emit clrex in the expanded cmpxchg fail block.
ARM counterpart to r248291:

In the comparison failure block of a cmpxchg expansion, the initial
ldrex/ldxr will not be followed by a matching strex/stxr.
On ARM/AArch64, this unnecessarily ties up the execution monitor,
which might have a negative performance impact on some uarchs.

Instead, release the monitor in the failure block.
The clrex instruction was designed for this: use it.

Also see ARMARM v8-A B2.10.2:
"Exclusive access instructions and Shareable memory locations".

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248294 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 17:22:58 +00:00
Ahmed Bougacha
ee629d8395 [AArch64] Emit clrex in the expanded cmpxchg fail block.
In the comparison failure block of a cmpxchg expansion, the initial
ldrex/ldxr will not be followed by a matching strex/stxr.
On ARM/AArch64, this unnecessarily ties up the execution monitor,
which might have a negative performance impact on some uarchs.

Instead, release the monitor in the failure block.
The clrex instruction was designed for this: use it.

Also see ARMARM v8-A B2.10.2:
"Exclusive access instructions and Shareable memory locations".

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 17:21:44 +00:00
Adrian Prantl
c8a4540af1 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 15:31:14 +00:00
Benjamin Kramer
a234052d29 Make helper function static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 14:34:57 +00:00
Daniel Sanders
3c6d533372 [mips][sched] Split IIBranch into specific instruction classes.
Summary:
Almost no functional change since the InstrItinData's have been duplicated.
The one functional change is to remove IIBranch from the MSA branches. The
classes will be assigned to the MSA instructions as part of implementing
the P5600 scheduler.

II_IndirectBranchPseudo and II_ReturnPseudo can probably be removed. I've
preserved the itinerary information for the corresponding pseudo
instructions to avoid making a functional change to these pseudos in
this patch.

Reviewers: vkalintiris

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 13:36:28 +00:00
Daniel Sanders
7d3c92c49d [mips][sched] Temporarily rename IIAlu to IIM16Alu. NFC.
Summary:
The only instructions left in IIAlu are MIPS16 specific. We're not
implementing a MIPS16 scheduler at this time so rename the class to make it
obvious that they are MIPS16 instructions.

Reviewers: vkalintiris

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 12:36:28 +00:00
Stephen Canon
eb1a6c5669 Don't raise inexact when lowering ceil, floor, round, trunc.
The C standard has historically not specified whether or not these functions should raise the inexact flag. Traditionally on Darwin, these functions *did* raise inexact, and the llvm lowerings followed that conventions. n1778 (C bindings for IEEE-754 (2008)) clarifies that these functions should not set inexact. This patch brings the lowerings for arm64 and x86 in line with the newly specified behavior.  This also lets us fold some logic into TD patterns, which is nice.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248266 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:43:17 +00:00
NAKAMURA Takumi
ccf2ea372c Prune trailing whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:19:03 +00:00
NAKAMURA Takumi
09c0ea51ca Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:15:07 +00:00
NAKAMURA Takumi
c36e746e98 Reformat blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248263 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:14:39 +00:00
NAKAMURA Takumi
6902c8db26 Reformat comment lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248262 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:14:12 +00:00
NAKAMURA Takumi
d4cdf1962b Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:13:55 +00:00
NAKAMURA Takumi
6fba3b9b12 ARMInstrInfo.cpp: Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248260 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:10:17 +00:00
NAKAMURA Takumi
d0b74314ef Fix utf8 chars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248259 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 11:10:08 +00:00
Daniel Sanders
28042167f5 [mips][ias] Implement .cpreturn directive.
Summary:
Based on a patch by David Chisnall. I've modified the original patch as follows:
* Moved the expansion to the TargetStreamers so that the directive isn't
  expanded when emitting assembly.
* Fixed an operand order bug.
* Changed the move instructions from DADDu to OR to match recent changes to GAS.

Reviewers: vkalintiris

Subscribers: llvm-commits, emaste, seanbruno, theraven

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248258 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 10:50:09 +00:00
Daniel Sanders
e3cdd3f338 [mips][sched] Added class for WSBH
Summary:
No functional change since no InstrItinData is provided.

Reviewers: vkalintiris

Subscribers: llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 10:01:13 +00:00
Daniel Sanders
e59aef6de7 [llvm-mc-fuzzer] Support untested instruction discovery for variable length instruction sets like microMIPS.
Summary:
For fixed length instructions, we can use -max_len to limit the fuzzer to a
single instruction. This doesn't work for variable length instruction sets
since a 4-byte input could consist of one 4-byte instruction or two 2-byte
instructions.

This patch adds a --insn-limit to llvm-mc-fuzzer to limit the input in
terms of instructions processed.

Reviewers: kcc

Subscribers: kcc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 09:22:53 +00:00
Simon Pilgrim
de8d7c41ca [X86][SSE] Match zero/any extension shuffles that don't start from the first element
This patch generalizes the lowering of shuffles as zero extensions to allow extensions that don't start from the first element. It now recognises extensions starting anywhere in the lower 128-bits or at the start of any higher 128-bit lane.

The motivation was to reduce the number of high cost pshufb calls, but it also improves the SSE2 case as well.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 08:16:08 +00:00
Craig Topper
6522ad6909 Remove extra 'nullptr' entry from an array in tablegen register info file. It should never have been accessed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248246 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 05:37:16 +00:00
Craig Topper
156aeff2f7 Fix formatting of a tablegen register info file by putting a line break in a better place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 05:37:14 +00:00
Craig Topper
e32e1f4c62 Use makeArrayRef and None to simplify some code in a tablegen register info file. Additionally const correct a couple static array.
Previously the code added an extra nullptr entry to a static array and then created an ArrayRef with a size one less than the static array. If there were no other entries the array would just contain the nullptr and the ArrayRef would be crated with size 0.

Instead, put the right number of entries in the array and explicitly emit 'None' if the size would be 0. This allows the static array constructor of makeArrayRef to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 05:37:12 +00:00
Matt Arsenault
d89d4bccff AMDGPU: Remove unnecessary check
If the instruction doesn't have enough operands, it
either shouldn't be marked as isCommutable or is malformed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 04:17:45 +00:00
Matthias Braun
95e05ddf74 LiveIntervalAnalysis: Factor common code into splitSeparateComponents; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 03:44:41 +00:00
Davide Italiano
5646beae51 [llvm-readobj/MachO] Ensure we always have valid CmdName/SegmentName.
Otherwise we might end up printing garbage while dumping.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248239 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 02:14:43 +00:00
Matthias Braun
66c643ef82 Remove declarations for methods that do not exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 01:52:44 +00:00
NAKAMURA Takumi
00a0a4bbad Fix r248164. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248237 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-22 01:44:21 +00:00