OSDN Git Service

android-x86/external-llvm.git
8 years agollvm-dwarfdump: Use deque rather than vector to preserve object reference/pointer...
David Blaikie [Thu, 7 Apr 2016 22:59:58 +0000 (22:59 +0000)]
llvm-dwarfdump: Use deque rather than vector to preserve object reference/pointer identity

TUs in each unit refer to the unit they are in, if the unit is moved
this reference is invalidated & things break.

No test case because UB isn't testable - ASan would likely catch this on
a large enough test case (just needs to have enough TUs that a
reallocation of the vector would occur) but didn't seem worthwhile. Up
for debate/revisiting if anyone feels strongly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265740 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Strengthen getInstrMappingImpl.
Quentin Colombet [Thu, 7 Apr 2016 22:52:49 +0000 (22:52 +0000)]
[RegisterBankInfo] Strengthen getInstrMappingImpl.

Teach the target independent code how to take advantage of type
information to get the mapping of an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265739 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add a way to record what register bank covers a
Quentin Colombet [Thu, 7 Apr 2016 22:45:42 +0000 (22:45 +0000)]
[RegisterBankInfo] Add a way to record what register bank covers a
specific type.

This will be used to find the default mapping of the instruction.
Also, this information is recorded, instead of computed, because it is
expensive from a type to know which register bank maps it.
Indeed, we need to iterate through all the register classes of all the
register banks to find the one that maps the given type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265736 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Introduce getRegBankFromConstraints as an helper
Quentin Colombet [Thu, 7 Apr 2016 22:35:03 +0000 (22:35 +0000)]
[RegisterBankInfo] Introduce getRegBankFromConstraints as an helper
method.

NFC.

The refactoring intends to make the code more readable and expose
more features to potential derived classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265735 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TargetRegisterInfo] Refactor the code to use BitMaskClassIterator.
Quentin Colombet [Thu, 7 Apr 2016 22:16:56 +0000 (22:16 +0000)]
[TargetRegisterInfo] Refactor the code to use BitMaskClassIterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265734 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Refactor the code to use BitMaskClassIterator.
Quentin Colombet [Thu, 7 Apr 2016 22:08:56 +0000 (22:08 +0000)]
[RegisterBankInfo] Refactor the code to use BitMaskClassIterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265733 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoConst correctness for BranchProbabilityInfo (NFC)
Mehdi Amini [Thu, 7 Apr 2016 21:59:28 +0000 (21:59 +0000)]
Const correctness for BranchProbabilityInfo (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265731 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TargetRegisterInfo] Introduce a helper class, BitMaskClassIterator, to
Quentin Colombet [Thu, 7 Apr 2016 21:55:21 +0000 (21:55 +0000)]
[TargetRegisterInfo] Introduce a helper class, BitMaskClassIterator, to
iterate over register class bitmask.

Thanks to this helper class, it would not require for each user of the
register classes bitmask to actually know how they are represents.
Moreover, it will make the code much easier to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265730 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRename parameter I to Index for WriteCombinedGlobalValueSummary() (NFC)
Mehdi Amini [Thu, 7 Apr 2016 21:49:31 +0000 (21:49 +0000)]
Rename parameter I to Index for WriteCombinedGlobalValueSummary() (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265729 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegBankSelect] Reuse RegisterBankInfo logic to get to the register bank
Quentin Colombet [Thu, 7 Apr 2016 21:32:23 +0000 (21:32 +0000)]
[RegBankSelect] Reuse RegisterBankInfo logic to get to the register bank
from a register.
On top of duplicating the logic, it was buggy! It would assert on
physical registers, since MachineRegisterInfo does not have any
information regarding register classes/banks for them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265727 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDo not select EhPad BB in MachineBlockPlacement when there is regular BB to schedule
Amaury Sechet [Thu, 7 Apr 2016 21:29:39 +0000 (21:29 +0000)]
Do not select EhPad BB in MachineBlockPlacement when there is regular BB to schedule

Summary:
EHPad BB are not entered the classic way and therefor do not need to be placed after their predecessors. This patch make sure EHPad BB are not chosen amongst successors to form chains, and are selected as last resort when selecting the best candidate.

EHPad are scheduled in reverse probability order in order to have them flow into each others naturally.

