Rafael Espindola [Thu, 28 May 2015 21:36:02 +0000 (21:36 +0000)]
Remove a trivial forwarding function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238506
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 21:31:22 +0000 (21:31 +0000)]
Re-landing "Refactoring cl::list_storage from "is a" to "has a" std::vector."
Originally landed r238485
MSVC resolves identifiers differently from Clang and GCC, this resulted in build bot failures. This pach re-lands r238485 and fixes the build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238505
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 21:29:59 +0000 (21:29 +0000)]
[SelectionDAG] Scalar shift amounts may require legalization
The shift amount may be too small to cope with promoted left hand side,
make sure to promote it as well.
This fixes PR23664.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238503
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 21:23:53 +0000 (21:23 +0000)]
Remove debug prints from r238487
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238501
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 28 May 2015 20:59:08 +0000 (20:59 +0000)]
[llvm] Adding vdtor to fix warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238494
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:53:09 +0000 (20:53 +0000)]
Inline trivial method. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238492
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 20:47:02 +0000 (20:47 +0000)]
Revert "Refactoring cl::list_storage from "is a" to "has a" std::vector."
This reverts commit
117715ca0613d3db144241499401f2ec5398f1d5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238491
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 20:44:28 +0000 (20:44 +0000)]
Disable x86 tail call optimizations that jump through GOT
For x86 targets, do not do sibling call optimization when materializing
the callee's address would require a GOT relocation. We can still do
tail calls to internal functions, hidden functions, and protected
functions, because they do not require this kind of relocation. It is
still possible to get GOT relocations when the user explicitly asks for
it with musttail or -tailcallopt, both of which are supposed to
guarantee TCO.
Based on a patch by Chih-hung Hsieh.
Reviewers: srhines, timmurray, danalbert, enh, void, nadav, rnk
Subscribers: joerg, davidxl, llvm-commits
Differential Revision: http://reviews.llvm.org/D9799
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238487
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 20:38:12 +0000 (20:38 +0000)]
Refactoring cl::list_storage from "is a" to "has a" std::vector.
Summary: This isn't necessarily an ideal change, and I want to at least reduce the API surface area, but for the new API we really shouldn't be relying on cl::list being a std::vector.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10093
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238485
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 28 May 2015 20:30:32 +0000 (20:30 +0000)]
Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238483
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 28 May 2015 20:25:42 +0000 (20:25 +0000)]
Object, ELF: Use error code instead of calling report_fatal_error()
Make createELFObjectFile() return object_error::parse_failed on
encountering invalid ELF file, instead of crashing the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238481
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:25:29 +0000 (20:25 +0000)]
Remove structure field that can be computed just before use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238480
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:19:31 +0000 (20:19 +0000)]
Avoid warnings when building without asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238479
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:11:34 +0000 (20:11 +0000)]
Move these vectors to the only function where they are used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238477
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 28 May 2015 20:02:45 +0000 (20:02 +0000)]
Thumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM.
We were previously codegen'ing these as regular load/store operations and
hoping that the register allocator would allocate registers in ascending order
so that we could apply an LDM/STM combine after register allocation. According
to the commit that first introduced this code (r37179), we planned to teach
the register allocator to allocate the registers in ascending order. This
never got implemented, and up to now we've been stuck with very poor codegen.
A much simpler approach for achiveing better codegen is to create LDM/STM
instructions with identical sets of virtual registers, let the register
allocator pick arbitrary registers and order register lists when printing an
MCInst. This approach also avoids the need to repeatedly calculate offsets
which ultimately ought to be eliminated pre-RA in order to decrease register
pressure.
This is implemented by lowering the memcpy intrinsic to a series of SD-only
MCOPY pseudo-instructions which performs a memory copy using a given number
of registers. During SD->MI lowering, we lower MCOPY to LDM/STM. This is a
little unusual, but it avoids the need to encode register lists in the SD,
and we can take advantage of SD use lists to decide whether to use the _UPD
variant of the instructions.
Fixes PR9199.
Differential Revision: http://reviews.llvm.org/D9508
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238473
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 20:02:05 +0000 (20:02 +0000)]
[WinEH] Remove debugging dump() call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238472
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:00:13 +0000 (20:00 +0000)]
Merge redundant loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238471
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 28 May 2015 19:56:34 +0000 (19:56 +0000)]
AsmPrinter: Stop exposing underlying DIE children list, NFC
Update `DIE` API to hide the implementation of `DIE::Children` so we can
swap it out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238468
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 19:46:36 +0000 (19:46 +0000)]
Simplify LastLocalSymbolIndex computation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238465
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 19:43:20 +0000 (19:43 +0000)]
Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238463
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 28 May 2015 19:43:06 +0000 (19:43 +0000)]
Add BranchProbabilityInfo::releaseMemory to clear the Weights field.
BranchProbabilityInfo was leaking 3MB of memory when running 'opt -O2 verify-uselistorder.lto.bc'. This was due to the Weights member not being cleared once the pass is no longer needed.
This adds the releaseMemory override to clear that field. The other fields are cleared at the end of runOnFunction so can stay there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238462
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 19:29:15 +0000 (19:29 +0000)]
Remove temporary FileSymbolData. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238461
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 28 May 2015 19:07:14 +0000 (19:07 +0000)]
[Objdump] Allow instruction pretty printing to be specialized by the target triple.
Differential Revision: http://reviews.llvm.org/D8427
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238457
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 28 May 2015 18:55:38 +0000 (18:55 +0000)]
AsmPrinter: Rename begin_values() => values_begin(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238456
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 28 May 2015 18:39:50 +0000 (18:39 +0000)]
[llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238453
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 18:39:17 +0000 (18:39 +0000)]
[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.
Currently we only fold a BitCast into a Load when the BitCast is its
only user.
Do the same for any no-op cast.
Differential Revision: http://reviews.llvm.org/D9152
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238452
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 28 May 2015 18:35:18 +0000 (18:35 +0000)]
Add llvm-dwarfdump-fuzzer that uses LibFuzzer to fuzz llvm-dwarfdump tool.
The fuzzer is very simple, but not quite useful at the moment: it's unable
to discover "interesting" examples, as LLVMObject library is terrible at
error recovery, calling "report_fatal_error()" far too often.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238451
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 28 May 2015 18:33:39 +0000 (18:33 +0000)]
Add support for the convergent flag at the MC and MachineInstr levels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238450
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 28 May 2015 18:18:21 +0000 (18:18 +0000)]
Reuse Loc variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238448
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 28 May 2015 18:09:13 +0000 (18:09 +0000)]
AsmPrinter: Suppress warnings on GCC from r238362, NFC
GCC seems to have some overzealous warnings about strict aliasing.
Rafael reports that this patch suppresses them on GCC 4.9, and I'm
hoping this will work for GCC 4.7 as well. I'll watch [1] and iterate
if necessary.
[1]: http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8597
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238447
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 18:03:20 +0000 (18:03 +0000)]
Use range loops for accessing file names. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238446
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 28 May 2015 18:03:07 +0000 (18:03 +0000)]
Expand the Flags field of MCInstrDesc to 64 bits, while simultaneously
shrinking the Size and NumDefs fields to offset the size growth, and
reordering the fields to preserve a good packing.
This is necessary in the short term for adding a convergent flag, and
simultaneously future-proofs us against more flags being added in the
future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238445
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 17:54:01 +0000 (17:54 +0000)]
Merge computeSymbolTable and writeSymbolTable.
For now this just saves a few loops, but it will allow more simplifications
in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238444
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Thu, 28 May 2015 16:23:16 +0000 (16:23 +0000)]
[mips] Add new format for dmtc2/dmfc2 for Octeon CPUs.
Octeon CPUs use dmtc2 rt,imm16 and dmfcp2 rt,imm16 for the crypto coprocessor.
E.g. dmtc2 rt,0x4057 starts calculation of sha-1.
I had to introduce a new deconding namespace to avoid a decoding conflict.
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D10083
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238439
91177308-0d34-0410-b5e6-
96231b3b80d8
Ed Maste [Thu, 28 May 2015 15:38:17 +0000 (15:38 +0000)]
DebugInfo: .debug_line DWARF64 support
This adds support for the 64-bit DWARF format, but is still limited to
less than 4GB of debug data by the DataExtractor class. Some versions
of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't
actually necessary.
Differential Revision: http://reviews.llvm.org/D1988
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238434
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 15:20:00 +0000 (15:20 +0000)]
Don't create an unused _GLOBAL_OFFSET_TABLE_.
This was a bug for bug compatibility with gas that is completely unnecessary.
If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by
the time we get to the ELF writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238432
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 28 May 2015 15:05:18 +0000 (15:05 +0000)]
[ARMTargetParser] Adding sub-arch information for Clang. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238429
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 28 May 2015 14:52:15 +0000 (14:52 +0000)]
[mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.
Reviewers: petarj
Reviewed By: petarj
Subscribers: srhines, joerg, tberghammer, llvm-commits
Differential Revision: http://reviews.llvm.org/D9669
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238427
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Thu, 28 May 2015 13:48:41 +0000 (13:48 +0000)]
[Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6
Add support for resolving MIPS64r2 and MIPS64r6 relocations in MCJIT.
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D9667
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238424
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 28 May 2015 12:55:59 +0000 (12:55 +0000)]
Silencing two signed/unsigned mismatch warnings; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238419
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 May 2015 12:55:43 +0000 (12:55 +0000)]
[AsmPrinter] Destroy allocated DIEAbbrevs on teardown.
DIEAbbrev contains a SmallVector that can leak for overly large abbrevs. They
used to be owned by the DIE, but after the recent refactoring DWARFFile
allocates its own abbrevs.
Leak found by asan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238418
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 28 May 2015 12:10:37 +0000 (12:10 +0000)]
[ARMTargetParser] Adding a few more CPUs for Clang CPU detection. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238415
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 May 2015 11:45:32 +0000 (11:45 +0000)]
[MC] Replace custom string join function with the one from StringExtras.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238414
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 May 2015 11:24:24 +0000 (11:24 +0000)]
Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238412
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 28 May 2015 08:59:03 +0000 (08:59 +0000)]
Fix comments in ARMTargetParser. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238404
91177308-0d34-0410-b5e6-
96231b3b80d8
Yury Gribov [Thu, 28 May 2015 08:03:28 +0000 (08:03 +0000)]
[ASan] Fix previous commit. Patch by Max Ostapenko!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238403
91177308-0d34-0410-b5e6-
96231b3b80d8
Yury Gribov [Thu, 28 May 2015 07:51:49 +0000 (07:51 +0000)]
[ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!
Differential Revision: http://reviews.llvm.org/D7098
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238402
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 May 2015 06:38:32 +0000 (06:38 +0000)]
[TableGen] Use DefInit::getAsString instead of getDef()->getName(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238399
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 May 2015 06:38:28 +0000 (06:38 +0000)]
[TableGen] Don't convert types to strings to query what they are. Just use 'isa'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238398
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 06:16:39 +0000 (06:16 +0000)]
[Reassociate] Canonicalizing 'x [+-] (-Constant * y)' isn't always a win
Canonicalizing 'x [+-] (-Constant * y)' is not a win if we don't *know*
we will open up CSE opportunities.
If the multiply was 'nsw', then negating 'y' requires us to clear the
'nsw' flag. If this is actually worth pursuing, it is probably more
appropriate to do so in GVN or EarlyCSE.
This fixes PR23675.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238397
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Thu, 28 May 2015 04:56:52 +0000 (04:56 +0000)]
[NaryReassociate] Run EarlyCSE after NaryReassociate
Summary:
This patch made two improvements to NaryReassociate and the NVPTX pipeline
1. Run EarlyCSE/GVN after NaryReassociate to get rid of redundant common
expressions.
2. When adding an instruction to SeenExprs, maps both the SCEV before and after
reassociation to that instruction.
Test Plan: updated @reassociate_gep_nsw in nary-gep.ll
Reviewers: meheff, broune
Reviewed By: broune
Subscribers: dberlin, jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9947
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238396
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 28 May 2015 02:40:15 +0000 (02:40 +0000)]
[x86] Refactor the tests for popcnt.
Extracted from the D6531 patch by Bruno Cardoso Lopes, and re-generated
to reflect the current state of the world. This should let Bruno's D6531
actually show the delta between the approaches by running the x86 test
case update script after re-building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238391
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 28 May 2015 02:17:15 +0000 (02:17 +0000)]
[omp] Actually provide a default OpenMP runtime -- libgomp for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238390
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 28 May 2015 01:47:22 +0000 (01:47 +0000)]
[omp] Add a configuration variable for the default OpenMP runtime.
This will be used in my next commit to Clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238388
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 23:02:36 +0000 (23:02 +0000)]
AsmPrinter: Avoid a warning in NDEBUG, NFC
Should fix the -Werror release build:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/11113
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238375
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:59:03 +0000 (22:59 +0000)]
AsmPrinter: Return added DIE from DIE::addChild()
Change `DIE::addChild()` to return a reference to the just-added node,
and update consumers to use it directly. An upcoming commit will
abstract away (and eventually change) the underlying storage of
`DIE::Children`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238372
91177308-0d34-0410-b5e6-
96231b3b80d8
Fiona Glaser [Wed, 27 May 2015 22:51:47 +0000 (22:51 +0000)]
RegisterPressure: fix debug prints in case of physical registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238371
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:44:06 +0000 (22:44 +0000)]
AsmPrinter: Stop exposing underlying DIEValue list, NFC
Change the `DIE` API to hide the implementation of the list of
`DIEValue`s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238369
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:36:37 +0000 (22:36 +0000)]
AsmPrinter: Remove DIEHash::AttrEntry, NFC
Remove "the most boring struct ever" (thanks to review by Eric).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238366
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:31:41 +0000 (22:31 +0000)]
AsmPrinter: Store abbreviation data directly in DIE and DIEValue
Stop storing a `DIEAbbrev` in `DIE`, since the data fits neatly inside
the `DIEValue` list. Besides being a cleaner data structure (avoiding
the parallel arrays), this gives us more freedom to rearrange the
`DIEValue` list.
This fixes the temporary memory regression from 845 MB up to 879 MB, and
drops it further to 829 MB for a net memory decrease of around 1.9%
(incremental decrease around 5.7%).
(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@238364
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 22:14:58 +0000 (22:14 +0000)]
Reapply "AsmPrinter: Change DIEValue to be stored by value"
This reverts commit r238350, effectively reapplying r238349 after fixing
(all?) the problems, all somehow related to how I was using
`AlignedArrayCharUnion<>` inside `DIEValue`:
- MSVC can only handle `sizeof()` on types, not values. Change the
assert.
- GCC doesn't know the `is_trivially_copyable` type trait. Instead of
asserting it, add destructors.
- Call placement new even when constructing POD (i.e., the pointers).
- Instead of copying the char buffer, copy the casted classes.
I've left in a couple of `static_assert`s that I think both MSVC and GCC
know how to handle. If the bots disagree with me, I'll remove them.
- Check that the constructed type is either standard layout or a
pointer. This protects against a programming error: we really want
the "small" `DIEValue`s to be small and simple, so don't
accidentally change them not to be.
- Similarly, check that the size of the buffer is no bigger than a
`uint64_t` or a pointer. (I thought checking against
`sizeof(uint64_t)` would be good enough, but Chandler suggested that
pointers might sometimes be bigger than that in the context of
sanitizers.)
I've also committed r238359 in the meantime, which introduces a
DIEValue.def to simplify dispatching between the various types (thanks
to a review comment by David Blaikie). Without that, this commit would
be almost unintelligible.
Here's the original commit message:
--
Change `DIEValue` to be stored/passed/etc. by value, instead of
reference. It's now a discriminated union, with a `Val` field storing
the actual type. The classes that used to inherit from `DIEValue` no
longer do. There are two categories of these:
- Small values fit in a single pointer and are stored by value.
- Large values require auxiliary storage, and are stored by reference.
The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp. It
was relying on `DIEInteger`s being passed around by reference, so I
replaced that assumption with a `PatchLocation` type that stores a safe
reference to where the `DIEInteger` lives instead.
This commit causes a temporary regression in memory usage, since I've
left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit. I
measured an increase from 845 MB to 879 MB, around 3.9%. The follow-up
drops it lower than the starting point, and I've only recently brought
the memory this low anyway, so I'm committing these changes separately
to keep them incremental. (I also considered swapping the commits, but
the other one first would cause a lot more code churn.)
(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@238362
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 21:15:43 +0000 (21:15 +0000)]
AsmPrinter: Introduce DIEValue.def, NFC
Use a .def macro file to iterate through the various subclasses of
`DIEValue`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238359
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 21:04:14 +0000 (21:04 +0000)]
Rename and move getCurrentSectionData.
I think this concludes the merge of MCSectionData and MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238358
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 20:52:32 +0000 (20:52 +0000)]
There is only one current section.
Both MCStreamer and MCObjectStreamer were maintaining a current section
variable and they were slightly out of sync. I don't think this was observable,
but was inefficient and error prone.
Changing this requires a few cascading changes:
* SwitchSection has to call ChangeSection earlier for ChangeSection to see
the old section.
* With that change, ChangeSection cannot call EmitLabel, since during
ChangeSection we are still in the old section.
* When the object streamer requires a begin label, just reused the existing
generic support for begin labels instead of calling EmitLabel directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238357
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Wed, 27 May 2015 20:50:01 +0000 (20:50 +0000)]
[RuntimeDyld] Fix MachO i386 SECTDIFF relocation to support non-zero addends.
Previously, relocations of the form 'A - B + C' would fail on i386 when C was
non-zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238356
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Wed, 27 May 2015 19:49:53 +0000 (19:49 +0000)]
ARMTargetParser: Make BSD Thumb/BE armv6 work
Simple change to make arch like "thumbv6" and "armbev6" to return the
correct CPU for FreeBSD and NetBSD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238353
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 27 May 2015 19:39:44 +0000 (19:39 +0000)]
MIR: Remove 2 empty non-reverted directories form SVN.
The revert commit r238007 didn't delete the old 'MIR' directories
in 'include/llvm/CodeGen' and 'lib/CodeGen'. Since the resubmitted
commit r238341 uses the 'MIRParser' directories instead of 'MIR'
this commit deletes the unused directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238352
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 27 May 2015 19:34:01 +0000 (19:34 +0000)]
Final fix for PR 23499 and IR test case.
This fixes a bit I forgot in r238335. In addition to the data record and
the counter, we can also move the name of the counter to the comdat for
the associated function.
I'm also adding an IR test case to check that these three elements are
placed in the proper comdat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238351
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 19:30:27 +0000 (19:30 +0000)]
Revert "AsmPrinter: Change DIEValue to be stored by value"
This reverts commit r238349, since it caused some errors on bots:
- std::is_trivially_copyable isn't available until GCC 5.0.
- It was complaining about strict aliasing with my use of
ArrayCharUnion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238350
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 19:22:50 +0000 (19:22 +0000)]
AsmPrinter: Change DIEValue to be stored by value
Change `DIEValue` to be stored/passed/etc. by value, instead of
reference. It's now a discriminated union, with a `Val` field storing
the actual type. The classes that used to inherit from `DIEValue` no
longer do. There are two categories of these:
- Small values fit in a single pointer and are stored by value.
- Large values require auxiliary storage, and are stored by reference.
The only non-mechanical change is to tools/dsymutil/DwarfLinker.cpp. It
was relying on `DIEInteger`s being passed around by reference, so I
replaced that assumption with a `PatchLocation` type that stores a safe
reference to where the `DIEInteger` lives instead.
This commit causes a temporary regression in memory usage, since I've
left merging `DIEAbbrevData` into `DIEValue` for a follow-up commit. I
measured an increase from 845 MB to 879 MB, around 3.9%. The follow-up
drops it lower than the starting point, and I've only recently brought
the memory this low anyway, so I'm committing these changes separately
to keep them incremental. (I also considered swapping the commits, but
the other one first would cause a lot more code churn.)
(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@238349
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 27 May 2015 18:49:38 +0000 (18:49 +0000)]
AsmPrinter: Reorganize DIE.h, NFC
An upcoming commit will switch to storing `DIEValue`s by value in a
`DIE`, so move the `DIE` down below all the subclasses it can. Two
subclasses inherit from `DIE`, so drop those down below `DIE`.
`DIEValue` will become a discriminated union, which contains an instance
of one of the classes that are currently subclasses. "Big" ones, such
as those that inherit from `DIE`, will continue to be stored by pointer.
This commit does as much of the code motion ahead of time as possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238346
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Wed, 27 May 2015 18:15:37 +0000 (18:15 +0000)]
ARMTargetParser: Normalising build attributes
Now that most of the methods in Clang and LLVM that were parsing arch/cpu/fpu
strings are using ARMTargetParser, it's time to make it a bit more conforming
with what the ABI says.
This commit adds some clarification on what build attributes are accepted and
which are "non-standard". It also makes clear that the "defaultCPU" and
"defaultArch" methods were really just build attribute getters.
It also diverges from GCC's behaviour to say that armv2/armv3 are really an
ARMv4 in the build attributes, when the ABI has a clear state for that: Pre-v4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238344
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Wed, 27 May 2015 18:11:07 +0000 (18:11 +0000)]
Avoid creating and destroying a std::string on every iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238343
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 27 May 2015 18:02:19 +0000 (18:02 +0000)]
Resubmit r237954 (MIR Serialization: print and parse LLVM IR using MIR format).
This commit a 3rd attempt at comitting the initial MIR serialization patch.
The first commit (r237708) was reverted in 237730. Then the second commit
(r237954) was reverted in r238007, as the MIR library under CodeGen caused
a circular dependency where the CodeGen library depended on MIR and MIR
library depended on CodeGen.
This commit has fixed the dependencies between CodeGen and MIR by
reorganizing the MIR serialization code - the code that prints out
MIR has been moved to CodeGen, and the MIR library has been renamed
to MIRParser. Now the CodeGen library doesn't depend on the
MIRParser library, thus the circular dependency no longer exists.
--Original Commit Message--
MIR Serialization: print and parse LLVM IR using MIR format.
This commit is the initial commit for the MIR serialization project.
It creates a new library under CodeGen called 'MIR'. This new
library adds a new machine function pass that prints out the LLVM IR
using the MIR format. This pass is then added as a last pass when a
'stop-after' option is used in llc. The new library adds the initial
functionality for parsing of MIR files as well. This commit also
extends the llc tool so that it can recognize and parse MIR input files.
Reviewers: Duncan P. N. Exon Smith, Matthias Braun, Philip Reames
Differential Revision: http://reviews.llvm.org/D9616
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238341
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Wed, 27 May 2015 16:54:10 +0000 (16:54 +0000)]
R600: Rely on TypeLegalizer to use divrem instead of div/rem
reviewer: tstellardAMD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238337
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Wed, 27 May 2015 16:54:09 +0000 (16:54 +0000)]
SelectionDAG: Don't do libcall on div/rem if divrem is custom
v2: TargetLoweringBase:: -> TargetLowering::
Use Ops array
v3: Explicitly use value 0 for ?DIV
Remove redundant newline
Differential revision: http://reviews.llvm.org/D7803
reviewer: ab
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238336
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 27 May 2015 16:44:47 +0000 (16:44 +0000)]
Fix PR 23499 - Avoid multiple profile counters for functions in comdat sections.
Counter symbols created for linkonce functions are not discarded by ELF
linkers unless the symbols are placed in the same comdat section as its
associated function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238335
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 27 May 2015 15:39:47 +0000 (15:39 +0000)]
[mips][microMIPSr6] Implement SEB and SEH instructions
Differential Revision: http://reviews.llvm.org/D9739
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238333
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 15:18:34 +0000 (15:18 +0000)]
Fix NDEBUG build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238332
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 15:14:11 +0000 (15:14 +0000)]
Delete MCSectionData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238331
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 14:55:09 +0000 (14:55 +0000)]
Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238330
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 14:45:54 +0000 (14:45 +0000)]
Stop using MCSectionData in WinCOFFObjectWriter.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238329
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 14:37:12 +0000 (14:37 +0000)]
clang-format WinCOFFObjectWriter.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238328
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 14:33:39 +0000 (14:33 +0000)]
Remove uses of MCSectionData from MachObjectWriter.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238327
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Wed, 27 May 2015 14:19:22 +0000 (14:19 +0000)]
[mips][microMIPSr6] Implement BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC and BNEZALC instructions
This patch implements microMIPS32r6 BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC
and BNEZALC instructions using mapping.
Differential Revision: http://reviews.llvm.org/D10031
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238325
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Wed, 27 May 2015 14:09:33 +0000 (14:09 +0000)]
AVX-512: Fixed a bug in extracting subvector from v64i1
By Igor Breger (igor.breger@intel.com)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238322
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 13:37:28 +0000 (13:37 +0000)]
Move getSubsectionInsertionPoint to MCSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238320
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 13:30:50 +0000 (13:30 +0000)]
Remove uses of MCSectionData from ELFObjectWriter. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238317
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 13:05:42 +0000 (13:05 +0000)]
Use operator<< instead of print in a few more places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238315
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 27 May 2015 12:13:06 +0000 (12:13 +0000)]
We always have an InstPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238311
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 27 May 2015 09:36:33 +0000 (09:36 +0000)]
Revert r238305: [PM] Use a simpler technique to drop optional analysis
manager arguments...
I have no idea why, but compilers seem to hate this and its late, so I'm
not going to debug it. :: sigh :: This is why we can't have nice things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238306
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 27 May 2015 09:02:51 +0000 (09:02 +0000)]
[PM] Use a simpler technique to drop optional analysis manager arguments
when invoking run methods.
This technique was suggested by Dinesh Dwivedi who also wrote the
original patch. During the code review, they explained to me that this
isn't a fully general technique as we need to know the signatures of the
method candidates. Since this is really a narrower utility, I switched
the names and structure to be more clearly a specialized run method
invoke helper and commented it accordingly. I still think this is
a pretty big win.
Very sorry to Dinesh for the extreme delay in landing this patch. I've
been far to busy poking at other things.
Original review: http://reviews.llvm.org/D3543
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238305
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Wed, 27 May 2015 08:44:01 +0000 (08:44 +0000)]
Revert r238190 and r238197: [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
This broke the llvm-mips-linux builder and several of our out-of-tree builders.
Initial investigations show that the commit probably isn't the problem but
reverting anyway while I investigate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238302
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Wed, 27 May 2015 08:15:19 +0000 (08:15 +0000)]
AVX-512: Implemented all forms of sign-extend and zero-extend instructions for KNL and SKX
Implemented DAG lowering for all these forms.
Added tests for DAG lowering and encoding.
By Igor Breger (igor.breger@intel.com)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238301
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 27 May 2015 07:20:46 +0000 (07:20 +0000)]
Add some more detailed docs about the current state of Phabricator and
reviwes.llvm.org to help reduce confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238295
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Wed, 27 May 2015 06:28:41 +0000 (06:28 +0000)]
[X86] Implement the support for shrink-wrapping.
With this patch the x86 backend is now shrink-wrapping capable
and this functionality can be tested by using the
-enable-shrink-wrap switch.
The next step is to make more test and enable shrink-wrapping by
default for x86.
Related to <rdar://problem/
20821487>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238293
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Wed, 27 May 2015 06:25:48 +0000 (06:25 +0000)]
[ShrinkWrap] Add a target hook to check whether or not
the target can handle a given basic block as prologue
or epilogue.
Related to <rdar://problem/
20821487>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238292
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 27 May 2015 05:12:40 +0000 (05:12 +0000)]
ARMLoadStoreOptimizer: Code cleanup; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238289
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 27 May 2015 05:12:39 +0000 (05:12 +0000)]
MachineBasicBlock: Cleanup computeRegisterLiveness()
- Clean documentation comment
- Change the API to accept an iterator so you can actually pass
MachineBasicBlock::end() now.
- Add more "const".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238288
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Wed, 27 May 2015 05:12:37 +0000 (05:12 +0000)]
MCSymbol: Make print() robust against empty names
This shouldn't happen, but it's nice not to abort when printing broken machine
functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238287
91177308-0d34-0410-b5e6-
96231b3b80d8