Commit Graph

104055 Commits

Author SHA1 Message Date
Filipe Cabecinhas
cb596baadd Change the blend tests to AVX, not AVX2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209107 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-19 04:47:12 +00:00
NAKAMURA Takumi
6f1b92a0d4 Reformat blank lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209106 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-19 04:43:26 +00:00
NAKAMURA Takumi
14c7036563 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209105 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-19 04:43:03 +00:00
Craig Topper
6ec950549b Remove last uses of OwningPtr from llvm. As far as I can tell these method versions are not used by lldb, lld, or clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209103 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-18 21:55:38 +00:00
Craig Topper
677564fe72 Use std::unique_ptr instead of OwningPtr in the MemoryBuffer unittests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209102 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-18 21:01:46 +00:00
Saleem Abdulrasool
1cc4e8a79b ARM: make libcall setup more table driven
Rather than create a series of function calls to setup the library calls, create
a table with the information and just use the table to drive the configuration
of the library calls.  This makes it easier to both inspect the list as well as
to modify it.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209089 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-18 16:39:11 +00:00
Benjamin Kramer
aad181f644 Options: Use erase_if to remove Args from the list.
While there make getOption return a const reference so we don't have to put it
on the stack when calling methods on it. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209088 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-18 15:14:13 +00:00
Saleem Abdulrasool
bf3e78f572 ARM: improve WoA ABI conformance for frame register
Windows on ARM uses R11 for the frame pointer even though the environment is a
pure Thumb-2, thumb-only environment.  Replicate this behaviour to improve
Windows ABI compatibility.  This register is used for fast stack walking, and
thus is part of the Windows ABI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209085 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-18 04:12:52 +00:00
Saleem Abdulrasool
4da07c2038 ARM: consolidate frame pointer register knowledge
Use the ARMBaseRegisterInfo to query the frame register.  The base register info
is aware of the frame register that is used for the frame pointer.  Use that to
determine the frame register rather than duplicating the knowledge.  Although,
the code path is slightly different in that it may return SP, that can only
occur if the frame pointer has been omitted in the machine function, which is
supposed to contain the desired value in that case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209084 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-18 03:18:09 +00:00
Saleem Abdulrasool
82b1114fef Target: remove old constructors for CallLoweringInfo
This is mostly a mechanical change changing all the call sites to the newer
chained-function construction pattern.  This removes the horrible 15-parameter
constructor for the CallLoweringInfo in favour of setting properties of the call
via chained functions.  No functional change beyond the removal of the old
constructors are intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209082 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 21:50:17 +00:00
Saleem Abdulrasool
a2b20f975f Target: add support to build CallLoweringInfo
Rather than introducing an auxiliary CallLoweringInfoBuilder, add the methods to
do chained function construction directly to CallLoweringInfo.  This reduces the
monstrous 15-parameter constructor into a series of simpler (for some definition
of simpler) functions that control particular aspects of the call.  The old
interfaces can be completely removed once callers are moved to the new chained
constructor pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209081 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 21:50:06 +00:00
Saleem Abdulrasool
d825568843 Target: change member from reference to pointer
This is a preliminary step to help ease the construction of CallLoweringInfo.
Changing the construction to a chained function pattern requires that the
parameter be nullable.  However, rather than copying the vector, save a pointer
rather than the reference to permit a late binding of the arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209080 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 21:50:01 +00:00
Saleem Abdulrasool
a53c765745 ARM: whitespace
Remove some whitespace.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209079 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 21:49:54 +00:00
Rafael Espindola
c86235f4eb Use create methods since msvc doesn't handle delegating constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209076 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 21:29:57 +00:00
Rafael Espindola
e7a6c2f1df Handle ConstantAggregateZero when upgrading global_ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209075 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 21:00:22 +00:00
Rafael Espindola
fbd8cc0926 Reduce abuse of default values in the GlobalAlias constructor.
This is in preparation for adding an optional offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209073 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 19:57:46 +00:00
NAKAMURA Takumi
a2f8219646 Revert r209049 and r209065, "Add support for combining GEPs across PHI nodes"
It broke clang selfhosting even after r209065.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209067 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 14:39:21 +00:00
David Majnemer
41a6378a65 MachO: Add comments describing section flags/attrs
When pruning superfluous MachO structure definitions, I chose to keep
the most generically useful which is why Support's definitions won over
the ones in MC.

However, the MC copy had some useful comments describing some of the
field values.