Reviewers: chandlerc, majnemer, rafael, MatzeB, escha, silvas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265726 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Get rid of some GlobalISel ifdefs.
Quentin Colombet [Thu, 7 Apr 2016 21:24:40 +0000 (21:24 +0000)]
[AArch64] Get rid of some GlobalISel ifdefs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265725 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TargetRegisterInfo] Fix the comment of SuperRegClassIterator::getMask.
Quentin Colombet [Thu, 7 Apr 2016 21:04:30 +0000 (21:04 +0000)]
[TargetRegisterInfo] Fix the comment of SuperRegClassIterator::getMask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265721 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] gcc does not like litteral without quotes even on preprocessor macros.
Quentin Colombet [Thu, 7 Apr 2016 20:49:15 +0000 (20:49 +0000)]
[AArch64] gcc does not like litteral without quotes even on preprocessor macros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265720 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64][CallLowering] Do not build the API if GlobalISel is not built.
Quentin Colombet [Thu, 7 Apr 2016 20:47:51 +0000 (20:47 +0000)]
[AArch64][CallLowering] Do not build the API if GlobalISel is not built.
This gets rid of some ifdefs and dummy implementations that were here
just to fill the blanks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265719 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GlobalISel] Add RegBankSelect hooks into the pass pipeline.
Quentin Colombet [Thu, 7 Apr 2016 20:27:33 +0000 (20:27 +0000)]
[GlobalISel] Add RegBankSelect hooks into the pass pipeline.
Now, RegBankSelect will happen after the IRTranslation and the target
may optionally add additional passes in between.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265716 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Implement atomic load/store for i32 and i64
Jan Vesely [Thu, 7 Apr 2016 19:23:11 +0000 (19:23 +0000)]
AMDGPU/SI: Implement atomic load/store for i32 and i64

Standard load/store instructions with GLC bit set.

Reviewers: tstellardAMD, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265709 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Add latency for export instructions
Tom Stellard [Thu, 7 Apr 2016 18:30:05 +0000 (18:30 +0000)]
AMDGPU/SI: Add latency for export instructions

Reviewers: arsenm, nhaehnle

Subscribers: nhaehnle, arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265708 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegBankSelect] Initial implementation for non-optimized output.
Quentin Colombet [Thu, 7 Apr 2016 18:19:27 +0000 (18:19 +0000)]
[RegBankSelect] Initial implementation for non-optimized output.
The pass walk through the machine function and assign the register banks
using the default mapping. In other words, there is no attempt to reduce
cross register copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265707 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add more details on the expectation of
Quentin Colombet [Thu, 7 Apr 2016 18:07:07 +0000 (18:07 +0000)]
[RegisterBankInfo] Add more details on the expectation of
getInstrMapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265704 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Provide a target independent helper function to guess
Quentin Colombet [Thu, 7 Apr 2016 18:01:19 +0000 (18:01 +0000)]
[RegisterBankInfo] Provide a target independent helper function to guess
the mapping of an instruction on register bank.

For most instructions, it is possible to guess the mapping of the
instruciton by using the encoding constraints.
It remains instructions without encoding constraints.
For copy-like instructions, we try to propagate the information we get
from the other operands. Otherwise, the target has to give this
information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265703 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Change the signature of getSizeInBits to factor out
Quentin Colombet [Thu, 7 Apr 2016 17:44:54 +0000 (17:44 +0000)]
[RegisterBankInfo] Change the signature of getSizeInBits to factor out
the access to MRI and TRI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265701 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Provide a default constructor for InstructionMapping
Quentin Colombet [Thu, 7 Apr 2016 17:30:18 +0000 (17:30 +0000)]
[RegisterBankInfo] Provide a default constructor for InstructionMapping
helper class.

The default constructor creates invalid (isValid() == false) instances
and may be used to communicate that a mapping was not found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265699 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Added bitmask pattern shuffle tests
Simon Pilgrim [Thu, 7 Apr 2016 17:23:55 +0000 (17:23 +0000)]
[X86][SSE] Added bitmask pattern shuffle tests

Based on OR(AND(MASK,V0),AND(~MASK,V1)) style patterns

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265697 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineRegisterInfo] Track register bank for virtual registers.
Quentin Colombet [Thu, 7 Apr 2016 17:20:29 +0000 (17:20 +0000)]
[MachineRegisterInfo] Track register bank for virtual registers.
A virtual register may have either a register bank or a register class.
This is represented by a PointerUnion between the related classes.

Typically, a virtual register went through the following states
regarding register class and register bank:

1. Creation: None is set. Virtual registers are fully generic.
2. Register bank assignment: Register bank is set. Virtual registers
live into a register bank, but we do not know the constraints they need
to fulfil.
3. Instruction selection: Register class is set. Virtual registers are
bound by encoding constraints.

To map these states to GlobalISel, the IRTranslator implements #1,
RegBankSelect #2, and Select #3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265696 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBank] Rename RegisterBank::contains into RegisterBank::covers.
Quentin Colombet [Thu, 7 Apr 2016 17:09:39 +0000 (17:09 +0000)]
[RegisterBank] Rename RegisterBank::contains into RegisterBank::covers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265695 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC] Added a note to release notes
Ehsan Amiri [Thu, 7 Apr 2016 16:47:35 +0000 (16:47 +0000)]
[PPC] Added a note to release notes

A draft line added to release notes for PPC, to keep a record of changes.
This is just a draft and will be rewritten towards the end of release.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265694 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SystemZ] Fix build break from r265689
Ulrich Weigand [Thu, 7 Apr 2016 16:33:25 +0000 (16:33 +0000)]
[SystemZ] Fix build break from r265689

