Commit Graph

77408 Commits

Author SHA1 Message Date
Tim Northover
5530ac99e6 ARM: treat [N x i32] and [N x i64] as AAPCS composite types
The logic is almost there already, with our special homogeneous aggregate
handling. Tweaking it like this allows front-ends to emit AAPCS compliant code
without ever having to count registers or add discarded padding arguments.

Only arrays of i32 and i64 are needed to model AAPCS rules, but I decided to
apply the logic to all integer arrays for more consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230348 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 17:22:34 +00:00
Tobias Grosser
bc8f84c030 Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit r230062.

Debian stable (wheezy) ships still with cmake 2.8.9.

The commit broke my LLVM/Polly buildbot, to my knowledge our only Linux+cmake
buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230343 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 16:39:46 +00:00
Sanjay Patel
a90eb87f7e simplify control flow; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 16:26:02 +00:00
Hans Wennborg
b499b73e30 Revert r230280: "Bugfix: SCEVExpander incorrectly marks increment operations as no-wrap"
This caused PR22674, failing this assert:

Instructions.h:2281: llvm::Value* llvm::PHINode::getOperand(unsigned int) const: Assertion `i_nocapture < OperandTraits<PHINode>::operands(this) && "getOperand() out of range!"' failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 16:19:29 +00:00
Michael Kuperstein
09d756a7e0 [x32] Mark RBX as reserved when EBX is the base pointer.
This should have gone into r230334.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230339 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 16:13:16 +00:00
Sanjay Patel
269510242b fix typo in comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230338 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 16:11:05 +00:00
Michael Kuperstein
2379e8a2ee [x32] x32 should use ebx as the base pointer.
This fixes the original issue in PR22655, but not the secondary one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 15:27:13 +00:00
Hal Finkel
cccfe54933 [SDAG] Handle LowerOperation returning its input consistently
For almost all node types, if the target requested custom lowering, and
LowerOperation returned its input, we'd treat the original node as legal. This
did not work, however, for many loads and stores, because they follow
slightly different code paths, and we did not account for the possibility of
LowerOperation returning its input at those call sites.

I think that we now handle this consistently everywhere. At the call sites in
LegalizeDAG, we used to assert in this case, so there's no functional change
for any existing code there. For the call sites in LegalizeVectorOps, this
really only affects whether or not we set Changed = true, but I think makes the
semantics clearer.

No test case here, but it will be covered by an upcoming PowerPC commit adding
QPX support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 12:59:47 +00:00
Toma Tabacu
41ecf2b99e [mips] Reformat some TableGen definitions. NFC.
Summary: Separated some instruction and pseudo-instruction definitions from InstAlias definitions, added banner for pseudo-instructions and removed a redundant whitespace from a pseudo-instruction definition. No functional change.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 11:52:19 +00:00
Kuba Brecka
81dce4c02c Fix alloca_instruments_all_paddings.cc test to work under higher -O levels (llvm part)
When AddressSanitizer only a single dynamic alloca and no static allocas, due to an early exit from FunctionStackPoisoner::poisonStack we forget to unpoison the dynamic alloca.  This patch fixes that.

Reviewed at http://reviews.llvm.org/D7810



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230316 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 09:47:05 +00:00
Craig Topper
c3b9d471f6 [X86] Remove the AbsMem32 type from the assembly parser. Only really need the 16-bit version which will automatically get prioritized over AbsMem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230313 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 08:02:13 +00:00
Reed Kotler
aecbb87ee8 Beginning of alloca implementation for Mips fast-isel
Summary: Begin to add various address modes; including alloca.

Test Plan: Make sure there are no regressions in test-suite at O0/02 in mips32r1/r2

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: echristo, rfuhler, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 02:36:45 +00:00
Bob Wilson
b664a60ecf Fix handling of negative offsets for AddrModeT2_i8s4 in rewriteT2FrameIndex.
This is a follow up to r230233 to fix something that I noticed by
inspection. The AddrModeT2_i8s4 addressing mode does not support
negative offsets. I spent a good chunk of the day trying to come up with
a testcase for this but was not successful. This addressing mode is used
to spill and restore GPRPair registers in Thumb2 code and that does not
happen often. We also make very limited used of negative offsets when
lowering frame indexes. I am going ahead with the change anyway, because
I am pretty confident that it is correct. I also added a missing assertion
to check that the low bits of the scaled offset are zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 01:37:31 +00:00
Sanjoy Das
edf1700d33 Fix bug 22641
The bug was a result of getPreStartForExtend interpreting nsw/nuw
flags on an add recurrence more strongly than is legal.  {S,+,X}<nsw>
implies S+X is nsw only if the backedge of the loop is taken at least
once.

NOTE: I had accidentally committed an unrelated change with the commit
message of this change in r230275 (r230275 was reverted in r230279).
This is the correct change for this commit message.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 01:02:42 +00:00
Manman Ren
bd26e6a006 [LTO API] add lto_codegen_set_module to set the destination module.
When debugging LTO issues with ld64, we use -save-temps to save the merged
optimized bitcode file, then invoke ld64 again on the single bitcode file to
speed up debugging code generation passes and ld64 stuff after code generation.

llvm linking a single bitcode file via lto_codegen_add_module will generate a
different bitcode file from the single input. With the newly-added
lto_codegen_set_module, we can make sure the destination module is the same as
the input.

lto_codegen_set_module will transfer the ownship of the module to code
generator.

rdar://19024554


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230290 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 00:45:56 +00:00
Adam Nemet
989a0200c2 [LoopAccesses] LAA::getInfo to use const reference for stride parameter
And other required const-correctness fixes to make this work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230289 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 00:41:59 +00:00
David Majnemer
fbdee9f0c0 X86: Only use 'lea' in Win64 epilogues if a frame pointer exists
We can only use 'add' in epilogues, 'lea' is not permitted unless we've
established a frame pointer in the prologue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 00:11:32 +00:00
Sanjoy Das
f922d9cfe4 New instcombine rule: max(~a,~b) -> ~min(a, b)
This case is interesting because ScalarEvolutionExpander lowers min(a,
b) as ~max(~a,~b).  I think the profitability heuristics can be made
more clever/aggressive, but this is a start.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230285 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-24 00:08:41 +00:00
Sanjoy Das
8d16a81c33 Bugfix: SCEVExpander incorrectly marks increment operations as no-wrap
When emitting the increment operation, SCEVExpander marks the
operation as nuw or nsw based on the flags on the preincrement SCEV.
This is incorrect because, for instance, it is possible that {-6,+,1}
is <nuw> while {-6,+,1}+1 = {-5,+,1} is not.

This change teaches SCEV to mark the increment as nuw/nsw only if it
can explicitly prove that the increment operation won't overflow.

Apart from the attached test case, another (more realistic) manifestation
of the bug can be seen in Transforms/IndVarSimplify/pr20680.ll.

NOTE: this change was landed with an incorrect commit message in
rL230275 and was reverted for that reason in rL230279.  This commit
message is the correct one.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 23:22:58 +00:00
Sanjoy Das
69048edf8a Revert 230275.
230275 got committed with an incorrect commit message due to a mixup
on my side.  Will re-land in a few moments with the correct commit
message.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 23:13:22 +00:00
Simon Pilgrim
a631cd85ca Fix based on post-commit comment on D7816 & rL230177 - BUILD_VECTOR operand truncation was using the the BV's output scalar type instead of the input type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 23:04:28 +00:00
Andrea Di Biagio
770e106ed6 [X86] Teach how to custom lower double-to-half conversions under fast-math.
This patch teaches the backend how to expand a double-half conversion into
a double-float conversion immediately followed by a float-half conversion.
We do this only under fast-math, and if float-half conversions are legal
for the target.

Added test CodeGen/X86/fastmath-float-half-conversion.ll

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 22:59:02 +00:00
Sanjoy Das
7ebbc8de2f Fix bug 22641
The bug was a result of getPreStartForExtend interpreting nsw/nuw
flags on an add recurrence more strongly than is legal.  {S,+,X}<nsw>
implies S+X is nsw only if the backedge of the loop is taken at least
once.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 22:55:13 +00:00
Rafael Espindola
38ce6c7c1c Fix invalid cast.
Fixes PR22525.

Patch by Ben Longbons with testcase by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:51:06 +00:00
David Majnemer
ad6622575c X86: Use a smaller 'mov' instruction for stack probe calls
Prologue emission, in some cases, requires calls to a stack probe helper
function.  The amount of stack to probe is passed as a register
argument in the Win64 ABI but the instruction sequence used is
pessimistic: it assumes that the number of bytes to probe is greater
than 4 GB.

Instead, select a more appropriate opcode depending on the number of
bytes we are going to probe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:50:30 +00:00
David Majnemer
d71e4c6218 X86: Use 'mov' instead of 'lea' in Win64 SEH prologues when possible
'mov' and 'lea' are equivalent when the displacement applied with 'lea'
is zero.  However, 'mov' should encode smaller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:50:27 +00:00
David Majnemer
16ae406776 X86: Explain why we cannot use a 'mov' in a Win64 epilogue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:50:25 +00:00
David Majnemer
10c4458d7d X86: Consistently use 'epilogue' instead of 'epilog'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:50:18 +00:00
Sanjay Patel
4aef46411f add newline for easier reading; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:32:09 +00:00
Bruno Cardoso Lopes
6bf5b2b094 [AsmPrinter] Access pointers to globals via pcrel GOT entries
Front-ends could use global unnamed_addr to hold pointers to other
symbols, like @gotequivalent below:

@foo = global i32 42
@gotequivalent = private unnamed_addr constant i32* @foo

@delta = global i32 trunc (i64 sub (i64 ptrtoint (i32** @gotequivalent to i64),
                                    i64 ptrtoint (i32* @delta to i64))
                           to i32)

The global @delta holds a data "PC"-relative offset to @gotequivalent,
an unnamed pointer to @foo. The darwin/x86-64 assembly output for this follows:

 .globl  _foo
_foo:
 .long   42

 .globl  _gotequivalent
_gotequivalent:
 .quad   _foo

 .globl  _delta
_delta:
 .long   _gotequivalent-_delta

Since unnamed_addr indicates that the address is not significant, only
the content, we can optimize the case above by replacing pc-relative
accesses to "GOT equivalent" globals, by a PC relative access to the GOT
entry of the final symbol instead. Therefore, "delta" can contain a pc
relative relocation to foo's GOT entry and we avoid the emission of
"gotequivalent", yielding the assembly code below:

 .globl  _foo
_foo:
 .long   42

 .globl  _delta
_delta:
 .long   _foo@GOTPCREL+4

There are a couple of advantages of doing this: (1) Front-ends that need
to emit a great deal of data to store pointers to external symbols could
save space by not emitting such "got equivalent" globals and (2) IR
constructs combined with this opt opens a way to represent GOT pcrel
relocations by using the LLVM IR, which is something we previously had
no way to express.

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

rdar://problem/18534217

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:26:18 +00:00
Andrew Kaylor
5b7c499806 Removing unused private field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230259 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 21:03:30 +00:00
Andrew Kaylor
338d982b83 Second attempt to fix WinEHCatchDirector build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230257 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 20:44:34 +00:00
Andrew Kaylor
df9618c51f Attempting to fix WinEHCatchDirector destructor related build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230252 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 20:19:15 +00:00
Andrew Kaylor
1d10231766 Remap frame variables for native Windows exception handling.
Differential Revision: http://reviews.llvm.org/D7770



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230249 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 20:01:56 +00:00
Bruno Cardoso Lopes
ee7b509aa3 Revert "[X86][MMX] Add MMX instructions to foldable tables"
This reverts commit r230226 since it breaks win buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230248 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:53:37 +00:00
Chad Rosier
9659f43f10 Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""
This reverts commit r230240, which was an accidental commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230246 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:34:04 +00:00
Eric Christopher
308458a98b Rewrite the global merge pass to be subprogram agnostic for now.
It was previously using the subtarget to get values for the global
offset without actually checking each function as it was generating
code. Go ahead and solidify the current behavior and make the
existing FIXMEs more prominent.

As a note the ARM backend previously had a thumb1 and non-thumb1
set of defaults. Only the former was tested so I've changed the
behavior to only use that for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230245 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:28:45 +00:00
Chad Rosier
6229219f7e Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity.
This patch adds the isProfitableToHoist API.  For AArch64, we want to prevent a
fmul from being hoisted in cases where it is more profitable to form a
fmsub/fmadd.

Phabricator Review: http://reviews.llvm.org/D7299
Patch by Lawrence Hu <lawrence@codeaurora.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230241 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:15:16 +00:00
Chad Rosier
3986322604 Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit 247aed4710.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230240 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 19:15:08 +00:00
Mehdi Amini
2bd4b63e7a InstSimplify: simplify 0 / X if nnan and nsz
From: Fiona Glaser <fglaser@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230238 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 18:30:25 +00:00
Daniel Sanders
b50b4e2d36 [mips] Honour -mno-odd-spreg for vector insert/extract when MSA is enabled.
Summary:
-mno-odd-spreg prohibits the use of odd-numbered single-precision floating
point registers. However, vector insert/extract was still using them when
manipulating the subregisters of an MSA register. Fixed this by ensuring
that insertion/extraction is only performed on even-numbered vector
registers when -mno-odd-spreg is given.

Reviewers: vmedic, sstankovic

Reviewed By: sstankovic

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 17:22:16 +00:00
Bob Wilson
5820b51546 Fix incorrect immediate size for AddrModeT2_i8s4 in rewriteT2FrameIndex.
The natural way to handle this addressing mode would be to say that it has
8 bits and gets scaled by 4, but since the MC layer is expecting the scaling
to be already reflected in the immediate value, we have been setting the
Scale to 1. That's fine, but then NumBits needs to be adjusted to reflect
the effective increase in the range of the immediate. That adjustment was
missing.

The consequence is that the register scavenger can fail.
The estimateRSStackSizeLimit() function in ARMFrameLowering.cpp correctly
assumes that the AddrModeT2_i8s4 address mode can handle scaled offsets up to
1020. Under just the right circumstances, we fail to reserve space for the
scavenger because it thinks that nothing will be needed. However, the overly
pessimistic behavior in rewriteT2FrameIndex causes some frame indexes to be
out of range and require scavenged registers, and so the scavenger asserts.

Unfortunately I have not been able to come up with a testcase for this. I
can only reproduce it on an internal branch where the frame layout and
register allocation is slightly different than trunk. We really need a
way to serialize MachineInstr-level IR to write reasonable tests for things
like this.

rdar://problem/19909005

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230233 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 16:57:19 +00:00
Benjamin Kramer
42f72e2c16 Sync the __builtin_expects for our 3 quadratically probed hash table implementations.
This assumes that
  a) finding the bucket containing the value is LIKELY
  b) finding an empty bucket is LIKELY
  c) growing the table is UNLIKELY

I also switched the a) and b) cases for SmallPtrSet as we seem to use
the set mostly more for insertion than for checking existence.

In a simple benchmark consisting of 2^21 insertions of 2^20 unique
pointers into a DenseMap or SmallPtrSet a few percent speedup on average,
but nothing statistically significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 16:41:36 +00:00
Bruno Cardoso Lopes
77d2363908 [X86][MMX] Add MMX instructions to foldable tables
Teach the peephole optimizer to work with MMX instructions by adding
entries into the foldable tables. This covers folding opportunities not
handled during isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 15:23:22 +00:00
Bruno Cardoso Lopes
c606f3a3cb [X86][MMX] Support folding loads in psll, psrl and psra intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230225 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 15:23:14 +00:00
Elena Demikhovsky
fdafc8fd5e AVX-512: recommitted 229837 + bugfix + test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 15:12:31 +00:00
Elena Demikhovsky
d8e5adcd92 restructured X86 scalar unary operation templates
I made the templates general, no need to define pattern separately for each instruction/intrinsic.
Now only need to add r_Int pattern for AVX.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230221 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 14:14:02 +00:00
David Majnemer
749c0292c1 AsmParser: Check ConstantExpr insertvalue operands for type correctness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 07:13:52 +00:00
Zachary Turner
4ad658d8f1 [llvm-pdbdump] Very minor code cleanup.
This just removes some dead enums as well as some debug flushes
of stdout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 05:59:14 +00:00
Zachary Turner
92d755ea65 [llvm-pdbdump] Add an option to dump full class definitions.
This adds the --class-definitions flag.  If specified, when dumping
types, instead of "class Foo" you will see the full class definition,
with member functions, constructors, access specifiers.

NOTE: Using this option can be very slow, as generating a full class
definition requires accessing many different parts of the PDB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 05:58:34 +00:00
David Majnemer
dad44db24c AsmParser: Call instructions can't have an alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-23 00:01:32 +00:00
David Majnemer
15cf92437a AsmParser: Check ConstantExpr GEP operands for validity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 23:14:52 +00:00
Zachary Turner
395adf9f89 [llvm-pdbdump] Rewrite dumper using visitor pattern.
This increases the flexibility of how to dump different
symbol types -- necessary for context-sensitive formatting of
symbol types -- and also improves the modularity by allowing
the dumping to be implemented in the actual dumper, as opposed
to in the PDB library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 22:03:38 +00:00
Zachary Turner
e759e99a67 [llvm-pdbdump] Simplify options and output.
This removes a wealth of options, and instead now only provides
three options.  -symbols, -types, and -compilands.  This greatly
simplifies use of the tool, and makes it easier to understand
what you're going to see when you run the tool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230182 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 21:45:38 +00:00
David Blaikie
5606ca9edd Roll condition into an assert then wrap it 'ifndef NDEBUG' to protect from the inevitable "unused variable" warning in a non-asserts build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 20:58:38 +00:00
JF Bastien
8c253f7e88 Use common parse routine to read alignment values from bitcode
While fuzzing LLVM bitcode files, I discovered that (1) the bitcode reader doesn't check that alignments are no larger than 2**29; (2) downstream code doesn't check the range; and (3) for values out of range, corresponding large memory requests (based on alignment size) will fail. This code fixes the bitcode reader to check for valid alignments, fixing this problem.

This CL fixes alignment value on global variables, functions, and instructions: alloca, load, load atomic, store, store atomic.

Patch by Karl Schimpf (kschimpf@google.com).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 19:32:03 +00:00
Hal Finkel
67f22b7af9 [LICM] Refactor to expose functionality as utility functions
This refactors the core functionality of LICM: HoistRegion, SinkRegion and
PromoteAliasSet (renamed to promoteLoopAccessesToScalars) as utility functions
in LoopUtils. This will enable other transformations to make use of them
directly.

Patch by Ashutosh Nema.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 18:35:32 +00:00
Simon Pilgrim
66c960350c [DagCombiner] Generalized BuildVector Vector Concatenation
The CONCAT_VECTORS combiner pass can transform the concat of two BUILD_VECTOR nodes into a single BUILD_VECTOR node.

This patch generalises this to support any number of BUILD_VECTOR nodes, and also permits UNDEF nodes to be included as well.

This was noticed as AVX vec128 -> vec256 canonicalization sometimes creates a CONCAT_VECTOR with a real vec128 lower and an vec128 UNDEF upper.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 18:17:28 +00:00
Hal Finkel
0e8abfa6ed [DAGCombine] Don't assume integer-type legailty in reduceBuildVecConvertToConvertBuildVec
DAGCombine will rewrite an BUILD_VECTOR where all non-undef inputs some from
[US]INT_TO_FP, as a BUILD_VECTOR of integers with the conversion applied as a
vector operation. We check operation legality of the conversion, but fail to
check legality of the integer vector type itself. Because targets don't
normally override operation legality defaults for illegal types, we need to
check this also.

This came up in the context of the QPX vector entensions for PowerPC (which can
have legal floating-point vector types without corresponding legal integer
vector types). No in-tree test case for this yes, but one can be added once
the QPX support has been committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 16:10:22 +00:00
Hal Finkel
1584f114c1 [SDAG] Use correct alignments on expanded vector trunc-store/ext-loads
When expanding a truncating store or extending load using vector extracts or
inserts and scalar stores and loads, we were giving each of these scalar stores
or loads the same alignment as the original vector operation. While this will
often be right (most vector operations, especially those produced by
autovectorization, have the alignment of the underlying scalar type), the
vector operation could certainly have a larger alignment.

No test case (yet); noticed by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230175 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 15:58:04 +00:00
NAKAMURA Takumi
d40ce7ac2b Fix a warning on HexagonMCCodeEmitter::MCII. [-Wunused-private-field]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 09:58:29 +00:00
NAKAMURA Takumi
2aabd71b8a RewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 09:58:19 +00:00
NAKAMURA Takumi
572d35cc19 RewriteStatepointsForGC.cpp: Fix for -Asserts. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 09:58:13 +00:00
NAKAMURA Takumi
9c2a703d7c LowerBitSets.cpp: Prune incorrect \param(s). [-Wdocumentation]
\param should be used as itemized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 09:51:42 +00:00
Craig Topper
f9c1605d56 [X86] Add some missing redundant MMX and SSE encodings for disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 07:50:41 +00:00
David Majnemer
ff7a64eb3a COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sections
The CodeView debug info section, .debug$S, also has this set.  MinGW
sets this bit for their DWARF sections as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 02:35:27 +00:00
David Majnemer
f68ceb2e58 COFF: Consistently format the DWARF sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 02:35:22 +00:00
Lang Hames
5ce69d8c40 [Orc] Remove redundant using directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 01:48:23 +00:00
Lang Hames
a2184e96e6 [Orc] Add header comment to IndirectionUtils.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230153 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-22 01:45:31 +00:00
Sanjoy Das
b9b88bd77b IRCE: generalize InductiveRangeCheck::computeSafeIterationSpace to
work with a non-canonical induction variable.

This is currently a non-functional change because we only ever call
computeSafeIterationSpace on a canonical induction variable; but the
generalization will be useful in a later commit.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230151 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 22:20:22 +00:00
Sanjoy Das
c5e1132ac2 IRCE: use SCEVs instead of llvm::Value's for intermediate
calculations.  Semantically non-functional change.

This gets rid of some of the SCEV -> Value -> SCEV round tripping and
the Construct(SMin|SMax)Of and MaybeSimplify helper routines.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230150 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 22:07:32 +00:00
Matt Arsenault
29f97a6c46 R600/SI: Use v_madmk_f32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 21:29:10 +00:00
Matt Arsenault
c490f78e53 R600/SI: Try to use v_madak_f32
This is a code size optimization when the constant
only has one use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 21:29:07 +00:00
Matt Arsenault
9036390498 R600/SI: Don't crash when getting immediate operand size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 21:29:04 +00:00
Matt Arsenault
dc9d5dcdd7 R600/SI: Fix mad*k definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230146 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 21:29:00 +00:00
Lang Hames
8d353ae157 [Orc] Move Orc code into a namespace (llvm::orc), update Kaleidoscope code.
NFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 20:44:36 +00:00
Benjamin Kramer
59d81dbafb MachineInstr: Use range-based for loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 17:08:08 +00:00
Benjamin Kramer
7efcb3338c Calling memmove on a MachineOperand is totally safe.
While it's not POD due to the user-defined constructor, it's still a trivially
copyable type. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 16:22:48 +00:00
Benjamin Kramer
2b17108064 Remove dead prototype.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 14:35:00 +00:00
Benjamin Kramer
edf99a5e3f X86: Remove custom lowering of SIGN_EXTEND_INREG
This was just replicating logic from the legalizer. Covered by existing
tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 14:31:29 +00:00
Eric Christopher
9abdfd0170 Unconditionally create a new MCInstrInfo in the asm printer for
asm parsing since it's not subtarget dependent and we can't depend
upon the one hanging off the MachineFunction's subtarget still
being around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 09:09:15 +00:00
Eric Christopher
9494699d5e Remove obsolete comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230134 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 08:48:23 +00:00
Eric Christopher
113747defd Have the MipsAsmPrinter fp stub emission code take a custom
MCSubtargetInfo as the MachineFunction has gone away and we need
to emit code at the module level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230133 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 08:48:22 +00:00
Eric Christopher
68992caa2e Turn an if+llvm_unreachable into an assert and reword comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 08:32:38 +00:00
Eric Christopher
3a389c6950 Endianness can be gotten from the DataLayout which we already
have. Also, the subtarget is invalid at this point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230131 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 08:32:22 +00:00
David Majnemer
164db1c6b9 X86: Call __main using the SelectionDAG
Synthesizing a call directly using the MI layer would confuse the frame
lowering code.  This is problematic as frame lowering is highly
sensitive the particularities of calls, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230129 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 05:49:45 +00:00
Shankar Easwaran
5872174fd8 [obj2yaml/yaml2obj] Add SHT_GROUP support.
This adds section group support to the tools obj2yaml and yaml2obj.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 04:28:26 +00:00
Davide Italiano
a983427f67 Small cleanup. Don't use else when not needed.
Pointed out by David Majnemer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:36:54 +00:00
Tim Northover
ca7e0787f0 CodeGen: convert CCState interface to using ArrayRefs
Everyone except R600 was manually passing the length of a static array
at each callsite, calculated in a variety of interesting ways. Far
easier to let ArrayRef handle that.

There should be no functional change, but out of tree targets may have
to tweak their calls as with these examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230118 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 02:11:17 +00:00
David Majnemer
e95985d3a0 Win64: Stack alignment constraints aren't applied during SET_FPREG
Stack realignment occurs after the prolog, not during, for Win64.
Because of this, don't factor in the maximum stack alignment when
establishing a frame pointer.

This fixes PR22572.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 01:04:47 +00:00
Duncan P. N. Exon Smith
9f8d4037a6 AsmParser/Writer: Handle symbolic constants in DI 'flags:'
Parse (and write) symbolic constants in debug info `flags:` fields.
This prevents a readability (and CHECK-ability) regression with the new
debug info hierarchy.

Old (well, current) assembly, with pretty-printing:

    !{!"...\\0016387", ...} ; ... [public] [rvalue reference]

Flags field without this change:

   !MDDerivedType(flags: 16387, ...)

Flags field with this change:

   !MDDerivedType(flags: DIFlagPublic | DIFlagRValueReference, ...)

As discussed in the review thread, this isn't a final state.  Most of
these flags correspond to `DW_AT_` symbolic constants, and we might
eventually want to support arbitrary attributes in some form.  However,
as it stands now, some of the flags correspond to other concepts (like
`FlagStaticMember`); until things are refactored this is the simplest
way to move forward without regressing assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 01:02:18 +00:00
Duncan P. N. Exon Smith
8629ae24e7 IR: Add helper to split debug info flags bitfield
Split debug info 'flags' bitfield over a vector so the current flags can
be iterated over.  This API (in combination with r230107) will be used
for assembly support for symbolic constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 00:45:26 +00:00
Duncan P. N. Exon Smith
2e19fabc26 IR: Add debug info flag string conversions
Add `DIDescriptor::getFlag(StringRef)` and
`DIDescriptor::getFlagString(unsigned)`.  The latter only converts exact
matches; I'll add separate API for breaking the flags bitfield up into
parts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230107 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 00:43:09 +00:00
Duncan P. N. Exon Smith
8ab90d412e AsmParser: Use StringRef for keyword comparisons, NFC
Leverage `StringRef` inside keyword comparison macros.  There's no
reason to be so low-level here, and I'm about to add another
`startswith()` use, so let's make it easy to read.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230100 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 00:18:40 +00:00
Philip Reames
7a62a2a5ae [PlaceSafepoints] Adjust enablement logic to default to off and be GC configurable per GC
Previously, this pass ran over every function in the Module if added to the pass order.  With this change, it runs only over those with a GC attribute where the GC explicitly opts in.  A GC can also choose which of entry safepoint polls, backedge safepoint polls, and call safepoints it wants.  I hope to get these exposed as checks on the GCStrategy at some point, but for now, the checks are manual string comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-21 00:09:09 +00:00
Duncan P. N. Exon Smith
efcb266311 AsmParser: Use do{}while(false) in macros, NFC
`do { ... } while (false)` is standard macro etiquette for forcing
instantiations into a single statement and requiring a `;` afterwards,
making statement-like macros easier to reason about (and harder to use
incorrectly).

I'm about to modify the macros in `LexIdentifier()`.  I noticed that the
`KEYWORD` macro *does* follow the rule, so I thought I'd clean up the
other macros to match (otherwise might not be worth changing, since the
benefits of this pattern are fairly irrelevant here).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 23:49:24 +00:00
David Blaikie
74c45a19e3 Remove some unnecessary unreachables in favor of (sometimes implicit) assertions
Also simplify some else-after-return cases including some standard
algorithm convenience/use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 23:44:24 +00:00
Matthias Braun
b2c6bf6776 LiveRangeCalc: Don't start liveranges of PHI instruction at the block begin.
Summary:
Letting them begin at the PHI instruction slightly simplifies the code
but more importantly avoids breaking the assumption that live ranges
starting at the block begin are also live at the end of the predecessor
blocks. The MachineVerifier checks that but was apparently never run in
the few instances where liveranges are calculated for machine-SSA
functions.

Reviewers: qcolombet

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230093 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 23:43:14 +00:00
Philip Reames
f2122f73fe Hide a bunch of advanced testing options in default opt --help output
These are internal options.  I need to go through, evaluate which are worth keeping and which not.  Many of them should probably be renamed as well.  Until I have time to do that, we can at least stop poluting the standard opt -help output.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 23:32:03 +00:00
Rafael Espindola
c093973970 Use short names for jumptable sections.
Also refactor code to remove some duplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20 23:28:28 +00:00