Commit Graph

121105 Commits

Author SHA1 Message Date
Dan Gohman
18595a0862 [WebAssembly] Tell TargetTransformInfo about popcnt and sqrt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245853 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 16:51:46 +00:00
Dan Gohman
c723870037 [WebAssembly] Use the checked form of MachineFunction::getSubtarget. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245852 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 16:46:31 +00:00
Dan Gohman
c26771d7ab [WebAssembly] Implement the is_zero_undef forms of cttz and ctlz
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245851 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 16:39:37 +00:00
Adhemerval Zanella
9708c4754d [sanitizers] Add DFSan support for AArch64 42-bit VMA
This patch adds support for dfsan on aarch64-linux with 42-bit VMA
(current default config for 64K pagesize kernels).  The support is
enabled by defining the SANITIZER_AARCH64_VMA to 42 at build time
for both clang/llvm and compiler-rt.  The default VMA is 39 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245840 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 13:48:10 +00:00
Michael Zuckerman
59dfeede45 [X86] Add support for mmword memory operand size for Intel-syntax x86 assembly
Differential Revision: http://reviews.llvm.org/D12151


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245835 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 10:26:54 +00:00
Oliver Stannard
67a54d2081 Add DAG optimisation for FP16_TO_FP
The FP16_TO_FP node only uses the bottom 16 bits of its input, so the
following pattern can be optimised by removing the AND:

  (FP16_TO_FP (AND op, 0xffff)) -> (FP16_TO_FP op)

This is a common pattern for ARM targets when functions have __fp16
arguments, as they are passed as floats (so that they get passed in the
correct registers), but then bitcast and truncated to ignore the top 16
bits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245832 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 09:47:45 +00:00
Scott Douglass
3ad50284cb [ARM] Use AEABI helpers for i64 div and rem
Differential Revision: http://reviews.llvm.org/D12232

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245830 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 09:17:18 +00:00
Scott Douglass
9b11d5f703 [ARM] Refactor LowerDivRem before adding LowerREM (nfc)
Differential Revision: http://reviews.llvm.org/D12230

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245829 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 09:17:11 +00:00
Michael Zuckerman
7b854fda4a first commit to llvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-24 07:48:50 +00:00
Mehdi Amini
59537e6802 Require Dominator Tree For SROA, improve compile-time
TL-DR: SROA is followed by EarlyCSE which requires the DominatorTree.
There is no reason not to require it up-front for SROA.

Some history is necessary to understand why we ended-up here.

r123437 switched the second (Legacy)SROA in the optimizer pipeline to
use SSAUpdater in order to avoid recomputing the costly
DominanceFrontier. The purpose was to speed-up the compile-time.

Later r123609 removed the need for the DominanceFrontier in
(Legacy)SROA.

Right after, some cleanup was made in r123724 to remove any reference
to the DominanceFrontier. SROA existed in two flavors: SROA_SSAUp and
SROA_DT (the latter replacing SROA_DF).
The second argument of `createScalarReplAggregatesPass` was renamed
from `UseDomFrontier` to `UseDomTree`.
I believe this is were a mistake was made. The pipeline was not
updated and the call site was still:
    PM->add(createScalarReplAggregatesPass(-1, false));

At that time, SROA was immediately followed in the pipeline by
EarlyCSE which required alread the DominatorTree. Not requiring
the DominatorTree in SROA didn't save anything, but unfortunately
it was lost at this point.

When the new SROA Pass was introduced in r163965, I believe the goal
was to have an exact replacement of the existing SROA, this bug
slipped through.

You can see currently:

$ echo "" | clang -x c++  -O3 -c - -mllvm -debug-pass=Structure
...
...
      FunctionPass Manager
        SROA
        Dominator Tree Construction
        Early CSE

After this patch:

$ echo "" | clang -x c++  -O3 -c - -mllvm -debug-pass=Structure
...
...
      FunctionPass Manager
        Dominator Tree Construction
        SROA
        Early CSE

This improves the compile time from 88s to 23s for PR17855.
https://llvm.org/bugs/show_bug.cgi?id=17855

And from 113s to 12s for PR16756
https://llvm.org/bugs/show_bug.cgi?id=16756

Reviewers: chandlerc

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245820 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 22:15:49 +00:00
Sanjay Patel
1730292302 remove FIXME; fixed by r245733
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245819 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 20:43:25 +00:00
David Majnemer
a354cd3ea5 [IR] Cleanup EH instructions a little bit
Just a cosmetic change, no functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245818 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 19:22:31 +00:00
Simon Pilgrim
7b7cb4251e [DAGCombiner] Fold CONCAT_VECTORS of bitcasted EXTRACT_SUBVECTOR
Minor generalization of D12125 - peek through any bitcast to the original vector that we're extracting from.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245814 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 15:22:14 +00:00
Davide Italiano
a99b964662 [llvm-readobj/ELF] Factor out common code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245813 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 14:06:40 +00:00
Frederic Riss
d2681e8812 [dwarfdump] Do not apply relocations in mach-o files if there is no LoadedObjectInfo.
Not only do we not need to do anything to read correct values from the
object files, but the current logic actually wrongly applies twice the
section base address when there is no LoadedObjectInfo passed to the
DWARFContext creation (as the added test shows).

