oota-llvm.git
9 years ago[X86][SSE] Added SSE fp stack folding tests.
Simon Pilgrim [Tue, 20 Jan 2015 23:50:18 +0000 (23:50 +0000)]
[X86][SSE] Added SSE fp stack folding tests.

Some folding patterns + tests are missing (marked as TODO) - these will be added in a future patch for review.

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

9 years ago[X86][AVX] Renamed AVX1 fp stack folding tests. NFC.
Simon Pilgrim [Tue, 20 Jan 2015 23:45:50 +0000 (23:45 +0000)]
[X86][AVX] Renamed AVX1 fp stack folding tests. NFC.

The SSE42 version of the AVX1 float stack folding tests will be added shortly, this renames the AVX1 file so that the files will be near each other in a directory listing to help ensure they are kept in sync.

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

9 years ago[PM] Separate the InstCombiner from its pass.
Chandler Carruth [Tue, 20 Jan 2015 22:44:35 +0000 (22:44 +0000)]
[PM] Separate the InstCombiner from its pass.

This creates a small internal pass which runs the InstCombiner over
a function. This is the hard part of porting InstCombine to the new pass
manager, as at this point none of the code in InstCombine has access to
a Pass object any longer.

The resulting interface for the InstCombiner is pretty terrible. I'm not
planning on leaving it that way. The key thing missing is that we need
to separate the worklist from the combiner a touch more. Once that's
done, it should be possible for *any* part of LLVM to just create
a worklist with instructions, populate it, and then combine it until
empty. The pass will just be the (obvious and important) special case of
doing that for an entire function body.

For now, this is the first increment of factoring to make all of this
work.

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

9 years agoDebugLocs without a scope should fail the verification.
Adrian Prantl [Tue, 20 Jan 2015 22:37:25 +0000 (22:37 +0000)]
DebugLocs without a scope should fail the verification.
Follow-up to r226588.

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

9 years agoDon't pass -Wl,z,defs for now.
Rafael Espindola [Tue, 20 Jan 2015 22:08:20 +0000 (22:08 +0000)]
Don't pass -Wl,z,defs for now.

It broke the msan build.

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

9 years agoFor llvm-objdump, hook up existing options to work when using -macho (the Mach-O...
Kevin Enderby [Tue, 20 Jan 2015 21:47:46 +0000 (21:47 +0000)]
For llvm-objdump, hook up existing options to work when using -macho (the Mach-O parser).

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

9 years agoUse -Wl,defs when linking.
Rafael Espindola [Tue, 20 Jan 2015 21:23:15 +0000 (21:23 +0000)]
Use -Wl,defs when linking.

ELF linkers by default allow shared libraries to contain undefined references
and it is up to the dynamic linker to look for them.

On COFF and MachO, that is not the case.

This creates a situation where a .so might build on an ELF system, but the build
of the corresponding .dylib or .dll will fail.

This patch changes the cmake build to use -Wl,-z,defs when linking and updates
the dependencies so that -DBUILD_SHARED_LIBS=ON build still works.

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

9 years ago[PM] Reformat this code with clang-format so that subsequent changes
Chandler Carruth [Tue, 20 Jan 2015 21:10:35 +0000 (21:10 +0000)]
[PM] Reformat this code with clang-format so that subsequent changes
don't get muddied up by formatting changes.

Some of these don't really seem like improvements to me, but they also
don't seem any worse and I care much more about not formatting them
manually than I do about the particular formatting. =]

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

9 years ago[Hexagon] Adding intrinsics for doubleword ALU operations.
Colin LeMahieu [Tue, 20 Jan 2015 20:45:05 +0000 (20:45 +0000)]
[Hexagon] Adding intrinsics for doubleword ALU operations.

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

9 years ago[Hexagon] Removing unnecessary clutter in intrinsic tests.
Colin LeMahieu [Tue, 20 Jan 2015 19:46:07 +0000 (19:46 +0000)]
[Hexagon] Removing unnecessary clutter in intrinsic tests.

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

9 years agoPrevent binary-tree deterioration in sparse switch statements.
Daniel Jasper [Tue, 20 Jan 2015 19:43:33 +0000 (19:43 +0000)]
Prevent binary-tree deterioration in sparse switch statements.

This addresses part of llvm.org/PR22262. Specifically, it prevents
considering the densities of sub-ranges that have fewer than
TLI.getMinimumJumpTableEntries() elements. Those densities won't help
jump tables.

This is not a complete solution but works around the most pressing
issue.