Fix build error seen on some build bots due to:
error: default label in switch which covers all enumeration values

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265693 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86]: Fix for PR27251.
Kevin B. Smith [Thu, 7 Apr 2016 16:15:34 +0000 (16:15 +0000)]
[X86]: Fix for PR27251.
Differential Revision: http://reviews.llvm.org/D18850

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265690 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SystemZ] Implement conditional returns
Ulrich Weigand [Thu, 7 Apr 2016 16:11:44 +0000 (16:11 +0000)]
[SystemZ] Implement conditional returns

Return is now considered a predicable instruction, and is converted
to a newly-added CondReturn (which maps to BCR to %r14) instruction by
the if conversion pass.

Also, fused compare-and-branch transform knows about conditional
returns, emitting the proper fused instructions for them.

This transform triggers on a *lot* of tests, hence the huge diffstat.
The changes are mostly jX to br %r14 -> bXr %r14.

Author: koriakin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265689 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR/Verifier] Merge two ifs into one. NFC.
Davide Italiano [Thu, 7 Apr 2016 15:55:28 +0000 (15:55 +0000)]
[IR/Verifier] Merge two ifs into one. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265688 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GVN] Address review comments for D18662
Ulrich Weigand [Thu, 7 Apr 2016 15:55:11 +0000 (15:55 +0000)]
[GVN] Address review comments for D18662

As suggested by Chandler in his review comments for D18662, this
follow-on patch renames some variables in GetLoadValueForLoad and
CoerceAvailableValueToLoadType to hopefully make it more obvious
which variables hold value sizes and which hold load/store sizes.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265687 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC: disallow comparison of AtomicOrdering
JF Bastien [Thu, 7 Apr 2016 15:50:05 +0000 (15:50 +0000)]
NFC: disallow comparison of AtomicOrdering

Follow-up to D18775 and related clang change. AtomicOrdering is a lattice, 'stronger' is the right thing to do, direct comparison is fraught with peril.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265685 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GVN] Fix handling of sub-byte types in big-endian mode
Ulrich Weigand [Thu, 7 Apr 2016 15:45:02 +0000 (15:45 +0000)]
[GVN] Fix handling of sub-byte types in big-endian mode

When GVN wants to re-interpret an already available value in a smaller
type, it needs to right-shift the value on big-endian systems to ensure
the correct bytes are accessed.  The shift value is the difference of
the sizes of the two types.

This is correct as long as both types occupy multiples of full bytes.
However, when one of them is a sub-byte type like i1, this no longer
holds true: we still need to shift, but only to access the correct
*byte*.  Accessing bits within the byte requires no shift in either
endianness; e.g. an i1 resides in the least-significant bit of its
containing byte on both big- and little-endian systems.

Therefore, the appropriate shift value to be used is the difference of
the *storage* sizes of the two types.  This is already handled correctly
in one place where such a shift takes place (GetStoreValueForLoad), but
is incorrect in two other places: GetLoadValueForLoad and
CoerceAvailableValueToLoadType.

This patch changes both places to use the storage size as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265684 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC] Enable transformations in PPCPassConfig::addIRPasses at O2
Ehsan Amiri [Thu, 7 Apr 2016 15:30:55 +0000 (15:30 +0000)]
[PPC] Enable transformations in PPCPassConfig::addIRPasses at O2

http://reviews.llvm.org/D18562

A large number of testcases has been modified so they pass after this test.
One testcase is deleted, because I realized even after undoing the original
change that was committed with this testcase, the testcase still passes. So
I removed it. The change to one other testcase (test/CodeGen/PowerPC/pr25802.ll)
is an arbitrary change to keep it passing. Given the original intention of the
testcase, and the fact that fixing it will require some time to change the testcase,
we concluded that this quick change will be enough.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265683 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: Add MachineBasicBlock parameter to SIInstrInfo::insertWaitStates
Tom Stellard [Thu, 7 Apr 2016 14:47:07 +0000 (14:47 +0000)]
AMDGPU/SI: Add MachineBasicBlock parameter to SIInstrInfo::insertWaitStates

Summary: This makes it possible to insert nops at the end of blocks.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265678 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] fix readlane/readfirstlane src vgpr operand type.
Valery Pykhtin [Thu, 7 Apr 2016 13:41:51 +0000 (13:41 +0000)]
[AMDGPU] fix readlane/readfirstlane src vgpr operand type.

For VGPR_32 operand disassembler expects a VGPR register encoded as 0..255 (enum8 src operand).
readfirstlane/readline actually has enum9 operand and this change fixes VGPR_32 to VS_32 (enum9 encoding).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265670 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix test/Assembler/ifunc-asm.ll test on hexagon-elf bots
Dmitry Polukhin [Thu, 7 Apr 2016 13:18:43 +0000 (13:18 +0000)]
Fix test/Assembler/ifunc-asm.ll test on hexagon-elf bots

Temporary disable llc test, it seems that such test should be in some
other directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265669 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[GCC] Attribute ifunc support in llvm
Dmitry Polukhin [Thu, 7 Apr 2016 12:32:19 +0000 (12:32 +0000)]
[GCC] Attribute ifunc support in llvm

