Commit Graph

127766 Commits

Author SHA1 Message Date
Colin LeMahieu
e7bc8f5cad [Hexagon] Adding relocation for code size, cold path optimization allowing a 23-bit 4-byte aligned relocation to be a valid instruction encoding.
The usual way to get a 32-bit relocation is to use a constant extender which doubles the size of the instruction, 4 bytes to 8 bytes.

Another way is to put a .word32 and mix code and data within a function.  The disadvantage is it's not a valid instruction encoding and jumping over it causes prefetch stalls inside the hardware.

This relocation packs a 23-bit value in to an "r0 = add(rX, #a)" instruction by overwriting the source register bits.  Since r0 is the return value register, if this instruction is placed after a function call which return void, r0 will be filled with an undefined value, the prefetch won't be confused, and the callee can access the constant value by way of the link register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 20:38:17 +00:00
Jun Bum Lim
092f8a3228 [AArch64] Add pass to remove redundant copy after RA
Summary:
This change will add a pass to remove unnecessary zero copies in target blocks
of cbz/cbnz instructions. E.g., the copy instruction in the code below can be
removed because the cbz jumps to BB1 when x0 is zero :
  BB0:
    cbz x0, .BB1
  BB1:
    mov x0, xzr

Jun

Reviewers: gberry, jmolloy, HaoLiu, MatzeB, mcrosier