Review: http://reviews.llvm.org/D7070

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

9 years ago[GC] Verify-pass void vararg functions in gc.statepoint
Ramkumar Ramachandra [Tue, 20 Jan 2015 19:42:46 +0000 (19:42 +0000)]
[GC] Verify-pass void vararg functions in gc.statepoint

With the appropriate Verifier changes, exactracting the result out of a
statepoint wrapping a vararg function crashes. However, a void vararg
function works fine: commit this first step.

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

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

9 years agoReapply: Teach SROA how to update debug info for fragmented variables.
Adrian Prantl [Tue, 20 Jan 2015 19:42:22 +0000 (19:42 +0000)]
Reapply: Teach SROA how to update debug info for fragmented variables.
This reapplies r225379.

ChangeLog:
- The assertion that this commit previously ran into about the inability
  to handle indirect variables has since been removed and the backend
  can handle this now.
- Testcases were upgrade to the new MDLocation format.
- Instead of keeping a DebugDeclares map, we now use
  llvm::FindAllocaDbgDeclare().

Original commit message follows.

Debug info: Teach SROA how to update debug info for fragmented variables.
This allows us to generate debug info for extremely advanced code such as

 typedef struct { long int a; int b;} S;

 int foo(S s) {
   return s.b;
 }

which at -O1 on x86_64 is codegen'd into

 define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 {
   ret i32 %s.coerce1, !dbg !24
 }

with this patch we emit the following debug info for this

 TAG_formal_parameter [3]
   AT_location( 0x00000000
                0x0000000000000000 - 0x0000000000000006: rdi, piece 0x00000008, rsi, piece 0x00000004
                0x0000000000000006 - 0x0000000000000008: rdi, piece 0x00000008, rax, piece 0x00000004 )
                AT_name( "s" )
                AT_decl_file( "/Volumes/Data/llvm/_build.ninja.release/test.c" )

Thanks to chandlerc, dblaikie, and echristo for their feedback on all
previous iterations of this patch!

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

9 years agoR600/SI: Add subtarget feature to enable VGPR spilling for all shader types
Tom Stellard [Tue, 20 Jan 2015 19:33:04 +0000 (19:33 +0000)]
R600/SI: Add subtarget feature to enable VGPR spilling for all shader types

This is disabled by default, but can be enabled with the subtarget
feature: 'vgpr-spilling'

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

9 years agoR600/SI: Fix simple-loop.ll test
Tom Stellard [Tue, 20 Jan 2015 19:33:02 +0000 (19:33 +0000)]
R600/SI: Fix simple-loop.ll test

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

9 years agoReverted revision 226577.
Jozef Kolek [Tue, 20 Jan 2015 19:29:28 +0000 (19:29 +0000)]
Reverted revision 226577.

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

9 years ago[PM] Clean up a bunch of the doxygen / API docs on the InstCombiner pass
Chandler Carruth [Tue, 20 Jan 2015 19:27:58 +0000 (19:27 +0000)]
[PM] Clean up a bunch of the doxygen / API docs on the InstCombiner pass
prior to refactoring it.

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

9 years ago[llvm link] Destroy ConstantArrays in LLVMContext if they are not used.
Manman Ren [Tue, 20 Jan 2015 19:24:59 +0000 (19:24 +0000)]
[llvm link] Destroy ConstantArrays in LLVMContext if they are not used.

ConstantArrays constructed during linking can cause quadratic memory
explosion. An example is the ConstantArrays constructed when linking in
GlobalVariables with appending linkage.

Releasing all unused constants can cause a 20% LTO compile-time
slowdown for a large application. So this commit releases unused ConstantArrays
only.

rdar://19040716. It reduces memory footprint from 20+G to 6+G.

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

9 years agoR600/SI: Remove stray debugging code from r226586
Tom Stellard [Tue, 20 Jan 2015 19:24:31 +0000 (19:24 +0000)]
R600/SI: Remove stray debugging code from r226586

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

9 years ago[PM] Don't spend time making self moves no-ops. They're allowed to leave
Chandler Carruth [Tue, 20 Jan 2015 18:54:16 +0000 (18:54 +0000)]
[PM] Don't spend time making self moves no-ops. They're allowed to leave
the object in a moved-from state, and its simpler to write the code that
way.

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

9 years agoAdd an assertion and prefer a crash over an infinite loop.
Adrian Prantl [Tue, 20 Jan 2015 18:03:37 +0000 (18:03 +0000)]
Add an assertion and prefer a crash over an infinite loop.

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