Simply do not apply any relocations on the mach-o debug info if there is
no load offset to apply.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 04:44:21 +00:00
Frederic Riss
8f7e8462cd [dsymutil] Remove old ODR uniquing tests
These tests have been obsoleted by the refactored versions introduced
in the previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245804 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 02:38:37 +00:00
Frederic Riss
b7e7dd4975 [dsymutil] Refactor ODR uniquing tests to be more readable.
This patch adds all the refactored tests in new files, the old
tests will be removed by a followup commit.

Thanks to D. Blaikie for all the feedback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245803 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 02:38:29 +00:00
Joseph Tremoulet
50cbfe2c19 [LangRef] Fix sphinx warning
Fix invalid inline literal introduced in r245797



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245801 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 01:04:12 +00:00
Mehdi Amini
221b8cc736 Add missing break in AArch64DAGToDAGISel::Select() switch case
Reported by coverity.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245800 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 00:42:57 +00:00
Mehdi Amini
939b388b46 Do not use dyn_cast<> after isa<>
Reported by coverity.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 00:27:57 +00:00
Joseph Tremoulet
d4a765f88a [WinEH] Require token linkage in EH pad/ret signatures
Summary:
WinEHPrepare is going to require that cleanuppad and catchpad produce values
of token type which are consumed by any cleanupret or catchret exiting the
pad.  This change updates the signatures of those operators to require/enforce
that the type produced by the pads is token type and that the rets have an
appropriate argument.

The catchpad argument of a `CatchReturnInst` must be a `CatchPadInst` (and
similarly for `CleanupReturnInst`/`CleanupPadInst`).  To accommodate that
restriction, this change adds a notion of an operator constraint to both
LLParser and BitcodeReader, allowing appropriate sentinels to be constructed
for forward references and appropriate error messages to be emitted for
illegal inputs.

Also add a verifier rule (noted in LangRef) that a catchpad with a catchpad
predecessor must have no other predecessors; this ensures that WinEHPrepare
will see the expected linear relationship between sibling catches on the
same try.

Lastly, remove some superfluous/vestigial casts from instruction operand
setters operating on BasicBlocks.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245797 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-23 00:26:33 +00:00
David Blaikie
8647351e06 Update test case so it passes the verifier
Some debug info was drastically out of date, from the days where we used
to emit a list of length one (with a single null entry) rather than an
empty list (or, more recently, no list at all) for list fields that have
no elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245796 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 22:38:44 +00:00
David Blaikie
bfddc41d9c Verifier: Don't crash on null entries in debug info retained types list
There was already a good error path for this. Added a test for it & made
a minor code change to ensure the error path was actually reached,
rather than crashing before we got that far.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245795 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 22:36:40 +00:00
Davide Italiano
18fecd3d45 [llvm-readobj] Test --macho-data-in-code option.
As added bonus this converts an existing test from macho-dump to 
llvm-readobj. Only 66 to go.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 20:30:56 +00:00
Jingyue Wu
8724a428df [NVPTX] Allow undef value as global initializer
Summary:
__shared__ variable may now emit undef value as initializer, do not
throw error on that.

Test Plan: test/CodeGen/NVPTX/global-addrspace.ll

Patch by Xuetian Weng