This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. Patch
for Clang http://reviews.llvm.org/D15524

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265667 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoInlineSpiller.cpp: Escap \@ in r265547. [-Wdocumentation]
NAKAMURA Takumi [Thu, 7 Apr 2016 11:30:06 +0000 (11:30 +0000)]
InlineSpiller.cpp: Escap \@ in r265547. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265657 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake helper functions static. NFC.
Benjamin Kramer [Thu, 7 Apr 2016 10:10:09 +0000 (10:10 +0000)]
Make helper functions static. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265653 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agofix r265645: target dependent printf formatting flags.
Valery Pykhtin [Thu, 7 Apr 2016 08:38:20 +0000 (08:38 +0000)]
fix r265645: target dependent printf formatting flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265649 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Check for sys/types.h in config-ix.cmake
Jeroen Ketema [Thu, 7 Apr 2016 08:36:13 +0000 (08:36 +0000)]
[CMake] Check for sys/types.h in config-ix.cmake

`sys/types.h` has a related define in `config.h.cmake`, but was never
checked for in CMake. Sync this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265648 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Add support for VZEXT constant folding
Simon Pilgrim [Thu, 7 Apr 2016 07:52:45 +0000 (07:52 +0000)]
[X86][SSE] Add support for VZEXT constant folding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265646 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support.
Valery Pykhtin [Thu, 7 Apr 2016 07:24:01 +0000 (07:24 +0000)]
[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support.

Reenable reverted r265550 with endianness issue fixed. Variables of
endian-aware types such as ulittle32_t should be explicitly casted
to their natural equivalent types before passing it as vararg to
printf like functions (format in my case). Added lit config file
depending on AMDGPU target as the testcase uses assembler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265645 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[BlockPlacement] Remove an unnecessary continue
Amaury Sechet [Thu, 7 Apr 2016 06:35:00 +0000 (06:35 +0000)]
[BlockPlacement] Remove an unnecessary continue

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265643 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MBP] Remove an unused function parameter
Amaury Sechet [Thu, 7 Apr 2016 06:34:47 +0000 (06:34 +0000)]
[MBP] Remove an unused function parameter

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265642 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDo some refactoring in the LLVM C API echo test to remove duplication. NFC
Amaury Sechet [Thu, 7 Apr 2016 05:56:20 +0000 (05:56 +0000)]
Do some refactoring in the LLVM C API echo test to remove duplication. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265641 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the sanitizer bootstrap error in r265547.
Wei Mi [Thu, 7 Apr 2016 05:27:17 +0000 (05:27 +0000)]
Fix the sanitizer bootstrap error in r265547.

The iterators of SmallPtrSet SpillsInSubTreeMap[Child].first may be
invalidated when SpillsInSubTreeMap grows. Rearrange the code to
ensure the grow of SpillsInSubTreeMap only happens before getting
the iterators of the SmallPtrSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265639 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[BlockPlacement] Remove an unnecessary continue" and "[MBP] Remove an unused...
Amaury Sechet [Thu, 7 Apr 2016 04:28:40 +0000 (04:28 +0000)]
Revert "[BlockPlacement] Remove an unnecessary continue" and "[MBP] Remove an unused function parameter"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265638 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "ValueMapper: Make LocalAsMetadata match function-local Values"
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 02:10:50 +0000 (02:10 +0000)]
Revert "ValueMapper: Make LocalAsMetadata match function-local Values"

This reverts commit r265631, since it caused bot failures:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3256
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/7272

Looks like something is depending on the old behaviour.  I'll try to
track it down and recommit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265637 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC.
Ahmed Bougacha [Thu, 7 Apr 2016 02:07:10 +0000 (02:07 +0000)]
[X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC.

Re-apply r265450 which caused PR27245 and was reverted in r265559
because of a wrong generalization: the fetch_and_add->add_and_fetch
combine only works in specific, but pretty common, cases:
  (icmp slt x, 0) -> (icmp sle (add x, 1), 0)
  (icmp sge x, 0) -> (icmp sgt (add x, 1), 0)
  (icmp sle x, 0) -> (icmp slt (sub x, 1), 0)
  (icmp sgt x, 0) -> (icmp sge (sub x, 1), 0)

Original Message:

We only generate LOCKed versions of add/sub when the result is unused.
It often happens that the result is used, but only by a comparison. We
can optimize those out by reusing EFLAGS, which lets us use the proper
instructions, instead of having to fallback to LXADD.

Instead of doing this as an MI peephole (as we do for the other
non-LOCKed (really, non-MR) forms), do it in ISel. It becomes quite
tricky later.

This also makes it eventually possible to stop expanding and/or/xor
if the only user is an icmp (also see D18141).

This uses the LOCK ISD opcodes added by r262244.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265636 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Refresh and tweak EFLAGS reuse tests. NFC.
Ahmed Bougacha [Thu, 7 Apr 2016 02:06:53 +0000 (02:06 +0000)]
[X86] Refresh and tweak EFLAGS reuse tests. NFC.

The non-1 and EQ/NE tests were misguided.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265635 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoValueMapper: Allow RF_IgnoreMissingLocals and RF_NullMapMissingGlobalValues
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 01:22:45 +0000 (01:22 +0000)]
ValueMapper: Allow RF_IgnoreMissingLocals and RF_NullMapMissingGlobalValues