9 years agoR600/SI: Use external symbols for scratch buffer
Tom Stellard [Tue, 20 Jan 2015 17:49:47 +0000 (17:49 +0000)]
R600/SI: Use external symbols for scratch buffer

We were passing the scratch buffer address to the shaders via user sgprs,
but now we use external symbols and have the driver patch the shader
using reloc information.

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

9 years agoR600/SI: Add kill flag when copying scratch offset to a register
Tom Stellard [Tue, 20 Jan 2015 17:49:45 +0000 (17:49 +0000)]
R600/SI: Add kill flag when copying scratch offset to a register

This allows us to re-use the same register for the scratch offset
when accessing large private arrays.

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

9 years agoR600/SI: Don't store scratch buffer frame index in MUBUF offset field
Tom Stellard [Tue, 20 Jan 2015 17:49:43 +0000 (17:49 +0000)]
R600/SI: Don't store scratch buffer frame index in MUBUF offset field

We don't have a good way of legalizing this if the frame index offset
is more than the 12-bits, which is size of MUBUF's offset field, so
now we store the frame index in the vaddr field.

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

9 years agoR600/SI: Update SIInstrInfo:verifyInstruction() after r225662
Tom Stellard [Tue, 20 Jan 2015 17:49:41 +0000 (17:49 +0000)]
R600/SI: Update SIInstrInfo:verifyInstruction() after r225662

Now that we have our own custom register operand types, we need
to handle them in the verifiier.

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

9 years agoSilencing a -Wunused-variable warning in non-asserts builds; NFC.
Aaron Ballman [Tue, 20 Jan 2015 17:10:45 +0000 (17:10 +0000)]
Silencing a -Wunused-variable warning in non-asserts builds; NFC.

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

9 years agoRevert "IR: Specify underlying type instead of r226570, NFC"
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 17:04:56 +0000 (17:04 +0000)]
Revert "IR: Specify underlying type instead of r226570, NFC"

This reverts commit r226571.  GCC really doesn't like it [1].

[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20260

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

9 years ago[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B
Jozef Kolek [Tue, 20 Jan 2015 16:45:27 +0000 (16:45 +0000)]
[mips][microMIPS] MicroMIPS 16-bit unconditional branch instruction B

Implement microMIPS 16-bit unconditional branch instruction B.

Implemented 16-bit microMIPS unconditional instruction has real name B16, and
B is an alias which expands to either B16 or BEQ according to the rules:
b 256 --> b16 256 # R_MICROMIPS_PC10_S1
b 12256 --> beq $zero, $zero, 12256 # R_MICROMIPS_PC16_S1
b label --> beq $zero, $zero, label # R_MICROMIPS_PC16_S1

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

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

9 years ago[mips] Add registers and ALL check prefix to octeon test case.
Kai Nacke [Tue, 20 Jan 2015 16:14:02 +0000 (16:14 +0000)]
[mips] Add registers and ALL check prefix to octeon test case.

No functional change.

Reviewed by D. Sanders

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

9 years ago[mips] Add octeon branch instructions bbit0/bbit032/bbit1/bbit132
Kai Nacke [Tue, 20 Jan 2015 16:10:51 +0000 (16:10 +0000)]
[mips] Add octeon branch instructions bbit0/bbit032/bbit1/bbit132

This commits adds the octeon branch instructions bbit0/bbit032/bbit1/bbit132.
It also includes patterns for instruction selection and test cases.

Reviewed by D. Sanders

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

9 years agoIR: Specify underlying type instead of r226570, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 16:03:09 +0000 (16:03 +0000)]
IR: Specify underlying type instead of r226570, NFC

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

9 years agoIR: Store StorageType as an unsigned bitfield
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 15:51:14 +0000 (15:51 +0000)]
IR: Store StorageType as an unsigned bitfield

Use `unsigned` instead of `StorageType` for the bitfield to prevent MSVC
from treating the top bit of the bitfield as a sign bit.

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

9 years ago[msan] Optimize -msan-check-constant-shadow.
Evgeniy Stepanov [Tue, 20 Jan 2015 15:21:35 +0000 (15:21 +0000)]
[msan] Optimize -msan-check-constant-shadow.

The new code does not create new basic blocks in the case when shadow is a
compile-time constant; it generates either an unconditional __msan_warning
call or nothing instead.

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

