Adrian Prantl [Fri, 26 Jun 2015 23:31:27 +0000 (23:31 +0000)]
Debug Info: Fix a bug in the DW_AT_bit_offset calculation that would
result in negative offsets and attempt a better job at documenting
the algorithm.
rdar://
21082998
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240853
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 26 Jun 2015 23:18:44 +0000 (23:18 +0000)]
CodeGen: Create a proper ModuleSlotTracker for MachineInstr
Another follow-up related to r240848: try a little harder to share slot
tracking calculations within a single `MachineInstr` dump. This is
unrelated to `MachineFunction::print()`, since that should be passing
through the function's `ModuleSlotTracker` by now, but could affect the
speed of dumping from a debugger if there is more than one IR-level
operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240852
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 26 Jun 2015 22:56:48 +0000 (22:56 +0000)]
MIR Serialization: Serialize global address machine operands.
This commit serializes the global address machine operands.
This commit doesn't serialize the operand's offset and target
flags, it serializes only the global value reference.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10671
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240851
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 26 Jun 2015 22:47:37 +0000 (22:47 +0000)]
[RewriteStatepointsForGC] Generalized vector phi/select handling for base pointers
This change extends the detection of base pointers for vector constructs to handle arbitrary phi and select nodes. The existing non-vector code already handles those, so this is basically just extending the vector special case to be less special cased. It still isn't generalized vector handling since we can't handle arbitrary vector instructions (e.g. shufflevectors), but it's a lot closer.
The general structure of the change is as follows:
* Extend the base defining value relation over a subset of vector instructions and vector typed phi & select instructions.
* Move scalarization from before base pointer rewriting to after base pointer rewriting. The extension of the BDV relation is sufficient to find vector base phis for vector inputs.
* Preserve the existing special case logic for when the base of a vector element is locally obvious. This general idea could be extended to the scalar case as well.
Differential Revision: http://reviews.llvm.org/D10461#inline-84275
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240850
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 26 Jun 2015 22:35:43 +0000 (22:35 +0000)]
[NVPTX] noop when kernel pointers are already global
Summary:
Some front ends make kernel pointers global already. In that case,
handlePointerParams does nothing.
Test Plan: more tests in lower-kernel-ptr-arg.ll
Reviewers: grosser
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D10779
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240849
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 26 Jun 2015 22:28:47 +0000 (22:28 +0000)]
CodeGen: Push the ModuleSlotTracker through Metadata
For another 1% speedup on the testcase in PR23865, push the
`ModuleSlotTracker` through to metadata-related printing in
`MachineBasicBlock::print()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240848
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 26 Jun 2015 22:21:52 +0000 (22:21 +0000)]
Minor style cleanup after 240843 [NFC]
Use a for-each loop in one case and rename the function to reflect it's new usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240847
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 26 Jun 2015 22:06:47 +0000 (22:06 +0000)]
CodeGen: Push the ModuleSlotTracker through MachineOperands
Push `ModuleSlotTracker` through `MachineOperand`s, dropping the time
for `llc -print-machineinstrs` on the testcase in PR23865 from ~13
seconds to ~9 seconds. Now `SlotTracker::processFunctionMetadata()`
accounts for only 8% of the runtime, which seems reasonable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240845
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 26 Jun 2015 22:04:34 +0000 (22:04 +0000)]
[Verifier] Follow on to 240836
Address one missed review comment and do the rename I left out of that patch to make it reviewable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240843
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 26 Jun 2015 22:04:20 +0000 (22:04 +0000)]
CodeGen: Use a single SlotTracker in MachineFunction::print()
Expose enough of the IR-level `SlotTracker` so that
`MachineFunction::print()` can use a single one for printing
`BasicBlock`s. Next step would be to lift this through a few more APIs
so that we can make other print methods faster.
Fixes PR23865, changing the runtime of `llc -print-machineinstrs` from
many minutes (killed after 3 minutes, but it wasn't very close) to
13 seconds for a 502185 line dump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240842
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:58:42 +0000 (21:58 +0000)]
AMDPGU/SI: Use correct resource descriptors for VI on HSA
Summary: We need to set MTYPE = 2 for VI shaders when targeting the HSA runtime.
Reviewers: arsenm
Differential Revision: http://reviews.llvm.org/D10777
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240841
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:58:31 +0000 (21:58 +0000)]
AMDGPU/SI: Update amd_kernel_code_t definition and add assembler support
Reviewers: arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10772
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240839
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:58:26 +0000 (21:58 +0000)]
AMDGPU/SI: Remove unused variable
This should fix some bots that were broken by r240831.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240838
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 26 Jun 2015 21:39:44 +0000 (21:39 +0000)]
[Verifier] Verify invokes of intrinsics
We support invoking a subset of llvm's intrinsics, but the verifier didn't account for this. We had previously added a special case to verify invokes of statepoints. By generalizing the code in terms of CallSite, we can verify invokes of other intrinsics as well. Interestingly, this found one test case which was invalid.
Note: I'm deliberately leaving the naming change from CI to CS to a follow up change. That will happen shortly, I just wanted to reduce the diff to make it clear what was happening with this one.
Differential Revision: http://reviews.llvm.org/D10118
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240836
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 26 Jun 2015 21:27:30 +0000 (21:27 +0000)]
Debug Info: Clarify the documentation for bitfields emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240835
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 26 Jun 2015 21:27:16 +0000 (21:27 +0000)]
Debug info: Add more test coverage for bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240834
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:15:11 +0000 (21:15 +0000)]
AMDGPU/SI: Set ELF OS/ABI to ELFOSABI_AMDGPU_HSA
Reviewers: arsenm, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10708
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240832
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:15:07 +0000 (21:15 +0000)]
AMDGPU/SI: Add hsa code object directives
Reviewers: arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10757
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240831
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:15:03 +0000 (21:15 +0000)]
AMDGPU/SI: There are no implicit kernel args in the amdhsa ABI
Reviewers: arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10706
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240830
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 26 Jun 2015 21:14:58 +0000 (21:14 +0000)]
AMDGPU/SI: Emit amd_kernel_code_t in EmitFunctionBodyStart()
Summary:
This way the function symbol points to the start of amd_kernel_code_t
rather than the start of the function.
Reviewers: arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10705
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240829
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 26 Jun 2015 20:51:17 +0000 (20:51 +0000)]
Teach InlineCost to account for a null check which can be folded away
If we have a caller that knows a particular argument can never be null, we can exploit this fact while simplifying values in the inline cost analysis. This has the effect of reducing the cost for inlining when a null check is present in the callee, but the value is known non null in the caller. In particular, any dependent control flow can be discounted from the cost estimate.
Note that we use the parameter attributes at the call site to memoize the analysis within the caller's code. The setting of this attribute is done in InstCombine, the inline cost analysis just consumes it. This is intentional and important because we want the inline cost analysis results to be easily cachable themselves. We're not currently doing so, but initial results on LTO indicate this will quickly become important.
Differential Revision: http://reviews.llvm.org/D9129
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240828
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 26 Jun 2015 20:44:16 +0000 (20:44 +0000)]
DataLayout now returns a const ref to its member string representation
There was no particular reason to return by value in the first place.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240826
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Fri, 26 Jun 2015 20:29:10 +0000 (20:29 +0000)]
AMDGPU: really don't commute REV opcodes if the target variant doesn't exist
If pseudoToMCOpcode failed, we would return the original opcode, so operands
would be swapped, but the instruction would remain the same.
It resulted in LSHLREV a, b ---> LSHLREV b, a.
This fixes Glamor text rendering and
piglit/arb_sample_shading-builtin-gl-sample-mask on VI.
This is a candidate for stable branches.
v2: the test was simplified by Tom Stellard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240824
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Jun 2015 20:16:44 +0000 (20:16 +0000)]
Add Value.def to the list of textual includes, excluding it from the modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240823
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 26 Jun 2015 19:37:02 +0000 (19:37 +0000)]
Convert a bunch of loops to foreach. NFC.
This uses the new SDNode::op_values() iterator range committed in r240805.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240822
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Fri, 26 Jun 2015 19:26:53 +0000 (19:26 +0000)]
Add missing builtins to the PPC back end for ABI compliance (vol. 1)
This patch corresponds to review:
http://reviews.llvm.org/D10638
This is the back end portion of patch
http://reviews.llvm.org/D10637
It just adds the code gen and intrinsic functions necessary to support that patch to the back end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240820
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 26 Jun 2015 19:23:20 +0000 (19:23 +0000)]
Wrap assert loops in #ifndef NDEBUG
The body of the loops here only contained asserts. This triggered an unused variable
warning on release builds and -Werror on the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240819
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 26 Jun 2015 19:18:49 +0000 (19:18 +0000)]
Convert a bunch of loops to foreach. NFC.
This uses the new SDNode::op_values() iterator range committed in r240805.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240817
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 26 Jun 2015 19:08:33 +0000 (19:08 +0000)]
Convert a bunch of loops to foreach. NFC.
This uses the new SDNode::op_values() iterator range committed in r240805.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240815
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Jun 2015 19:04:11 +0000 (19:04 +0000)]
Make header parse standalone. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240814
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 26 Jun 2015 19:00:11 +0000 (19:00 +0000)]
Show invariant loads in MMO dumping
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240813
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 26 Jun 2015 18:55:48 +0000 (18:55 +0000)]
Revert "Revert r240762 "[X86] Cleanup X86WindowsTargetObjectFile::getSectionForConstant""
This reverts commit r240793 while fixing how we handle array constant
pool entries.
This fixes PR23966.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240811
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 18:42:17 +0000 (18:42 +0000)]
Fix error handling in getString and simplify callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240810
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 26 Jun 2015 18:41:54 +0000 (18:41 +0000)]
Convert a bunch of loops to foreach. NFC.
This uses the new SDNode::op_values() iterator range committed in r240805.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240809
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 18:32:53 +0000 (18:32 +0000)]
Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240807
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 26 Jun 2015 18:17:36 +0000 (18:17 +0000)]
Add op_values() to iterate over the SDValue operands of an SDNode.
SDNode already had ops() which would iterate over the operands and return
SDUse*. This version instead gets the SDValue's out of the SDUse's so that
we can use foreach in more places.
Reviewed by David Blaikie.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240805
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 26 Jun 2015 18:02:52 +0000 (18:02 +0000)]
Move VectorUtils from Transforms to Analysis to correct layering violation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240804
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Fri, 26 Jun 2015 17:42:37 +0000 (17:42 +0000)]
[ARM] Cortex-R5 is not VFPOnlySP
This patch fixes the error in ARM.td which stated that Cortex-R5
floating point unit can do only single precision, when it can do double as well.
Reviewers: rengolin
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10769
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240799
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Fri, 26 Jun 2015 17:25:43 +0000 (17:25 +0000)]
[LAA] Try to prove non-wrapping of pointers if SCEV cannot
Summary:
Scalar evolution does not propagate the non-wrapping flags to values
that are derived from a non-wrapping induction variable because
the non-wrapping property could be flow-sensitive.
This change is a first attempt to establish the non-wrapping property in
some simple cases. The main idea is to look through the operations
defining the pointer. As long as we arrive to a non-wrapping AddRec via
a small chain of non-wrapping instruction, the pointer should not wrap
either.
I believe that this essentially is what Andy described in
http://article.gmane.org/gmane.comp.compilers.llvm.cvs/220731 as the way
forward.
Reviewers: aschwaighofer, nadav, sanjoy, atrick
Reviewed By: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240798
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 26 Jun 2015 17:07:27 +0000 (17:07 +0000)]
Fix unused variable from r240792.
The variable 'I' wasn't used when assertions were disabled.
This commit ensures that 'I' is used outside of an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240797
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Jun 2015 16:59:31 +0000 (16:59 +0000)]
[DAGCombine] Fix demanded bits computation for exact shifts.
Fixes a miscompilation of MultiSource/Benchmarks/MallocBench/gs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240796
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Fri, 26 Jun 2015 16:58:59 +0000 (16:58 +0000)]
[X86]: Correctly sign-extend 16-bit immediate in CALL instruction.
Patch by Matthew Barney. Thanks!
Differential Revision: http://reviews.llvm.org/D9514
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240795
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 26 Jun 2015 16:57:30 +0000 (16:57 +0000)]
Fix ODR violation waiting to happen by making static function definitions in VectorUtils.h non-static and defined out of line
Patch by Ashutosh Nema
Differential Revision: http://reviews.llvm.org/D10682
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240794
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 26 Jun 2015 16:48:02 +0000 (16:48 +0000)]
Revert r240762 "[X86] Cleanup X86WindowsTargetObjectFile::getSectionForConstant"
It seems to have caused PR23966: "UNREACHABLE executed at ..\lib\Target\X86\X86TargetObjectFile.cpp:148"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240793
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 26 Jun 2015 16:46:11 +0000 (16:46 +0000)]
MIR Serialization: Serialize machine basic block operands.
This commit serializes machine basic block operands. The
machine basic block operands use the following syntax:
%bb.<id>[.<name>]
This commit also modifies the YAML representation for the
machine basic blocks - a new, required field 'id' is added
to the MBB YAML mapping.
The id is used to resolve the MBB references to the
actual MBBs. And while the name of the MBB can be
included in a MBB reference, this name isn't used to
resolve MBB references - as it's possible that multiple
MBBs will reference the same BB and thus they will have the
same name. If the name is specified, the parser will verify
that it is equal to the name of the MBB with the specified id.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10608
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240792
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 15:27:04 +0000 (15:27 +0000)]
ELF: Simplify the rel/rela implementation.
Now the rela class inherits from rel and just adds the addend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240790
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Jun 2015 14:51:49 +0000 (14:51 +0000)]
[DAGCombiner] Preserve the exact bit when simplifying SRA to SRL.
Allows more aggressive folding of ashr/shl pairs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240788
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 26 Jun 2015 14:51:36 +0000 (14:51 +0000)]
[DAGCombine] fold (X >>?,exact C1) << C2 --> X << (C2-C1)
Instcombine also does this but many opportunities only become visible
after GEPs are lowered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240787
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 26 Jun 2015 14:51:22 +0000 (14:51 +0000)]
Silencing spurious MSVC C4189 warnings regarding local variables that are initialized but not used; NFC. This bug has been reported to Microsoft (https://connect.microsoft.com/VisualStudio/feedback/details/
1475983).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240786
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 14:51:16 +0000 (14:51 +0000)]
Rename getObjectFile to getObject for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240785
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 14:11:54 +0000 (14:11 +0000)]
Simplify isSymbolList64Bit. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240784
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 13:24:23 +0000 (13:24 +0000)]
Simplify isObject. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240783
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Fri, 26 Jun 2015 13:20:17 +0000 (13:20 +0000)]
[mips] [IAS] Add partial support for the ULW pseudo-instruction.
Summary:
This only adds support for ULW of an immediate address with/without a source register.
It does not include support for ULW of the address of a symbol.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9663
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240782
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 13:11:15 +0000 (13:11 +0000)]
Implement elf_section_iterator and getELFType().
And with those, simplify getSymbolNMTypeChar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240780
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 12:44:10 +0000 (12:44 +0000)]
Expose getFlags via ELFSectionRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240779
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 12:33:37 +0000 (12:33 +0000)]
Add a ELFSectionRef class and use it to expose getSectionType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240778
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 12:18:49 +0000 (12:18 +0000)]
Simplify getSymbolType.
This is still a really odd function. Most calls are in object format specific
contexts and should probably be replaced with a more direct query, but at least
now this is not too obnoxious to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240777
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Fri, 26 Jun 2015 12:14:56 +0000 (12:14 +0000)]
[ARM] Cortex-R4F is not VFPOnlySP
Cortex-R4F TRM states that fpu supports both single and double precision.
This patch corrects the information in ARM.td file and corresponding test.
Reviewers: rengolin
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10763
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240776
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 11:39:57 +0000 (11:39 +0000)]
Make getOther ELF only.
No other format has this field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240774
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 26 Jun 2015 11:31:13 +0000 (11:31 +0000)]
Optimize the creation of mapping symbols.
No need to create two symbols just to assign one to the other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240773
91177308-0d34-0410-b5e6-
96231b3b80d8
Sergey Dmitrouk [Fri, 26 Jun 2015 10:13:56 +0000 (10:13 +0000)]
Do not ignore projects/LLVMBuild.txt in git repo
Without explicit exception for the path, it matches projects/* rule.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240771
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 26 Jun 2015 07:03:12 +0000 (07:03 +0000)]
[X86] Cleanup X86WindowsTargetObjectFile::getSectionForConstant
No functionality changed, just keeping things clean.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240762
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Fri, 26 Jun 2015 04:38:21 +0000 (04:38 +0000)]
[InterleavedAccess] Fix failures "undefined type 'llvm::raw_ostream'" on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240760
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Fri, 26 Jun 2015 02:45:36 +0000 (02:45 +0000)]
[ARM] Lower interleaved memory accesses to vldN/vstN intrinsics.
This patch also adds a function to calculate the cost of interleaved memory accesses.
E.g. Lower an interleaved load:
%wide.vec = load <8 x i32>, <8 x i32>* %ptr, align 4
%v0 = shuffle %wide.vec, undef, <0, 2, 4, 6>
%v1 = shuffle %wide.vec, undef, <1, 3, 5, 7>
into:
%vld2 = { <4 x i32>, <4 x i32> } call llvm.arm.neon.vld2(%ptr, 4)
%vec0 = extractelement { <4 x i32>, <4 x i32> } %vld2, i32 0
%vec1 = extractelement { <4 x i32>, <4 x i32> } %vld2, i32 1
E.g. Lower an interleaved store:
%i.vec = shuffle <8 x i32> %v0, <8 x i32> %v1, <0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11>
store <12 x i32> %i.vec, <12 x i32>* %ptr, align 4
into:
%sub.v0 = shuffle <8 x i32> %v0, <8 x i32> v1, <0, 1, 2, 3>
%sub.v1 = shuffle <8 x i32> %v0, <8 x i32> v1, <4, 5, 6, 7>
%sub.v2 = shuffle <8 x i32> %v0, <8 x i32> v1, <8, 9, 10, 11>
call void llvm.arm.neon.vst3(%ptr, %sub.v0, %sub.v1, %sub.v2, 4)
Differential Revision: http://reviews.llvm.org/D10533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240755
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Fri, 26 Jun 2015 02:32:07 +0000 (02:32 +0000)]
[AArch64] Lower interleaved memory accesses to ldN/stN intrinsics. This patch also adds a function to calculate the cost of interleaved memory accesses.
E.g. Lower an interleaved load:
%wide.vec = load <8 x i32>, <8 x i32>* %ptr
%v0 = shuffle %wide.vec, undef, <0, 2, 4, 6>
%v1 = shuffle %wide.vec, undef, <1, 3, 5, 7>
into:
%ld2 = { <4 x i32>, <4 x i32> } call llvm.aarch64.neon.ld2(%ptr)
%vec0 = extractelement { <4 x i32>, <4 x i32> } %ld2, i32 0
%vec1 = extractelement { <4 x i32>, <4 x i32> } %ld2, i32 1
E.g. Lower an interleaved store:
%i.vec = shuffle <8 x i32> %v0, <8 x i32> %v1, <0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11>
store <12 x i32> %i.vec, <12 x i32>* %ptr
into:
%sub.v0 = shuffle <8 x i32> %v0, <8 x i32> v1, <0, 1, 2, 3>
%sub.v1 = shuffle <8 x i32> %v0, <8 x i32> v1, <4, 5, 6, 7>
%sub.v2 = shuffle <8 x i32> %v0, <8 x i32> v1, <8, 9, 10, 11>
call void llvm.aarch64.neon.st3(%sub.v0, %sub.v1, %sub.v2, %ptr)
Differential Revision: http://reviews.llvm.org/D10533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240754
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Fri, 26 Jun 2015 02:10:27 +0000 (02:10 +0000)]
[InterleavedAccess] Add a pass InterleavedAccess to identify interleaved memory accesses and transform into target specific intrinsics.
E.g. An interleaved load (Factor = 2):
%wide.vec = load <8 x i32>, <8 x i32>* %ptr
%v0 = shuffle <8 x i32> %wide.vec, <8 x i32> undef, <0, 2, 4, 6>
%v1 = shuffle <8 x i32> %wide.vec, <8 x i32> undef, <1, 3, 5, 7>
It can be transformed into a ld2 intrinsic in AArch64 backend or a vld2 intrinsic in ARM backend.
E.g. An interleaved store (Factor = 3):
%i.vec = shuffle <8 x i32> %v0, <8 x i32> %v1, <0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11>
store <12 x i32> %i.vec, <12 x i32>* %ptr
It can be transformed into a st3 intrinsic in AArch64 backend or a vst3 intrinsic in ARM backend.
Differential Revision: http://reviews.llvm.org/D10533
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240751
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 26 Jun 2015 00:53:44 +0000 (00:53 +0000)]
AsmPrinter: More explicitly scope iterator for MSVC
r240748 seems to be on the right path. Be more explicit.
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/1961/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240750
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 26 Jun 2015 00:41:53 +0000 (00:41 +0000)]
AsmPrinter: Explicitly scope iterator for MSVC
Try to placate bots by explicitly scoping a conversion constructor from
`iterator` to `const_iterator`.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/5931/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240748
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 26 Jun 2015 00:26:49 +0000 (00:26 +0000)]
Revert "X86: Reject register operands with obvious type mismatches."
Revert until http://llvm.org/PR23955 is investigated.
This reverts commit r239309.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240746
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 26 Jun 2015 00:26:46 +0000 (00:26 +0000)]
Fix mismatched architectures in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240745
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 26 Jun 2015 00:26:44 +0000 (00:26 +0000)]
aad/fix labels in test/CodeGen/X86/StackColoring.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240744
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 26 Jun 2015 00:00:47 +0000 (00:00 +0000)]
[ASan] Use llvm::getDISubprogram() to get function entry debug location.
It can be more robust than copying debug info from first non-alloca
instruction in the entry basic block. We use the same strategy in
coverage instrumentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240738
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 23:52:10 +0000 (23:52 +0000)]
AsmPrinter: Use an intrusively linked list for DIE::Children
Replace the `std::vector<>` for `DIE::Children` with an intrusively
linked list. This is a strict memory improvement: it requires no
auxiliary storage, and reduces `sizeof(DIE)` by one pointer. It also
factors out the DIE-related malloc traffic.
This drops llc memory usage from 735 MB down to 718 MB, or ~2.3%.
(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240736
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 23:46:41 +0000 (23:46 +0000)]
AsmPrinter: Convert DIE::Values to a linked list
Change `DIE::Values` to a singly linked list, where each node is
allocated on a `BumpPtrAllocator`. In order to support `push_back()`,
the list is circular, and points at the tail element instead of the
head. I abstracted the core list logic out to `IntrusiveBackList` so
that it can be reused for `DIE::Children`, which also cares about
`push_back()`.
This drops llc memory usage from 799 MB down to 735 MB, about 8%.
(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240733
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 25 Jun 2015 23:41:23 +0000 (23:41 +0000)]
[ELF] Move ELF{32,64}{L,B}E typedefs to llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240731
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 25 Jun 2015 23:40:41 +0000 (23:40 +0000)]
[ELF] Add some accessors for lld.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240730
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 25 Jun 2015 23:40:15 +0000 (23:40 +0000)]
Make llvm-dwarfdump exit with non-zero exit code if error was occured.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240729
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 25 Jun 2015 23:38:44 +0000 (23:38 +0000)]
PPCISelLowering.cpp: Appease PR23956. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240727
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 25 Jun 2015 23:38:22 +0000 (23:38 +0000)]
Split test up into two target-spcific directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240726
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 25 Jun 2015 23:35:48 +0000 (23:35 +0000)]
[asan] Do not instrument special purpose LLVM sections.
Do not instrument globals that are placed in sections containing "__llvm"
in their name.
This fixes a bug in ASan / PGO interoperability. ASan interferes with LLVM's
PGO, which places its globals into a special section, which is memcpy-ed by
the linker as a whole. When those goals are instrumented, ASan's memcpy wrapper
reports an issue.
http://reviews.llvm.org/D10541
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240723
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Thu, 25 Jun 2015 23:35:45 +0000 (23:35 +0000)]
[asan] Don't run stack malloc on functions containing inline assembly.
It makes LLVM run out of registers even on 64-bit platforms. For example, the
following test case fails on darwin.
clang -cc1 -O0 -triple x86_64-apple-macosx10.10.0 -emit-obj -fsanitize=address -mstackrealign -o ~/tmp/ex.o -x c ex.c
error: inline assembly requires more registers than available
void TestInlineAssembly(const unsigned char *S, unsigned int pS, unsigned char *D, unsigned int pD, unsigned int h) {
unsigned int sr = 4, pDiffD = pD - 5;
unsigned int pDiffS = (pS << 1) - 5;
char flagSA = ((pS & 15) == 0),
flagDA = ((pD & 15) == 0);
asm volatile (
"mov %0, %%"PTR_REG("si")"\n"
"mov %2, %%"PTR_REG("cx")"\n"
"mov %1, %%"PTR_REG("di")"\n"
"mov %8, %%"PTR_REG("ax")"\n"
:
: "m" (S), "m" (D), "m" (pS), "m" (pDiffS), "m" (pDiffD), "m" (sr), "m" (flagSA), "m" (flagDA), "m" (h)
: "%"PTR_REG("si"), "%"PTR_REG("di"), "%"PTR_REG("ax"), "%"PTR_REG("cx"), "%"PTR_REG("dx"), "memory"
);
}
http://reviews.llvm.org/D10719
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240722
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 25 Jun 2015 23:19:19 +0000 (23:19 +0000)]
Debug Info: Add basic test coverage for the DWARF encoding of bitfields.
While looking at a couple of bugs in the debug info output for bitfields
I noticed that there wasn't a single regression test to test my changes
against, so here's a start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240717
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 25 Jun 2015 22:15:05 +0000 (22:15 +0000)]
DAGCombiner: Use pop_back_val()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240709
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 22:10:04 +0000 (22:10 +0000)]
Add an ELFSymbolRef type.
This allows user code to say Sym.getSize() instead of having to manually fetch
the object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240708
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 25 Jun 2015 21:57:33 +0000 (21:57 +0000)]
IAS: Use the root macro instanciation for location
r224810 fixed the handling of macro debug locations in AsmParser. This patch
fixes the logic to actually do what was intended: it uses the first macro of
the macro stack instead of the last one. The updated testcase shows that the
current scheme doesn't work when macro instanciations are nested and multiple
files are used.
Reviewers: compnerd
Differential Revision: http://reviews.llvm.org/D10463
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240705
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Thu, 25 Jun 2015 21:47:32 +0000 (21:47 +0000)]
[Object][ELF] Add support for dumping dynamic relocations when sections are stripped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240703
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 21:42:46 +0000 (21:42 +0000)]
dsymutil: Split out patchStmtList(), NFC
Split out code to patch up the `DW_AT_stmt_list` for the cloned DIE, and
reorganize it so that it doesn't depend on `DIE::values_begin()` and
`DIE::values_end()` (which I'm trying to kill off).
David Blaikie and I talked about adding a range-algorithm version of
`std::find_if()`, but the assertion *still* required getting at the end
iterator. IMO, a separate helper function with an early return is
easier to reason about here.
A follow-up commit that removes `DIE::setValue()` and mutates the
`DIEValue` directly is coming shortly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240701
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 25 Jun 2015 21:11:08 +0000 (21:11 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240699
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 21:00:51 +0000 (21:00 +0000)]
llvm-nm: Don't print mapping symbols.
This matches the behavior of gnu nm. Fixes pr23930.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240695
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 25 Jun 2015 20:51:38 +0000 (20:51 +0000)]
Use foreach loop over constant operands. NFC.
A number of places had explicit loops over Constant::operands().
Just use foreach loops where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240694
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 20:20:19 +0000 (20:20 +0000)]
We don't need the targets to read objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240684
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Thu, 25 Jun 2015 20:14:47 +0000 (20:14 +0000)]
[InstCombine] call SimplifyICmpInst with correct context
Summary:
Fixes PR23809. Without passing the context to SimplifyICmpInst, we would
use the assume to prove that the condition feeding the assume is
trivially true (see isValidAssumeForContext in ValueTracking.cpp),
causing the removal of the assume which may be useful for later
optimizations.
Test Plan: pr23800.ll
Reviewers: hfinkel, majnemer
Reviewed By: hfinkel
Subscribers: henryhu, llvm-commits, wengxt, broune, meheff, eliben
Differential Revision: http://reviews.llvm.org/D10695
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240683
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 20:10:45 +0000 (20:10 +0000)]
Diagnose undefined temporary symbols.
We already disallowed
.global .Lfoo
so this is reasonable.
This is a small cherry pick from r240130.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240681
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Thu, 25 Jun 2015 19:37:13 +0000 (19:37 +0000)]
Make this test verify .debug_pubnames is actually missing.
It was matching at EOF regardless of whether the section was present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240679
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Thu, 25 Jun 2015 19:28:24 +0000 (19:28 +0000)]
Rangify for loop in Inliner.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240678
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Thu, 25 Jun 2015 18:48:26 +0000 (18:48 +0000)]
Add Arg::getValues method with const 'this' and const result
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240673
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 25 Jun 2015 18:47:02 +0000 (18:47 +0000)]
DAGCombiner: Remove redundant check
MemIntrinsicSDNode is already a subclass of MemSDNode,
so the MemSDNode check is sufficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240672
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 25 Jun 2015 18:32:02 +0000 (18:32 +0000)]
GVN: If a branch has two identical successors, we cannot declare either dead.
This previously caused miscompilations as a result of phi nodes receiving
undef incoming values from blocks dominated by such successors.
Differential Revision: http://reviews.llvm.org/D10726
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240670
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 16:16:08 +0000 (16:16 +0000)]
Add a test for a recent regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240656
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 25 Jun 2015 16:01:53 +0000 (16:01 +0000)]
llvm-nm: print 'n' instead of '?'
This matches gnu nm and has the advantage that there is a upper case N.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240655
91177308-0d34-0410-b5e6-
96231b3b80d8