Remove the assertion that disallowed the combination, since
RF_IgnoreMissingLocals should have no effect on globals.  As it happens,
RF_NullMapMissingGlobalValues asserted in MapValue(Constant*,...), so I
also changed a cast to a cast_or_null to get my test passing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265633 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoValueMapper: Make LocalAsMetadata match function-local Values
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 01:08:39 +0000 (01:08 +0000)]
ValueMapper: Make LocalAsMetadata match function-local Values

Start treating LocalAsMetadata similarly to function-local members of
the Value hierarchy in MapValue and MapMetadata.

  - Don't memoize them.
  - Return nullptr if they are missing.

This also cleans up ConstantAsMetadata to stop listening to the
RF_IgnoreMissingLocals flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265631 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Teach RegisterBankInfo about the CC register bank.
Quentin Colombet [Thu, 7 Apr 2016 00:39:29 +0000 (00:39 +0000)]
[AArch64] Teach RegisterBankInfo about the CC register bank.
We need to cover each register class with a register bank.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265629 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: RF_IgnoreMissingValues => RF_IgnoreMissingLocals, NFC
Duncan P. N. Exon Smith [Thu, 7 Apr 2016 00:26:43 +0000 (00:26 +0000)]
IR: RF_IgnoreMissingValues => RF_IgnoreMissingLocals, NFC

Clarify what this RemapFlag actually means.

  - Change the flag name to match its intended behaviour.
  - Clearly document that it's not supposed to affect globals.
  - Add a host of FIXMEs to indicate how to fix the behaviour to match
    the intent of the flag.

RF_IgnoreMissingLocals should only affect the behaviour of
RemapInstruction for function-local operands; namely, for operands of
type Argument, Instruction, and BasicBlock.  Currently, it is *only*
passed into RemapInstruction calls (and the transitive MapValue calls
that it makes).

When I split Metadata from Value I didn't understand the flag, and I
used it in a bunch of places for "global" metadata.

This commit doesn't have any functionality change, but prepares to
cleanup MapMetadata and MapValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265628 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Teach RegisterBankInfo about the mapping of register classes
Quentin Colombet [Thu, 7 Apr 2016 00:14:30 +0000 (00:14 +0000)]
[AArch64] Teach RegisterBankInfo about the mapping of register classes
on register banks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265626 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFollow-up for r265605: don't mutate vector we're iterating.
Michael Zolotukhin [Thu, 7 Apr 2016 00:09:42 +0000 (00:09 +0000)]
Follow-up for r265605: don't mutate vector we're iterating.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265625 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Implement a target independent version of
Quentin Colombet [Thu, 7 Apr 2016 00:07:50 +0000 (00:07 +0000)]
[RegisterBankInfo] Implement a target independent version of
getInstrMapping.

This implementation requires that the target implemented
getRegBankFromRegClass.
Indeed, the implementation uses the register classes for the encoding
constraints for the instructions to deduce the mapping of a value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265624 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRe-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudo...
Hans Wennborg [Thu, 7 Apr 2016 00:05:49 +0000 (00:05 +0000)]
Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)"

Third time's the charm? The previous attempt (r265345) caused ASan test
failures on X86, as broken CFI caused stack traces to not work.

This version of the patch makes sure not to merge with stack adjustments
that have CFI, and to not add merged instructions' offests to the CFI
about to be generated.

This is already covered by the lit tests; I just got the expectations
wrong previously.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265623 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add an helper function to get the size of a register.
Quentin Colombet [Wed, 6 Apr 2016 23:59:53 +0000 (23:59 +0000)]
[RegisterBankInfo] Add an helper function to get the size of a register.
The previous method to get the size was too simple and could fail for
physical registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265620 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a race condition in support library ThreadPool.
Justin Lebar [Wed, 6 Apr 2016 23:46:40 +0000 (23:46 +0000)]
Fix a race condition in support library ThreadPool.

By running TSAN on the ThreadPool unit tests it was discovered that the
threads in the pool can pop tasks off the queue at the same time the
"wait" routine is trying to check if the task queue is empty. This patch
fixes this problem by checking for active threads in the waiter before
checking whether the queue is empty.

Patch by Jason Henline.

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

Reviewers: joker.eph, jlebar

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265618 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[sancov] enabling coverage edge pruning by default.
Mike Aizatsky [Wed, 6 Apr 2016 23:24:37 +0000 (23:24 +0000)]
[sancov] enabling coverage edge pruning by default.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265615 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoValueMapper: clang-format ValueMapper.h, NFC
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 22:37:30 +0000 (22:37 +0000)]
ValueMapper: clang-format ValueMapper.h, NFC