9 years ago[MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS
Mohit K. Bhakkad [Tue, 20 Jan 2015 13:05:42 +0000 (13:05 +0000)]
[MSan][LLVM][MIPS] Shadow and Origin offsets for MIPS

Reviewers: kcc, samsonov, petarj, eugenis

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

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

9 years ago[x86] Add some mayLoad/hasSideEffects flags. Remove one that was already covered...
Craig Topper [Tue, 20 Jan 2015 12:15:30 +0000 (12:15 +0000)]
[x86] Add some mayLoad/hasSideEffects flags. Remove one that was already covered by a pattern.

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

9 years ago[PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis
Chandler Carruth [Tue, 20 Jan 2015 10:58:50 +0000 (10:58 +0000)]
[PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis
pass and a LoopPrinterPass with the expected associated wiring.

I've added a RUN line to the only test case (!!!) we have that actually
prints loops. Everything seems to be working.

This is somewhat exciting as this is the first analysis using another
analysis to go in for the new pass manager. =D I also believe it is the
last analysis necessary for porting instcombine, but of course I may yet
discover more.

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

9 years ago[PM] Make the LoopInfoBase and LoopInfo objects movable so that they can
Chandler Carruth [Tue, 20 Jan 2015 10:58:38 +0000 (10:58 +0000)]
[PM] Make the LoopInfoBase and LoopInfo objects movable so that they can
be used as results in the new pass manager.

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

9 years ago[PM] Fix a moderately scary typo in the deleted copy constructor
Chandler Carruth [Tue, 20 Jan 2015 10:20:52 +0000 (10:20 +0000)]
[PM] Fix a moderately scary typo in the deleted copy constructor
I noticed when adding move semantics to LoopInfo.

Hopefully not relevant, but still scary. =]

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

9 years ago[PM] Use range-based for and auto to clean up some of the LoopInfo code.
Chandler Carruth [Tue, 20 Jan 2015 10:02:49 +0000 (10:02 +0000)]
[PM] Use range-based for and auto to clean up some of the LoopInfo code.

No functionality changed.

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

9 years agoFactor out a splitSwitchCase() function so that it can be reused.
Daniel Jasper [Tue, 20 Jan 2015 08:57:44 +0000 (08:57 +0000)]
Factor out a splitSwitchCase() function so that it can be reused.

This is in preparation for a fix to llvm.org/PR22262. One of the ideas
here is to first find a good jump table range first and then split
before and after it. Thereby, we don't need to use the
split-based-on-density heuristic at all, which can make the "binary
tree" deteriorate in various cases.

Also some minor cleanups.

No functional changes.

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

9 years ago[PM] Move the LoopInfo analysis pointer into the InstCombiner class
Chandler Carruth [Tue, 20 Jan 2015 08:35:24 +0000 (08:35 +0000)]
[PM] Move the LoopInfo analysis pointer into the InstCombiner class
along with the other analyses.

The most obvious reason why is because eventually I need to separate out
the pass layer from the rest of the instcombiner. However, it is also
probably a compile time win as every query through the pass manager
layer is pretty slow these days.

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

9 years agoFix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
Karthik Bhat [Tue, 20 Jan 2015 06:11:00 +0000 (06:11 +0000)]
Fix Operandreorder logic in SLPVectorizer to generate longer vectorizable chain.
This patch fixes 2 issues in reorderInputsAccordingToOpcode
1) AllSameOpcodeLeft and AllSameOpcodeRight was being calculated incorrectly resulting in code not being vectorized in few cases.
2) Adds logic to reorder operands if we get longer chain of consecutive loads enabling vectorization. Handled the same for cases were we have AltOpcode.
Thanks Michael for inputs and review.
Review: http://reviews.llvm.org/D6677

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

9 years agoBitcode: Don't create comdats when autoupgrading macho bitcode
David Majnemer [Tue, 20 Jan 2015 05:58:07 +0000 (05:58 +0000)]
Bitcode: Don't create comdats when autoupgrading macho bitcode

Don't infer COMDAT groups from older bitcode if the target is macho,
it doesn't have COMDATs.

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

9 years agoReapply "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 05:02:42 +0000 (05:02 +0000)]
Reapply "IR: Simplify DIBuilder's HeaderBuilder API, NFC"

This reverts commit r226542, effectively reapplying r226540.  This time,
initialize `IsEmpty` in the copy and move constructors as well.

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

9 years agoRevert "IR: Simplify DIBuilder's HeaderBuilder API, NFC"
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 03:01:27 +0000 (03:01 +0000)]
Revert "IR: Simplify DIBuilder's HeaderBuilder API, NFC"