Subscribers: mcrosier, mssimpso, haicheng, bmakam, llvm-commits, aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 20:02:39 +00:00
Quentin Colombet
0dca440c42 [GlobalISel] Re-apply r260922-260923 with MSVC-friendly code.
Original message:
Get rid of the ifdefs in TargetLowering.
Introduce a new API used only by GlobalISel: CallLowering.
This API will contain target hooks dedicated to call lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 19:26:02 +00:00
Rafael Espindola
2dcb92d8a7 Pass a std::unique_ptr to IRMover::move.
It was already the one "destroying" the source module, now the API
reflects that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260989 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 18:50:12 +00:00
Derek Schuff
cd66f7a1e9 [WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodes
CopyToReg nodes don't support FrameIndex operands. Other targets select
the FI to some LEA-like instruction, but since we don't have that, we
need to insert some kind of instruction that can take an FI operand and
produces a value usable by CopyToReg (i.e. in a vreg). So insert a dummy
copy_local between Op and its FI operand. This results in a redundant
copy which we should optimize away later (maybe in the post-FI-lowering
peephole pass).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 18:18:36 +00:00
Tom Stellard
f4f96b9ce5 [AMDGPU] Rename $dst operand to $vdst for VOP instructions.
Summary: This change renames output operand for VOP instructions from dst to vdst. This is needed to enable decoding named operands for disassembler.

Reviewers: vpykhtin, tstellarAMD, arsenm

Subscribers: arsenm, llvm-commits, nhaustov

Projects: #llvm-amdgpu-spb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 18:14:56 +00:00
Philip Reames
3506c68e2b Revert 260705, it appears to be causing pr26628
The root issue appears to be a confusion around what makeNoWrapRegion actually does.   It seems likely we need two versions of this function with slightly different semantics.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 17:14:30 +00:00
Andrey Turetskiy
a49cd63159 [X86] Enable the LEA optimization pass by default.
Differential Revision: http://reviews.llvm.org/D16877



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260979 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 16:41:38 +00:00
Dan Gohman
2ed76660d2 [WebAssembly] Switch from RPO sorting to topological sorting.
WebAssembly doesn't require full RPO; topological sorting is sufficient and
can preserve more of the MachineBlockPlacement ordering. Unfortunately, this
still depends a lot on heuristics, because while we use the
MachineBlockPlacement ordering as a guide, we can't use it in places where
it isn't topologically ordered. This area will require further attention.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 16:22:41 +00:00
Aaron Ballman
ebdb0a36ca A signed bitfield's range is [-1,0], so assigning 1 is technically an overflow. However, the other bitfield requires a signed value (it supports negative offsets), so it is slightly better to retain a signed 1-bit bitfield and use -1 instead of 1. Silences an MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 15:35:51 +00:00
Aaron Ballman
4d9522f889 Reverting r260922-260923; they cause link failures with MSVC.
http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/15436/steps/build/logs/stdio
http://bb.pgr.jp/builders/msbuild-llvmclang-x64-msc18-DA/builds/961/steps/build_llvm/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 15:29:06 +00:00
Dan Gohman
0f54412dec [WebAssembly] Create new registers instead of reusing old ones in RegStackify.
This avoids some complications updating LiveIntervals to be aware of the new
register lifetimes, because we can just compute new intervals from scratch
rather than describe how the old ones have been changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 15:17:21 +00:00
Rafael Espindola
7f7379544d Reapply r260489.
Original commit message:

[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations.

The bits of r260488 it depends on have been committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 15:16:00 +00:00
Dan Gohman
ab40f7f14f [WebAssembly] Implement support for custom NaN bit patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260968 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 15:14:23 +00:00
Rafael Espindola
2352c1884e Introduce a getAsRange helper.
This requires making an error message a bit more generic, but that seems
a reasonable tradeoff.

Extracted from r260488 but simplified a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 14:50:39 +00:00
Rafael Espindola
8f08340f64 Move DynRegionInfo out of the ELFDumper.
This reduces indentation in preparation to adding a bit more code to it.

Extracted from r260488.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260963 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 14:27:33 +00:00
Rafael Espindola
ed783357b0 This reverts commit r260488 and r260489.
Original messages:
    Revert "[readobj] Handle ELF files with no section table or with no program headers."
    Revert "[readobj] Dump DT_JMPREL relocations when outputting dynamic relocations."

r260489 depends on r260488 and among other issues r260488 deleted error
handling code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260962 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 14:17:48 +00:00
Andrey Turetskiy
e13835e919 [X86] PR26575: Fix LEA optimization pass.
Add a missing check for a type of address displacement operand of the load/store instruction being a candidate for LEA substitution.

Ref: https://llvm.org/bugs/show_bug.cgi?id=26575

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 12:47:45 +00:00
Benjamin Kramer
d11f0144bb [Hexagon] Hoist nonnull assert up.
Once a pointer is turned into a reference it cannot be nullptr, clang
rightfully warns about this assert being a tautology. Put the assert
before the reference is created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260949 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 09:53:47 +00:00
Amaury Sechet
ab8b27bde8 Make sure the functions' range is empty before going through it in the LLVM C API test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260947 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 08:37:01 +00:00
Craig Topper
72f4f1730e [X86] Fix typos. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 07:45:07 +00:00
Craig Topper
fece2b01a5 [X86] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 07:45:04 +00:00
Amaury Sechet
f1671f6231 Do some refactoring in constant generation in the C API echo test. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260941 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 07:33:23 +00:00
Craig Topper
2c44092d73 [X86] Fix typo in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260940 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 07:28:03 +00:00
Amaury Sechet
f5261f5dc4 Generate functions in 2 steps in the C API echo test. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 07:08:49 +00:00
Junmo Park
4ee5ab9daf [SCEVExpander] Make findExistingExpansion smarter
Summary:
Extending findExistingExpansion can use existing value in ExprValueMap.
This patch gives 0.3~0.5% performance improvements on 
benchmarks(test-suite, spec2000, spec2006, commercial benchmark)
   
Reviewers: mzolotukhin, sanjoy, zzheng

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 06:46:58 +00:00
Amaury Sechet
b1fb18e8f7 Restore the capability to manipulate datalayout from the C API
Summary:
This consist in variosu addition to the C API:

  LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
  void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
  LLVMTargetDataRef LLVMCreateTargetMachineData(LLVMTargetMachineRef T);

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: axw

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 05:11:24 +00:00
Craig Topper
35e38d845b [TableGen] Fix inconsistent spacing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:58 +00:00
Craig Topper
69dced0d4c [TableGen] Stop passing by reference an integer that doesn't get modified. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:56 +00:00
Craig Topper
6ff0feee63 [TableGen] Remove unused member variable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:54 +00:00
Craig Topper
86b7e4c701 Remove an unnecessary std::move to fix -Wpessimizing-move warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:17:42 +00:00
Craig Topper
33543a37a7 [TableGen] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 02:48:30 +00:00
Vedant Kumar
7e9bf0962b Simplify users of StringRef::{l,r}trim (NFC)
r260925 introduced a version of the *trim methods which is preferable
when trimming a single kind of character. Update all users in llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 02:06:01 +00:00
Vedant Kumar
9ae3e2ceaa [ADT] Add StringRef::{l,r}trim(char) overloads (NFC)
Add support for trimming a single kind of character from a StringRef.
This makes the common case of trimming null bytes much neater. It's also
probably a bit speedier too, since it avoids creating a std::bitset in
find_{first,last}_not_of.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260925 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 01:48:39 +00:00
Quentin Colombet
071210eedd [GlobalISel][IRTranslator] Override getPassName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 01:38:09 +00:00
Quentin Colombet
849184df82 [GlobalISel] Add missing file in previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260923 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 01:05:16 +00:00
Quentin Colombet
30880b6d80 [GlobalISel] Get rid of the ifdefs in TargetLowering.
Introduce a new API used only by GlobalISel: CallLowering.
This API will contain target hooks dedicated to call lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:57:44 +00:00
Amaury Sechet
89e84d7221 Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr
Summary: The name is confusing as it matche another method on the module.

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:23:52 +00:00
Amaury Sechet
d0aed13e56 Kill LLVMAddTargetData
Summary: It's red, it's dead.

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits, axw

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260919 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:22:02 +00:00
NAKAMURA Takumi
d964cf3e68 MITests: Update libdeps. llvm/Target/TargetOptions.h depends on MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:17:56 +00:00
Zia Ansari
5ed116b04b Implemented stack symbol table ordering/packing optimization to improve data locality and code size from SP/FP offset encoding.
Differential Revision: http://reviews.llvm.org/D15393



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 23:44:13 +00:00
Amaury Sechet
ab96d57a0b Rename LLVMSetDataLayout's argument to match what they stand for
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 23:40:06 +00:00
Matthias Braun
5cdb7d1d3d unittests/MI: Add Core library reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 22:09:38 +00:00
Matthias Braun
5f33f2da6d SmallPtrSet: Avoid initializing Array in the small case.
This patch avoids the initial memset at the cost of making iterators
slightly more complex. This should be beneficial as most SmallPtrSets
hold no or only a few elements, while iterating over them is less
common.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 21:38:42 +00:00
Matthias Braun
294f6d04dd APInt: Slightly simplify countLeadingZerosSlowCase()
We always clear the unused bits in the most signifant word so there is
no need to mask them out in countLeadingZerosSlowCase().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 20:06:22 +00:00
Matthias Braun
17946378fd APInt: Further simplify APInt::EqualSlowCase as suggested by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 20:06:19 +00:00
Ahmed Bougacha
f3164718c6 [X86] Remove now-dead variable and redundant assert. NFC.
The variable was made dead in NDEBUG by r260901, but the assert
was redundant anyway: get rid of both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 19:32:54 +00:00
Matthias Braun
1ff5bf6bbb Fix typo in LiveIntervalTest
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 19:30:11 +00:00
Matthias Braun
372250bdfb LiveIntervalAnalysis: Support moving of subregister defs in handleMove
This is an updated version which fixes a bug that happened with
uses tied to an earlyclobber operand which end at an unusual slotindex.

If two definitions write to independent subregisters then they can be
put in any order. LiveIntervalAnalysis::handleMove() did not support
this previously because it looks like moving a definition of a vreg past
another one.

This is a modified version of a patch proposed (two years ago) by
Vincent Lejeune! This version does not touch the read-undef flags and is
extended for the case of moving a subregister def behind all uses - this
can happen for subregister defs that are completely unused.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 19:25:36 +00:00
Matthias Braun
d9ede1ac1f Add unittest for LiveIntervalAnalysis::handleMove()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 19:25:34 +00:00