Also remove duplicated identifiers from comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265611 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the compare-clang diff error introduced by r265547.
Wei Mi [Wed, 6 Apr 2016 22:31:17 +0000 (22:31 +0000)]
Fix the compare-clang diff error introduced by r265547.

Use MapVector instead of DenseMap for MergeableSpillsMap so it will be
iterated in determined order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265610 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-c] Add LLVMGetValueKind.
Peter Zotov [Wed, 6 Apr 2016 22:21:29 +0000 (22:21 +0000)]
[llvm-c] Add LLVMGetValueKind.

Patch by Nicole Mazzuca <npmazzuca@gmail.com>.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265608 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoThread Expected<...> up from createMachOObjectFile() to allow llvm-objdump to produce...
Kevin Enderby [Wed, 6 Apr 2016 22:14:09 +0000 (22:14 +0000)]
Thread Expected<...> up from createMachOObjectFile() to allow llvm-objdump to produce a real error message

Produce the first specific error message for a malformed Mach-O file describing
the problem instead of the generic message for object_error::parse_failed of
"Invalid data was encountered while parsing the file”.  Many more good error
messages will follow after this first one.

This is built on Lang Hames’ great work of adding the ’Error' class for
structured error handling and threading Error through MachOObjectFile
construction.  And making createMachOObjectFile return Expected<...> .

So to to get the error to the llvm-obdump tool, I changed the stack of
these methods to also return Expected<...> :

  object::ObjectFile::createObjectFile()
  object::SymbolicFile::createSymbolicFile()
  object::createBinary()

Then finally in ParseInputMachO() in MachODump.cpp the error can
be reported and the specific error message can be printed in llvm-objdump
and can be seen in the existing test case for the existing malformed binary
but with the updated error message.

Converting these interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. To contain the changes for now use of
errorToErrorCode() and errorOrToExpected() are used where the callers
are yet to be converted.

Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
“// TODO: Actually report errors helpfully” and a call something like
consumeError(ObjOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.

Note there is one fix also needed to lld/COFF/InputFiles.cpp that goes along
with this that I will commit right after this.  So expect lld not to built
after this commit and before the next one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265606 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LoopUnroll] Fix the way we update DT after complete unrolling.
Michael Zolotukhin [Wed, 6 Apr 2016 21:47:12 +0000 (21:47 +0000)]
[LoopUnroll] Fix the way we update DT after complete unrolling.

Updating dominators for exit-blocks of the unrolled loops is not enough,
as shown in PR27157. The proper way is to update dominators for all
dominance-children of original loop blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265605 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add methods to get the possible mapping of an instruction on a...
Quentin Colombet [Wed, 6 Apr 2016 21:37:22 +0000 (21:37 +0000)]
[RegisterBankInfo] Add methods to get the possible mapping of an instruction on a register bank.

This will be used by the register bank select pass to assign register banks
for generic virtual registers.

This was originally committed as r265573 but broke at least one windows bot.
The problem with the windows bot was that it was using a copy constructor for
the InstructionMappings class and could not synthesize it. Actually, the fact
that this class is not copy constructable is expected and the compiler should
use the move assignment constructor. Marking the problematic assignment
explicitly as using the move constructor has its own problems.

Indeed, with recent clang we get a warning that we may prevent the elision of
the copy by the compiler. A proper fix for both compilers would be to change the
API of getPossibleInstrMapping to take a InstructionMappings as input/output
parameter. This does not feel natural and since GISel is not used on windows
yet, I chose to workaround the problem by not compiling the problematic code on
windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265604 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC: make AtomicOrdering an enum class
JF Bastien [Wed, 6 Apr 2016 21:19:33 +0000 (21:19 +0000)]
NFC: make AtomicOrdering an enum class

Summary:
In the context of http://wg21.link/lwg2445 C++ uses the concept of
'stronger' ordering but doesn't define it properly. This should be fixed
in C++17 barring a small question that's still open.

The code currently plays fast and loose with the AtomicOrdering
enum. Using an enum class is one step towards tightening things. I later
also want to tighten related enums, such as clang's
AtomicOrderingKind (which should be shared with LLVM as a 'C++ ABI'
enum).

This change touches a few lines of code which can be improved later, I'd
like to keep it as NFC for now as it's already quite complex. I have
related changes for clang.

As a follow-up I'll add:
  bool operator<(AtomicOrdering, AtomicOrdering) = delete;
  bool operator>(AtomicOrdering, AtomicOrdering) = delete;
  bool operator<=(AtomicOrdering, AtomicOrdering) = delete;
  bool operator>=(AtomicOrdering, AtomicOrdering) = delete;
This is separate so that clang and LLVM changes don't need to be in sync.

Reviewers: jyknight, reames

Subscribers: jyknight, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265602 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MBP] Remove an unused function parameter
Haicheng Wu [Wed, 6 Apr 2016 20:38:20 +0000 (20:38 +0000)]
[MBP] Remove an unused function parameter

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265596 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPC] Use VSX/FP Facility integer load when an integer load's only users are conversi...
Ehsan Amiri [Wed, 6 Apr 2016 20:12:29 +0000 (20:12 +0000)]
[PPC] Use VSX/FP Facility integer load when an integer load's only users are conversion to FP