This reverts commit r226540, since I hit an unexpected bot failure [1].
I'll investigate.

[1]: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/20244

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

9 years agoIR: Move MDNode clone() methods from ValueMapper to MDNode, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:56:57 +0000 (02:56 +0000)]
IR: Move MDNode clone() methods from ValueMapper to MDNode, NFC

Now that the clone methods used by `MapMetadata()` don't do any
remapping (and return a temporary), they make more sense as member
functions on `MDNode` (and subclasses).

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

9 years agoIR: Simplify DIBuilder's HeaderBuilder API, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:54:07 +0000 (02:54 +0000)]
IR: Simplify DIBuilder's HeaderBuilder API, NFC

Change `HeaderBuilder` API to work well even when it's not starting with
a tag.  There's already one case like this, and the tag is moving
elsewhere as part of PR22235.

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

9 years agoAsmParser: PARSE_MD_FIELD() => ParseMDField(), NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:42:29 +0000 (02:42 +0000)]
AsmParser: PARSE_MD_FIELD() => ParseMDField(), NFC

Extract most of `PARSE_MD_FIELD()` into a function.

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

9 years agoAsmParser: Refactor duplicate code, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 02:39:21 +0000 (02:39 +0000)]
AsmParser: Refactor duplicate code, NFC

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

9 years ago[PM] Replace the Pass argument in MergeBasicBlockIntoOnlyPred with
Chandler Carruth [Tue, 20 Jan 2015 01:37:09 +0000 (01:37 +0000)]
[PM] Replace the Pass argument in MergeBasicBlockIntoOnlyPred with
a DominatorTree argument as that is the analysis that it wants to
update.

This removes the last non-loop utility function in Utils/ which accepts
a raw Pass argument.

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

9 years agoIR: Delete GenericDwarfNode during teardown
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 01:18:32 +0000 (01:18 +0000)]
IR: Delete GenericDwarfNode during teardown

Fix a leak in `LLVMContextImpl` teardown that the leak sanitizer tracked
down [1].  I've just switched to automatic dispatch here (since I'll
inevitably forget again with the next class).

[1]: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/811/steps/check-llvm%20asan/logs/stdio

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

9 years agoBitcode: Simplify MDNode subclass dispatch, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 01:03:09 +0000 (01:03 +0000)]
Bitcode: Simplify MDNode subclass dispatch, NFC

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

9 years agoBitcode: WriteMDNode() => WriteMDTuple(), NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 01:01:53 +0000 (01:01 +0000)]
Bitcode: WriteMDNode() => WriteMDTuple(), NFC

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

9 years agoBitcode: Add ValueEnumerator::getMetadataOrNullID(), NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 01:00:23 +0000 (01:00 +0000)]
Bitcode: Add ValueEnumerator::getMetadataOrNullID(), NFC

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

9 years agoIR: Canonicalize GenericDwarfNode empty headers to null
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 00:58:46 +0000 (00:58 +0000)]
IR: Canonicalize GenericDwarfNode empty headers to null

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

9 years agoIR: Detect whether to call recalculateHash() via SFINAE, NFC
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 00:57:33 +0000 (00:57 +0000)]
IR: Detect whether to call recalculateHash() via SFINAE, NFC

Rather than relying on updating switch statements correctly, detect
whether `setHash()` exists in the subclass.  If so, call
`recalculateHash()` and `setHash(0)` appropriately.

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

9 years agoIR: Introduce GenericDwarfNode
Duncan P. N. Exon Smith [Tue, 20 Jan 2015 00:01:43 +0000 (00:01 +0000)]
IR: Introduce GenericDwarfNode

As part of PR22235, introduce `DwarfNode` and `GenericDwarfNode`.  The
former is a metadata node with a DWARF tag.  The latter matches our
current (generic) schema of a header with string (and stringified
integer) data and an arbitrary number of operands.

This doesn't move it into place yet; that change will require a large
number of testcase updates.

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

9 years agoAsmParser: Abstract more of MDLocation parser, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:44:41 +0000 (23:44 +0000)]
AsmParser: Abstract more of MDLocation parser, NFC

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

9 years agoAsmParser: Split up ParseMDFieldsImpl(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:39:32 +0000 (23:39 +0000)]
AsmParser: Split up ParseMDFieldsImpl(), NFC

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