Bring these back to the copy in Support.  While doing this, fill in some
of the underdocumented definitions as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209066 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 07:36:36 +00:00
Louis Gerbarg
7af8e0d2a1 Fix for sanitizer crash introduced in r209049
This patch fixes 3 issues introduced by r209049 that only showed up in on
the sanitizer buildbots. One was a typo in a compare. The other is a check to
confirm that the single differing value in the two incoming GEPs is the same
type. The final issue was the the IRBuilder under some circumstances would
build PHIs in the middle of the block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209065 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 06:51:36 +00:00
David Majnemer
575fc08c48 Target: Replace getSection().empty() with hasSection()
No functional change, just a small cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209064 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 05:18:40 +00:00
Saleem Abdulrasool
3395f5fca8 test: fix copy-paste mistake
Accidental over-quoting of the match string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209058 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 04:32:38 +00:00
Saleem Abdulrasool
563fca4509 ARM: use the proper target object format for WoA
WoA uses COFF, not ELF.  ARMISelLowering::createTLOF would previously return ELF
for any non-MachO platform.  This was a missed site when the original change for
target format support for Windows on ARM was done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209057 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 04:28:08 +00:00
Chandler Carruth
2ff4a49344 [x86] Fix a bad predicate I spotted by inspection -- pshufhw and pshuflw
were added in SSE2, no SSSE3. Found this while auditing all uses of
SSSE3 in the X86 target. I don't actually expect this to make
a significant difference on anything and I don't have any detailed test
cases but I updated the existing test cases that already covered some of
this code path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209056 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 03:29:20 +00:00
Alexey Samsonov
bf6e3f9257 [DWARF parser] Teach DIContext to fetch short (non-linkage) function names for a given address.
Change --functions option in llvm-symbolizer tool to accept
values "none", "short" or "linkage". Update the tests and docs
accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209050 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-17 00:07:48 +00:00
Louis Gerbarg
2d1fa5f718 Add support for combining GEPs across PHI nodes
Currently LLVM will generally merge GEPs. This allows backends to use more
complex addressing modes. In some cases this is not happening because there
is PHI inbetween the two GEPs:

  GEP1--\
        |-->PHI1-->GEP3
  GEP2--/

This patch checks to see if GEP1 and GEP2 are similiar enough that they can be
cloned (GEP12) in GEP3's BB, allowing GEP->GEP merging (GEP123):

  GEP1--\                     --\                           --\
        |-->PHI1-->GEP3  ==>    |-->PHI2->GEP12->GEP3 == >    |-->PHI2->GEP123
  GEP2--/                     --/                           --/

This also breaks certain use chains that are preventing GEP->GEP merges that the
the existing instcombine would merge otherwise.

Tests included.

rdar://15547484

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209049 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 23:47:24 +00:00
Pete Cooper
70f8b47a65 Use a sized enum for MachineOperandType. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209048 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 23:28:17 +00:00
Filipe Cabecinhas
31c8059e5d Added tests for the cost of lowering VSELECT instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209045 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 22:47:58 +00:00
Filipe Cabecinhas
d77c1c4465 Implemented special cases for PerformVSELECTCombine.
vselects with constant masks, after legalization, will get turned into
specialized shuffle_vectors so they can be matched to blend+imm
instructions.

Fixed some tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209044 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 22:47:54 +00:00
Filipe Cabecinhas
5ea7215050 Lower vselects into X86ISD::BLENDI when appropriate.
LowerVSELECT will, if possible, generate a X86ISD::BLENDI DAG node if the
condition is constant and we can emit that instruction, given the
subtarget.

This is not enough for all cases. An additional SELECTCombine optimization
will be committed.

Fixed tests that were expecting variable blends but where a blend+imm can
be generated.
Added test where we can't emit blend+immediate.
Added avx2 blend+imm tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209043 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 22:47:49 +00:00
Filipe Cabecinhas
38cbea8057 Implemented LowerVSELECT to custom lower some instructions.
No functionality change intended. The types that previously were set to
lower as Expand or Legal are doing the same thing with this lowering
function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209042 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 22:47:43 +00:00
Rafael Espindola
ad6d7f58c7 Delete getAliasedGlobal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209040 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 22:37:03 +00:00
David Blaikie
b3e18972ef DebugInfo: Assert rather than conditionalizing when a CU's subprogram list contains declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209039 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 22:21:45 +00:00
David Blaikie
e792969b4f DebugInfo: Handle emitting constants of C++ unicode character type.
Patch by Stephan Tolksdorf! (with some test case stuff by me)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209037 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 21:53:09 +00:00
Tom Stellard
17200e3bb3 R600/SI: Refactor the VOP3_32 tablegen class
This will allow us to use a single MachineInstr to represent
instructions which behave the same but have different encodings
on some subtargets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209028 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:56:47 +00:00
Tom Stellard
9d99d7a185 R600/SI: Add a PredicateControl class for managing TableGen predicates
This was inspired by the PredicateControl class in the MIPS backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209027 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:56:45 +00:00
Tom Stellard
9b24e0c6f2 R600/SI: Move tablegen patterns away from instruction defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209026 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:56:44 +00:00
Tom Stellard
1c073c3954 R600/SI: Remove unused instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209025 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:56:43 +00:00
Tom Stellard
3bd63cd655 R600/SI: Promote f32 SELECT to i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209024 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:56:41 +00:00
Tom Stellard
03b96200c6 R600/SI: Remove duplicate pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:56:37 +00:00
Reid Kleckner
1ce3088669 Add comdat key field to llvm.global_ctors and llvm.global_dtors
This allows us to put dynamic initializers for weak data into the same
comdat group as the data being initialized.  This is necessary for MSVC
ABI compatibility.  Once we have comdats for guard variables, we can use
the combination to help GlobalOpt fire more often for weak data with
guarded initialization on other platforms.