http://reviews.llvm.org/D18405

When the integer value loaded is never used directly as integer we should use VSX
or Floating Point Facility integer loads and avoid extra direct move

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265593 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoregenerate checks
Sanjay Patel [Wed, 6 Apr 2016 19:58:06 +0000 (19:58 +0000)]
regenerate checks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265591 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPut quotes around #error string.
James Y Knight [Wed, 6 Apr 2016 19:52:32 +0000 (19:52 +0000)]
Put quotes around #error string.

GCC reports "missing terminating ' character", even when it's being
skipped by preprocessing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265590 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU: Add a shader calling convention
Nicolai Haehnle [Wed, 6 Apr 2016 19:40:20 +0000 (19:40 +0000)]
AMDGPU: Add a shader calling convention

This makes it possible to distinguish between mesa shaders
and other kernels even in the presence of compute shaders.

Patch By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265589 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[RegisterBankInfo] Add methods to get the possible mapping of an
Quentin Colombet [Wed, 6 Apr 2016 19:04:58 +0000 (19:04 +0000)]
Revert "[RegisterBankInfo] Add methods to get the possible mapping of an
instruction on a register bank. This will be used by the register bank select
pass to assign register banks for generic virtual registers." and the follow-on
commits while I find out a way to fix the win7 bot:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/19882

This reverts commit r265578, r265581, r265584, and r265585.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265587 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IRVerifier] Don't crash on invalid DIFile inside DISubprogram.
Davide Italiano [Wed, 6 Apr 2016 18:46:39 +0000 (18:46 +0000)]
[IRVerifier] Don't crash on invalid DIFile inside DISubprogram.

r265515, this time with the correct fix. file inside DISubprogram is not
mandatory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265586 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Get rid of the assert in the constructor of InstructionMapping.
Quentin Colombet [Wed, 6 Apr 2016 18:43:46 +0000 (18:43 +0000)]
[RegisterBankInfo] Get rid of the assert in the constructor of InstructionMapping.

The default constructor now uses the regular constructor and the assert
is not valid anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265585 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Call the other constructor of InstructionMapping from the
Quentin Colombet [Wed, 6 Apr 2016 18:37:44 +0000 (18:37 +0000)]
[RegisterBankInfo] Call the other constructor of InstructionMapping from the
default constructor, instead of relying on the default constructor of
unique_ptr.

Second attempt at fixing the windows bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265584 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[gold] Save bitcode for module partitions (save-temps + split codegen).
Evgeniy Stepanov [Wed, 6 Apr 2016 18:32:13 +0000 (18:32 +0000)]
[gold] Save bitcode for module partitions (save-temps + split codegen).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265583 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Provide a default constructor for InstructionMapping
Quentin Colombet [Wed, 6 Apr 2016 18:24:34 +0000 (18:24 +0000)]
[RegisterBankInfo] Provide a default constructor for InstructionMapping
helper class.

The default constructor creates invalid (isValid() == false) instances
and may be used to communicate that a mapping was not found.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265581 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IRVerifier] Prefer dyn_cast<> over isa<> + cast<>.
Davide Italiano [Wed, 6 Apr 2016 18:13:44 +0000 (18:13 +0000)]
[IRVerifier] Prefer dyn_cast<> over isa<> + cast<>.

Thanks to Rafael for the suggestion!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265579 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add an helper function to get the size of a register.
Quentin Colombet [Wed, 6 Apr 2016 18:04:35 +0000 (18:04 +0000)]
[RegisterBankInfo] Add an helper function to get the size of a register.
The previous method to get the size was too simple and could fail for
physical registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265578 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Use DenseSet instead of DenseMap for ConstantUniqueMap; NFC
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 17:56:08 +0000 (17:56 +0000)]
IR: Use DenseSet instead of DenseMap for ConstantUniqueMap; NFC

Use a DenseSet instead of a DenseMap for constants in LLVMContextImpl.
Last time I looked at this was some time before r223588, when
DenseSet<V> had no advantage over DenseMap<V,char>.  After r223588,
there's a 50% memory savings.

This is all mechanical.  There were little bits of missing API from
DenseSet so I added the trivial implementations:

  - iterator::operator++(int)
  - template <class LookupKeyT> insert_as(ValueTy, LookupKeyT)