9 years ago[dsymutil] Add the detected target triple to the debug map.
Frederic Riss [Mon, 19 Jan 2015 23:33:14 +0000 (23:33 +0000)]
[dsymutil] Add the detected target triple to the debug map.

It will be needed to instantiate the Target object that we will
use to create all the MC objects for the dwarf emission.

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

9 years agoAsmParser: Fix error location for missing fields
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:32:36 +0000 (23:32 +0000)]
AsmParser: Fix error location for missing fields

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

9 years agoIR: Cleanup MDNode field use, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:18:34 +0000 (23:18 +0000)]
IR: Cleanup MDNode field use, NFC

Swap usage of `SubclassData32` and `MDNodeSubclassData`, and rename
`MDNodeSubclassData` to `NumUnresolved`.  Small drive-by cleanup to
`countUnresolvedOperands()` since otherwise the name clash with local
vars named `NumUnresolved` would be confusing.

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

9 years agoIR: Move replaceWithUniqued(), etc., to source file, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:17:09 +0000 (23:17 +0000)]
IR: Move replaceWithUniqued(), etc., to source file, NFC

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

9 years agoIR: Cleanup MDNode::MDNode(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:15:21 +0000 (23:15 +0000)]
IR: Cleanup MDNode::MDNode(), NFC

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

9 years agoIR: Merge UniquableMDNode back into MDNode, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 23:13:14 +0000 (23:13 +0000)]
IR: Merge UniquableMDNode back into MDNode, NFC

As pointed out in r226501, the distinction between `MDNode` and
`UniquableMDNode` is confusing.  When we need subclasses of `MDNode`
that don't use all its functionality it might make sense to break it
apart again, but until then this makes the code clearer.

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

9 years agoIR: Extract MDNodeOpsKey, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:53:18 +0000 (22:53 +0000)]
IR: Extract MDNodeOpsKey, NFC

Make the MDTuple operand hashing logic reusable.

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

9 years agoIR: Simplify uniquifyImpl(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:52:07 +0000 (22:52 +0000)]
IR: Simplify uniquifyImpl(), NFC

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

9 years agoIR: Simplify erasing from uniquing store, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:47:08 +0000 (22:47 +0000)]
IR: Simplify erasing from uniquing store, NFC

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

9 years agoRemove dead code, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:45:41 +0000 (22:45 +0000)]
Remove dead code, NFC

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

9 years agoUtils: Simplify MapMetadata(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:44:32 +0000 (22:44 +0000)]
Utils: Simplify MapMetadata(), NFC

Extract out the operand remapping loops, which are now very similar.

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

9 years agoSkip upcast, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:41:14 +0000 (22:41 +0000)]
Skip upcast, NFC

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

9 years ago[X86][AVX] Missing AVX1 memory folding float instructions
Simon Pilgrim [Mon, 19 Jan 2015 22:40:45 +0000 (22:40 +0000)]
[X86][AVX] Missing AVX1 memory folding float instructions

Now that we can create much more exhaustive X86 memory folding tests, this patch adds the missing AVX1/F16C floating point instruction stack foldings we can easily test for including the scalar intrinsics (add, div, max, min, mul, sub), conversions float/int to double, half precision conversions, rounding, dot product and bit test. The patch also adds a couple of obviously missing SSE instructions (more to follow once we have full SSE testing).

Now that scalar folding is working it broke a very old test (2006-10-07-ScalarSSEMiscompile.ll) - this test appears to make no sense as its trying to ensure that a scalar subtraction isn't folded as it 'would zero the top elts of the loaded vector' - this test just appears to be wrong to me.

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

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

9 years agoFix whitespace, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:40:25 +0000 (22:40 +0000)]
Fix whitespace, NFC

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

9 years agoUtils: Simplify MapMetadata(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:39:07 +0000 (22:39 +0000)]
Utils: Simplify MapMetadata(), NFC

Take advantage of the new ability of temporary nodes to mutate to
distinct and uniqued nodes to greatly simplify the `MapMetadata()`
helper functions.

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

9 years agoIR: Allow temporary nodes to become uniqued or distinct
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:24:52 +0000 (22:24 +0000)]
IR: Allow temporary nodes to become uniqued or distinct

Add `MDNode::replaceWithUniqued()` and `MDNode::replaceWithDistinct()`,
which mutate temporary nodes to become uniqued or distinct.  On uniquing
collisions, the unique version is returned and the node is deleted.

This takes advantage of temporary nodes being folded back in, and should
let me clean up some awkward logic in `MapMetadata()`.

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