Reviewers: nlewycky

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209015 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:39:27 +00:00
Rafael Espindola
dedd6203ad Fix a warning in builds without asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209012 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 20:05:08 +00:00
David Blaikie
0c2d969bb0 DebugInfo: Add an assert regarding the subprogram in the subprogram map matching the abstract subprogram.
I'm not sure this is how it'll be going forward (I'd rather prefer the
definition to be in the main SP mapping, for various reasons) but this
helps me understand how it is today.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209009 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 19:42:10 +00:00
Rafael Espindola
27c076ae40 Fix most of PR10367.
This patch changes the design of GlobalAlias so that it doesn't take a
ConstantExpr anymore. It now points directly to a GlobalObject, but its type is
independent of the aliasee type.

To avoid changing all alias related tests in this patches, I kept the common
syntax

@foo = alias i32* @bar

to mean the same as now. The cases that used to use cast now use the more
general syntax

@foo = alias i16, i32* @bar.

Note that GlobalAlias now behaves a bit more like GlobalVariable. We
know that its type is always a pointer, so we omit the '*'.

For the bitcode, a nice surprise is that we were writing both identical types
already, so the format change is minimal. Auto upgrade is handled by looking
through the casts and no new fields are needed for now. New bitcode will
simply have different types for Alias and Aliasee.

One last interesting point in the patch is that replaceAllUsesWith becomes
smart enough to avoid putting a ConstantExpr in the aliasee. This seems better
than checking and updating every caller.

A followup patch will delete getAliasedGlobal now that it is redundant. Another
patch will add support for an explicit offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209007 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 19:35:39 +00:00
David Blaikie
33b37c7b12 DebugInfo: Assume the CU's Subprogram list only contains definitions.
DIBuilder maintains this invariant and the current DwarfDebug code could
end up doing weird things if it contained declarations (such as putting
the definition DIE inside a CU that contained the declaration - this
doesn't seem like a good idea, so rather than adding logic to handle
this case we'll just ban in for now & cross that bridge if we come to
it later).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209004 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 18:26:53 +00:00
Chad Rosier
117b038592 [ARM64] Increases the Sched Model accuracy for Cortex-A53.
Patch by Dave Estes <cestes@codeaurora.org>
http://reviews.llvm.org/D3769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209001 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 17:15:33 +00:00
David Majnemer
3258443195 InstSimplify: Improve handling of ashr/lshr
Summary:
Analyze the range of values produced by ashr/lshr cst, %V when it is
being used in an icmp.

Reviewers: nicholas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209000 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 17:14:03 +00:00
David Majnemer
7a2ed26563 InstSimplify: Optimize using dividend in sdiv
Summary:
The dividend in an sdiv tells us the largest and smallest possible
results.  Use this fact to optimize comparisons against an sdiv with a
constant dividend.

Reviewers: nicholas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208999 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 16:57:04 +00:00
Tilmann Scheller
18fc3275c1 [ARM64] Fix wrong comment in load/store optimization pass.
ldr x1, [x0, #64]
add x0, x0, #64
 ->
ldr x1, [x0], #64

is not a valid transformation, the correct transformation (and what the code actually does) is:

ldr x1, [x0, #64]
add x0, x0, #64
 ->
ldr x1, [x0, #64]!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 16:50:13 +00:00
David Blaikie
54978b3645 DwarfDebug: Refactor AT_ranges/AT_high_pc+AT_low_pc emission into helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208997 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 16:42:40 +00:00
Simon Atanasyan
19ab8f850f [yaml2obj][ELF] Add an optional Size field to the YAML section declaration.
Now the only method to configure ELF section's content and size is to assign
a hexadecimal string to the `Content` field. Unfortunately this way is
completely useless when you need to declare a really large section.

To solve this problem this patch adds one more optional field `Size`
to the `RawContentSection` structure. When yaml2obj generates an ELF file
it uses the following algorithm:
1. If both `Content` and `Size` fields are missed create an empty section.
2. If only `Content` field is missed take section length from the `Size`
   field and fill the section by zero.
3. If only `Size` field is missed create a section using data from
   the `Content` field.
4. If both `Content` and `Size` fields are provided validate that the `Size`
   value is not less than size of `Content` data. Than take section length
   from the `Size`, fill beginning of the section by `Content` and the rest
   by zero.

Examples
--------
* Create a section 0x10000 bytes long filled by zero
  Name: .data
  Type: SHT_PROGBITS
  Flags: [ SHF_ALLOC ]
  Size: 0x10000

* Create a section 0x10000 bytes long starting from 'CA' 'FE' 'BA' 'BE'
  Name: .data
  Type: SHT_PROGBITS
  Flags: [ SHF_ALLOC ]
  Content: CAFEBABE
  Size: 0x10000

The patch reviewed by Michael Spencer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208995 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 16:01:00 +00:00