There should be no functionality change, just reduced memory consumption
(this wasn't on a profile or anything; just a cleanup I stumbled on).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265577 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIR: Stop explicitly clearing the MDStringCache
Duncan P. N. Exon Smith [Wed, 6 Apr 2016 17:56:05 +0000 (17:56 +0000)]
IR: Stop explicitly clearing the MDStringCache

The MDStringCache doesn't need to be explicitly cleared before
destruction.  The destructor handles it at least as efficiently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265576 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add a method to get the mapping RegClass -> RegBank.
Quentin Colombet [Wed, 6 Apr 2016 17:51:41 +0000 (17:51 +0000)]
[RegisterBankInfo] Add a method to get the mapping RegClass -> RegBank.
This should be TableGen'ed at some point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265574 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add methods to get the possible mapping of an instruction on a...
Quentin Colombet [Wed, 6 Apr 2016 17:45:40 +0000 (17:45 +0000)]
[RegisterBankInfo] Add methods to get the possible mapping of an instruction on a register bank.
This will be used by the register bank select pass to assign register banks
for generic virtual registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265573 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agovim: add missing keyword
Saleem Abdulrasool [Wed, 6 Apr 2016 17:42:16 +0000 (17:42 +0000)]
vim: add missing keyword

`source_filename` was introduced as a keyword in SVN r264884, but the syntax
file was not updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265572 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Change the CMake to avoid to build GlobalISel related APIs
Quentin Colombet [Wed, 6 Apr 2016 17:38:12 +0000 (17:38 +0000)]
[AArch64] Change the CMake to avoid to build GlobalISel related APIs
when GISel is not built.
The positive side effects are:
- We do not have to define dummy implementation
- We do not have to do weird gymnastic to avoid like issues (like
  missing constructor or vtable for the base classes)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265570 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Teach the subtarget how to get to the RegisterBankInfo.
Quentin Colombet [Wed, 6 Apr 2016 17:26:03 +0000 (17:26 +0000)]
[AArch64] Teach the subtarget how to get to the RegisterBankInfo.

Rework the access to GlobalISel APIs to contain how much of
the APIs we need to access for the final executable to build when
GlobalISel is not built.

This prevents massive usage of ifdefs in various places. Now, all the
GlobalISel ifdefs will be happing only in AArch64TargetMachine.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265567 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Make the destructor public... that may be useful!
Quentin Colombet [Wed, 6 Apr 2016 17:09:34 +0000 (17:09 +0000)]
[RegisterBankInfo] Make the destructor public... that may be useful!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265565 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Implement the verify method of the InstructionMapping helper class.
Quentin Colombet [Wed, 6 Apr 2016 17:01:43 +0000 (17:01 +0000)]
[RegisterBankInfo] Implement the verify method of the InstructionMapping helper class.
This checks that all the register operands get a proper mapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265563 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLoop Unroll: add options and tweak to make Partial unrolling more useful
Fiona Glaser [Wed, 6 Apr 2016 16:57:25 +0000 (16:57 +0000)]
Loop Unroll: add options and tweak to make Partial unrolling more useful

1. Add FullUnrollMaxCount option that works like MaxCount, but also limits
   the unroll count for fully unrolled loops. So if a loop has an iteration
   count over this, it won't fully unroll.
2. Add CLI options for MaxCount and the new option, so they can be tested
   (plus a test).
3. Make partial unrolling obey MaxCount.

An example use-case (the out of tree one this is originally designed for) is
a target’s TTI can analyze a loop and decide on a max unroll count separate
from the size threshold, e.g. based on register pressure, then constrain
LoopUnroll to not exceed that, regardless of the size of the unrolled loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265562 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MachineRegisterInfo] Document what is the expected metric for the size of generic...
Quentin Colombet [Wed, 6 Apr 2016 16:51:04 +0000 (16:51 +0000)]
[MachineRegisterInfo] Document what is the expected metric for the size of generic registers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265561 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r265450 "[X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC."
Hans Wennborg [Wed, 6 Apr 2016 16:44:38 +0000 (16:44 +0000)]
Revert r265450 "[X86] Reuse EFLAGS and form LOCKed ops when only user is SETCC."

It caused ASan 32-bit tests to hang (PR27245).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265559 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoLoopUnroll: only allow non-modulo Partial unrolling when Runtime=true
Fiona Glaser [Wed, 6 Apr 2016 16:43:45 +0000 (16:43 +0000)]
LoopUnroll: only allow non-modulo Partial unrolling when Runtime=true

Patch by Evgeny Stupachenko <evstupac@gmail.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265558 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Implement the verify method for the ValueMapping helper class.
Quentin Colombet [Wed, 6 Apr 2016 16:40:23 +0000 (16:40 +0000)]
[RegisterBankInfo] Implement the verify method for the ValueMapping helper class.
The method checks that the value is fully defined accross the different partial
mappings and that the partial mappings are compatible between each other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265556 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[RegisterBankInfo] Add a verify method for the PartialMapping helper class.
Quentin Colombet [Wed, 6 Apr 2016 16:33:26 +0000 (16:33 +0000)]
[RegisterBankInfo] Add a verify method for the PartialMapping helper class.
This verifies that the PartialMapping can be accomadated into the related
register bank.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265555 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support."
Valery Pykhtin [Wed, 6 Apr 2016 16:30:21 +0000 (16:30 +0000)]
Revert "[AMDGPU] llvm-objdump: Minimal HSA Code Object disassembler support."

This reverts commit r265550. There're problems with endianness on dumping instruction bytes. Need to find out how to use support::ulittle32_t type properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265554 91177308-0d34-0410-b5e6-96231b3b80d8