9 years agoIR: Remove templates from TempMDNodeDeleter, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:21:15 +0000 (22:21 +0000)]
IR: Remove templates from TempMDNodeDeleter, NFC

r226504 added `TempMDNodeDeleter` to help with `std::unique_ptr<>`-izing
the `MDNode::getTemporary()` interface.  It doesn't need to be
templated, though.

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

9 years agoIR: Split out countUnresolvedOperands(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:18:29 +0000 (22:18 +0000)]
IR: Split out countUnresolvedOperands(), NFC

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

9 years agoCleanup whitespace, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 22:16:01 +0000 (22:16 +0000)]
Cleanup whitespace, NFC

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

9 years agoIR: Return unique_ptr from MDNode::getTemporary()
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 21:30:18 +0000 (21:30 +0000)]
IR: Return unique_ptr from MDNode::getTemporary()

Change `MDTuple::getTemporary()` and `MDLocation::getTemporary()` to
return (effectively) `std::unique_ptr<T, MDNode::deleteTemporary>`, and
clean up call sites.  (For now, `DIBuilder` call sites just call
`release()` immediately.)

There's an accompanying change in each of clang and polly to use the new
API.

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

9 years agoAdd r224985 back with fixes.
Rafael Espindola [Mon, 19 Jan 2015 21:11:14 +0000 (21:11 +0000)]
Add r224985 back with fixes.

The fixes are to note that AArch64 has additional restrictions on when local
relocations can be used. In particular, ld64 requires that relocations to
cstring/cfstrings use linker visible symbols.

Original message:

In an assembly expression like

bar:
  .long L0 + 1

the intended semantics is that bar will contain a pointer one byte past L0.

In sections that are merged by content (strings, 4 byte constants, etc), a
single position in the section doesn't give the linker enough information.
For example, it would not be able to tell a relocation must point to the
end of a string, since that would look just like the start of the next.

The solution used in ELF to use relocation with symbols if there is a non-zero
addend.

In MachO before this patch we would just keep all symbols in some sections.

This would miss some cases (only cstrings on x86_64 were implemented) and was
inefficient since most relocations have an addend of 0 and can be represented
without the symbol.

This patch implements the non-zero addend logic for MachO too.

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

9 years agoIR: Add MDLocation::getTemporary()
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 20:37:44 +0000 (20:37 +0000)]
IR: Add MDLocation::getTemporary()

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

9 years agoIR: Remove MDNodeFwdDecl
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 20:36:39 +0000 (20:36 +0000)]
IR: Remove MDNodeFwdDecl

Remove `MDNodeFwdDecl` (as promised in r226481).  Aside from API
changes, there's no real functionality change here.
`MDNode::getTemporary()` now forwards to `MDTuple::getTemporary()`,
which returns a tuple with `isTemporary()` equal to true.

The main point is that we can now add temporaries of other `MDNode`
subclasses, needed for PR22235 (I introduced `MDNodeFwdDecl` in the
first place because I didn't recognize this need, and thought they were
only needed to handle forward references).

A few things left out of (or highlighted by) this commit:

  - I've had to remove the (few) uses of `std::unique_ptr<>` to deal
    with temporaries, since the destructor is no longer public.
    `getTemporary()` should probably return the equivalent of
    `std::unique_ptr<T, MDNode::deleteTemporary>`.
  - `MDLocation::getTemporary()` doesn't exist yet (worse, it actually
    does exist, but does the wrong thing: `MDNode::getTemporary()` is
    inherited and returns an `MDTuple`).
  - `MDNode` now only has one subclass, `UniquableMDNode`, and the
    distinction between them is actually somewhat confusing.

I'll fix those up next.

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

9 years ago[Hexagon] Updating muxir/ri/ii intrinsics. Setting predicate registers as compatible...
Colin LeMahieu [Mon, 19 Jan 2015 20:31:18 +0000 (20:31 +0000)]
[Hexagon] Updating muxir/ri/ii intrinsics.  Setting predicate registers as compatible with i32 rather than doing custom type conversion.

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

9 years agoIR: Extract out and reuse `storeImpl()`, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 20:18:13 +0000 (20:18 +0000)]
IR: Extract out and reuse `storeImpl()`, NFC

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

9 years agoIR: Extract out getUniqued(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 20:16:50 +0000 (20:16 +0000)]
IR: Extract out getUniqued(), NFC

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

9 years agoIR: Reuse `getImpl()` for `getDistinct()`, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 20:14:15 +0000 (20:14 +0000)]
IR: Reuse `getImpl()` for `getDistinct()`, NFC