Reviewers: jholewinski, tra, jingyue

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 05:40:26 +00:00
NAKAMURA Takumi
fcaa24c56d [CMake] add_llvm_external_project: Just warn about nonexistent directories.
These entries were generated accidentally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245783 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 05:11:02 +00:00
NAKAMURA Takumi
44c617819c [CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites.
If corresponding in-tree subdirectory exists, just ignore LLVM_EXTERNAL* stuff.
Otherwise, set LLVM_TOOL_*_BUILD ON/OFF properly according to LLVM_EXTERNAL_*.

This makes easier to walk among old revisions *without* deleteing CMakeCache.txt.

Before r242059, LLVM_EXTERNAL_* was working like;

  if(EXISTS ${*_SOURCE_DIR}/CMakeLists.txt)
    set(*_BUILD ON CACHE)
    if(*_BUILD is ON)
      add_subdirectory(*_SOURCE_DIR)
    endif()
  endif()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245782 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 04:53:52 +00:00
Peter Collingbourne
c0346c0fdc LTO: Maintain target triple, FeatureStr and CGOptLevel in the module or LTOCodeGenerator.
This makes it easier to create new TargetMachines on demand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245781 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 02:25:53 +00:00
Matt Arsenault
19110099c0 AMDGPU: Allow specifying different opcode on VI for SMRD/SMEM
Although the basic s_load_* instructions happen to use the same
opcode, some of the special case SMRD instructions have
different opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245775 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 00:54:31 +00:00
Matt Arsenault
e48caeb48f AMDGPU: Improve accuracy of instruction rates for some FP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245774 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 00:50:41 +00:00
Matt Arsenault
ac03979a67 AMDGPU: Use DFS to avoid second loop over function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245772 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 00:43:38 +00:00
Matt Arsenault
60b173f7cb AMDGPU: Make sure to run verifier after SIFixSGPRLiveRanges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245769 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 00:19:34 +00:00
Matt Arsenault
ffa2da0cfa AMDGPU: Improve debug printing in SIFixSGPRLiveRanges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245768 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 00:19:25 +00:00
Matt Arsenault
ffd72ef643 AMDGPU: Move CI instructions into CIInstructions.td
There are still a couple of CI patterns left in SIInstructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245767 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-22 00:16:34 +00:00
Matt Arsenault
fbb7ef0f36 AMDGPU: Minor cleanups to help with f16 support
The main change is inverting the condition for the
operand class classes so that VT.Size == 16 uses VGPR_32
instead of 64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245764 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 23:49:51 +00:00
JF Bastien
51be368e3f Improve the determinism of MergeFunctions
Summary:

Merge functions previously relied on unsigned comparisons of pointer values to
order functions. This caused observable non-determinism in the compiler for
large bitcode programs. Basically, opt -mergefuncs program.bc | md5sum produces
different hashes when run repeatedly on the same machine. Differing output was
observed on three large bitcodes, but it was less frequent on the smallest file.
It is possible that this only manifests on the large inputs, hence remaining
undetected until now.

This patch fixes this by removing (almost, see below) all places where
comparisons between pointers are used to order functions. Most of these changes
are local, but the comparison of global values requires assigning an identifier
to each local in the order it is visited. This is very similar to the way the
comparison function identifies Value*'s defined within a function. Because the
order of visiting the functions and their subparts is deterministic, the
identifiers assigned to the globals will be as well, and the order of functions
will be deterministic.

With these changes, there is no more observed non-determinism. There is also
only minor slowdowns (negligible to 4%) compared to the baseline, which is
likely a result of the fact that global comparisons involve hash lookups and not
just pointer comparisons.

The one caveat so far is that programs containing BlockAddress constants can
still be non-deterministic. It is not clear what the right solution is here. In
particular, even if the global numbers are used to order by function, we still
need a way to order the BasicBlock*'s. Unfortunately, we cannot just bail out
and fail to order the functions or consider them equal, because we require a
total order over functions. Note that programs with BlockAddress constants are
relatively rare, so the impact of leaving this in is minor as long as this pass
is opt-in.

Author: jrkoenig

Reviewers: nlewycky, jfb, dschuff

Subscribers: jevinskie, llvm-commits, chapuni

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245762 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 23:27:24 +00:00
Adam Nemet
d4fd5e5000 [LAA] Hold bounds via ValueHandles during SCEV expansion
SCEV expansion can invalidate previously expanded values.  For example
in SCEVExpander::ReuseOrCreateCast, if we already have the requested
cast value but it's not at the desired location, a new cast is inserted
and the old cast will be invalidated.

Therefore, when expanding the bounds for the pointers, a later entry can
invalidate the IR value for an earlier one.  The fix is to store a value
handle rather than the value itself.

The newly added test has a more detailed description of how the bug
triggers.

This bug can have a negative but potentially highly variable performance
impact in Loop Distribution.  Because one of the bound values was
invalidated and is an undef expression now, InstCombine is free to
transform the array overlap check:

   Start0 <= End1 && Start1 <= End0

into:

   Start0 <= End1

So depending on the runtime location of the arrays, we would detect a
conflict and fall back on the original loop of the versioned loop.

Also tested compile time with SPEC2006 LTO bc files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245760 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 23:19:57 +00:00
Tyler Nowicki
23d9019965 Standardized 'failed' to 'Failed' in LoopVectorizationRequirements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245759 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 23:03:24 +00:00
Alex Lorenz
0f92e21216 MIRLangRef: Add 'MIR Testing Guide' section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245757 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 22:58:33 +00:00
Peter Collingbourne
aa7ad072c9 LTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a Reloc::Model.
This allows us to remove a bunch of code in LTOCodeGenerator and llvm-lto
and has the side effect of improving error handling in the libLTO C API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 22:57:17 +00:00
Tom Stellard
7d43ecc4d4 AMDGPU/SI: Better handle s_wait insertion
We can wait on either VM, EXP or LGKM.
The waits are independent.

Without this patch, a wait inserted because of one of them
would also wait for all the previous others.
This patch makes s_wait only wait for the ones we need for the next
instruction.

Here's an example of subtle perf reduction this patch solves:

This is without the patch:

buffer_load_format_xyzw v[8:11], v0, s[44:47], 0 idxen
buffer_load_format_xyzw v[12:15], v0, s[48:51], 0 idxen
s_load_dwordx4 s[44:47], s[8:9], 0xc
s_waitcnt lgkmcnt(0)
buffer_load_format_xyzw v[16:19], v0, s[52:55], 0 idxen
s_load_dwordx4 s[48:51], s[8:9], 0x10
s_waitcnt vmcnt(1)
buffer_load_format_xyzw v[20:23], v0, s[44:47], 0 idxen

The s_waitcnt vmcnt(1) is useless.
The reason it is added is because the last
buffer_load_format_xyzw needs s[44:47], which was issued
by the first s_load_dwordx4. It waits for all VM
before that call to have finished.

Internally after every instruction, 3 counters (for VM, EXP and LGTM)
are updated after every instruction. For example buffer_load_format_xyzw
will
increase the VM counter, and s_load_dwordx4 the LGKM one.

Without the patch, for every defined register,
the current 3 counters are stored, and are used to know
how long to wait when an instruction needs the register.

Because of that, the s[44:47] counter includes that to use the register
you need to wait for the previous buffer_load_format_xyzw.

Instead this patch stores only the counters that matter for the
register,
and puts zero for the other ones, since we don't need any wait for them.

Patch by: Axel Davy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245755 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 22:47:27 +00:00
Sanjoy Das
6e45bd9223 Re-apply r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0"
The original checkin was buggy, this change has a fix.

Original commit message:

[InstCombine] Transform A & (L - 1) u< L --> L != 0

Summary:

This transform is never a pessimization at the IR level (since it
replaces an `icmp` with another), and has potentiall payoffs:

 1. It may make the `icmp` fold away or become loop invariant.
 2. It may make the `A & (L - 1)` computation dead.

This shows up in Java, in range checks generated by array accesses of
the form `a[i & (a.length - 1)]`.

Reviewers: reames, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245753 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 22:22:37 +00:00
David Blaikie
f47cf2495d Range-for-ify some things in GlobalMerge
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245752 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 22:19:06 +00:00
David Blaikie
f60104e676 [opaque pointer types] Fix a few easy places in GlobalMerge that were accessing value types through pointee types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 22:00:44 +00:00
Alex Lorenz
c7804ab6e5 MIR Serialization: Serialize the pointer IR expression values in the machine
memory operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:54:12 +00:00
Vedant Kumar
6636b6292b [ARM] Fix MachO CPU Subtype selection
Differential Revision: http://reviews.llvm.org/D12040

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245744 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:52:48 +00:00
Alex Lorenz
81c4090757 MIRParser: Split the 'parseIRConstant' method into two methods. NFC.
One variant of this method can be reused when parsing the quoted IR pointer
expressions in the machine memory operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:48:22 +00:00
David Blaikie
7b1f1048e8 [opaque pointer types] Push the passing of value types up from Function/GlobalVariable to GlobalObject
(coming next, pushing this up into GlobalValue, so it can store the
value type directly)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245742 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:35:28 +00:00
Hal Finkel
4294df4ceb [PowerPC] PPCVSXFMAMutate should not segfault on undef input registers
When PPCVSXFMAMutate would look at the input addend register, it would get its
input value number. This would fail, however, if the register was undef,
causing a segfault. Don't segfault (just skip such FMA instructions).

Fixes the test case from PR24542 (although that may have been over-reduced).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245741 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:34:24 +00:00
Alex Lorenz
0e99876efe AsmParser: Save and restore the parsing state for types using SlotMapping.
This commit extends the 'SlotMapping' structure and includes mappings for named
and numbered types in it. The LLParser is extended accordingly to fill out
those mappings at the end of module parsing.

This information is useful when we want to parse standalone constant values
at a later stage using the 'parseConstantValue' method. The constant values
can be constant expressions, which can contain references to types. In order
to parse such constant values, we have to restore the internal named and
numbered mappings for the types in LLParser, otherwise the parser will report
a parsing error. Therefore, this commit also introduces a new method called
'restoreParsingState' to LLParser, which uses the slot mappings to restore
some of its internal parsing state.

This commit is required to serialize constant value pointers in the machine
memory operands for the MIR format.

Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245740 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 21:32:39 +00:00