Merge `getDistinct()`'s implementation with those of `get()` and
`getIfExists()` for both `MDTuple` and `MDLocation`.  This will make it
easier to scale to supporting temporaries.

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

9 years agoIR: Move replaceAllUsesWith() back up to MDNode
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:35:21 +0000 (19:35 +0000)]
IR: Move replaceAllUsesWith() back up to MDNode

Move `MDNodeFwdDecl::replaceAllUsesWith()` back up to `MDNode`, but
assert `isTemporary()`.

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

9 years agoIR: Be specific about what MDNode::get() returns, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:32:27 +0000 (19:32 +0000)]
IR: Be specific about what MDNode::get() returns, NFC

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

9 years agoRemove dead code, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:31:09 +0000 (19:31 +0000)]
Remove dead code, NFC

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

9 years agoIR: Simplify MDNode::setOperand(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:29:25 +0000 (19:29 +0000)]
IR: Simplify MDNode::setOperand(), NFC

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

9 years agoIR: Simplify handleChangedOperand() fast path, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:28:28 +0000 (19:28 +0000)]
IR: Simplify handleChangedOperand() fast path, NFC

Use `isUniqued()` instead of `isStoredDistinctInContext()`, and remove
an assertion that won't be valid once temporaries are merged back in.

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

9 years agoIR: Remove direct comparisons against Metadata::Storage, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:26:24 +0000 (19:26 +0000)]
IR: Remove direct comparisons against Metadata::Storage, NFC

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

9 years agoIR: Assert that resolve() is only called on uniqued nodes, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:25:33 +0000 (19:25 +0000)]
IR: Assert that resolve() is only called on uniqued nodes, NFC

Add an assertion in `UniquableMDNode::resolve()` to prevent temporaries
from being resolved (once they're merged back in).  Needed to shuffle
order of `resolve()` and `storeDistinctInContext()` to prevent it from
firing.

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

9 years agoIR: Remove isa<UniquableMDNode>, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:10:14 +0000 (19:10 +0000)]
IR: Remove isa<UniquableMDNode>, NFC

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

9 years agoIR: Simplify DIBuilder::trackIfUnresolved(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:09:14 +0000 (19:09 +0000)]
IR: Simplify DIBuilder::trackIfUnresolved(), NFC

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

9 years agoIR: Remove isa<MDNodeFwdDecl>, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:06:41 +0000 (19:06 +0000)]
IR: Remove isa<MDNodeFwdDecl>, NFC

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

9 years agoIR: Unify code for MDNode::isResolved(), NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:03:18 +0000 (19:03 +0000)]
IR: Unify code for MDNode::isResolved(), NFC

Unify the definitions of `MDNode::isResolved()` and
`UniquableMDNode::isResolved()`.  Previously, `UniquableMDNode` could
answer this question more efficiently, but now that RAUW support has
been unified with `MDNodeFwdDecl`, `MDNode` doesn't need any casts to
figure out the answer.

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

9 years agoIR: Store RAUW support and Context in the same pointer, NFC
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 19:02:06 +0000 (19:02 +0000)]
IR: Store RAUW support and Context in the same pointer, NFC

Add an `LLVMContext &` to `ReplaceableMetadataImpl`, create a class that
either holds a reference to an `LLVMContext` or owns a
`ReplaceableMetadataImpl`, and use the new class in `MDNode`.

  - This saves a pointer in `UniquableMDNode` at the cost of a pointer
    in `ValueAsMetadata` (which didn't used to store the `LLVMContext`).
    There are far more of the former.
  - Unifies RAUW support between `MDNodeFwdDecl` (which is going away,
    see r226481) and `UniquableMDNode`.

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

9 years ago[Hexagon] Converting intrinsics combine imm/imm, simple shifts and extends.
Colin LeMahieu [Mon, 19 Jan 2015 18:56:19 +0000 (18:56 +0000)]
[Hexagon] Converting intrinsics combine imm/imm, simple shifts and extends.

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

9 years agoIR: Add isUniqued() and isTemporary()
Duncan P. N. Exon Smith [Mon, 19 Jan 2015 18:45:35 +0000 (18:45 +0000)]
IR: Add isUniqued() and isTemporary()

Change `MDNode::isDistinct()` to only apply to 'distinct' nodes (not
temporaries), and introduce `MDNode::isUniqued()` and
`MDNode::isTemporary()` for the other two possibilities.

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