OSDN Git Service
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 18:23:28 +0000 (18:23 +0000)]
SelectionDAG: Reflow code to use early returns, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233577
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Holewinski [Mon, 30 Mar 2015 18:12:50 +0000 (18:12 +0000)]
[NVPTX] Add options for PTX 4.1/4.2 and SM 3.2/3.7/5.2/5.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233575
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 18:07:40 +0000 (18:07 +0000)]
DebugInfo: Write new DebugLoc API
Rewrite `DebugLoc` with a cleaner API that reflects its current status
as a wrapper around an `MDLocation` pointer.
- Add accessors/constructors to/from `MDLocation`.
- Simplify construction from `MDNode`.
- Remove unnecessary `LLVMContext` from APIs.
- Drop some API that isn't useful any more.
- Rewrite documentation.
Actually, I've left the old API behind temporarily at the bottom of the
class so that I can update callers in separate commits. I'll remove it
once the callers are updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233573
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:41:24 +0000 (17:41 +0000)]
DebugInfo: Implement MDLocation::getInlinedAtScope()
Write `MDLocation::getInlinedAtScope()` and use it to re-implement
`DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`).
This follows the inlined-at linked list and returns the scope of the
deepest/last location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233568
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:21:38 +0000 (17:21 +0000)]
Verifier: Add operand checks for remaining debug info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233565
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:06:38 +0000 (17:06 +0000)]
DebugInfo: Simplify logic in DISubprogram::Verify(), NFC
Simplify the logic in `DISubprogram::Verify()` by using the new debug
info hierarchy directly instead of the `DebugLoc` wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233563
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 17:04:06 +0000 (17:04 +0000)]
Verifier: Loosen r233559 check for 'function:' field in MDSubprogram
Stop worrying about what the `function:` field is in `MDSubprogram`,
since it could be a bitcast [1]. Just check its type and leave it at
that.
[1]: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/3540/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233562
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 16:37:48 +0000 (16:37 +0000)]
Verifier: Add operand checks for MDLexicalBlock
Add operand checks for `MDLexicalBlock` and `MDLexicalBlockFile`. Like
`MDLocalVariable` and `MDLocation`, these nodes always require a scope.
There was no test bitrot to fix here (just updated the serialization
tests in test/Assembler/mdlexicalblock.ll).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233561
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 16:21:28 +0000 (16:21 +0000)]
DebugInfo: Rename some testcases
Momentarily (but never in tree), the `scope:` field was called
`parent:`. Apparently a few testcases were left behind with "parent" in
the name, so rename them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233560
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 30 Mar 2015 16:19:15 +0000 (16:19 +0000)]
Verifier: Check operands of MDSubprogram nodes
Check operands of `MDSubprogram`s in the verifier, and update the
accessors and factory functions to use more specific types.
There were a lot of broken testcases, which I fixed in r233466. If you
have out-of-tree tests for debug info, you probably need similar changes
to the ones I made there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233559
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 30 Mar 2015 16:10:39 +0000 (16:10 +0000)]
Trying to fix the Hexagon and debian-fast bots arm32_neon_vcnt_upgrade.ll test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233558
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 30 Mar 2015 15:42:36 +0000 (15:42 +0000)]
Remove more superfluous .str() and replace std::string concatenation with Twine.
Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233555
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 30 Mar 2015 15:31:32 +0000 (15:31 +0000)]
more space; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233554
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 30 Mar 2015 15:25:51 +0000 (15:25 +0000)]
[X86] Ensure integer domain on scalar i64 load/store stack folding tests. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233553
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Mar 2015 15:16:30 +0000 (15:16 +0000)]
Fix Sphinx warning " Title underline too short.".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233551
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Mar 2015 13:59:06 +0000 (13:59 +0000)]
Save a std::string.
The group names are always symbol names, so we can use a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233545
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 30 Mar 2015 13:46:59 +0000 (13:46 +0000)]
[SystemZ] Fix LLVM crash on unoptimized code
Compiling the following function with -O0 would crash, since LLVM would
hit an assertion in getTestUnderMaskCond:
int test(unsigned long x)
{
return x >= 0 && x <= 15;
}
Fixed by detecting the case in the caller of getTestUnderMaskCond.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233541
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Mon, 30 Mar 2015 13:46:25 +0000 (13:46 +0000)]
[SystemZ] Remove TargetMachine CPU auto-detection
As was done for X86 in r206094.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233540
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Mar 2015 13:39:16 +0000 (13:39 +0000)]
Special case the creation of relocation sections.
These sections are never looked up and we know when have to create them. Use
that to save adding them to the regular map and avoid a symbol->string->symbol
conversion for the group symbol.
This also makes the implementation independent of the details of how unique
sections are implemented.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233539
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 30 Mar 2015 13:27:25 +0000 (13:27 +0000)]
[mips] Support 9-bit offsets for the 'R' inline assembly memory constraint.
Summary:
The 'R' constraint is actually supposed to be much more complicated than
this and is defined in terms of whether it will cause macro expansion in
the assembler. 'R' is getting less useful due to architecture changes and
ought to be replaced by other constraints. We therefore implement 9-bit
offsets which will work for all subtargets and all instructions.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8440
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233537
91177308-0d34-0410-b5e6-
96231b3b80d8
Russell Gallop [Mon, 30 Mar 2015 12:39:03 +0000 (12:39 +0000)]
Revert test commit at revision 233535.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233536
91177308-0d34-0410-b5e6-
96231b3b80d8
Russell Gallop [Mon, 30 Mar 2015 12:37:55 +0000 (12:37 +0000)]
Test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233535
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Mon, 30 Mar 2015 09:30:02 +0000 (09:30 +0000)]
Revert "[SCEV] Look at backedge dominating conditions."
This leads to terribly slow compile times under MSAN. More discussion
on the commit thread of r233447.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233529
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 30 Mar 2015 09:29:28 +0000 (09:29 +0000)]
AVX-512: blank lines, duplicated tests, no functional changes
see comments http://reviews.llvm.org/D6835
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233528
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 30 Mar 2015 08:30:34 +0000 (08:30 +0000)]
AVX-512: added intrinsics for VPAND, VPOR and VPXOR
by Asaf Badouh (asaf.badouh@intel.com)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233525
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Mar 2015 06:31:14 +0000 (06:31 +0000)]
[X86] In getHostCPUFeatures, disable xop, f16c, fma, and fma4 if OS does not support saving ymm state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233518
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Mar 2015 06:31:11 +0000 (06:31 +0000)]
[X86] Remove FeatureAES for 'corei7' CPU. 'corei7' should match 'nehalem' which doesn't have AES. Having AES and not PCLMUL makes 'corei7' halfway between Nehalem and Westmere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233517
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Mar 2015 06:31:09 +0000 (06:31 +0000)]
[X86] Use the more specific CPU names like 'nehalem', 'westmere', 'haswell', etc. Split Nehalem and Westmere CPUs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233516
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Mar 2015 06:31:06 +0000 (06:31 +0000)]
[X86] Move family 6 model 21 to 'pentium-m'. Near as I can tell this is a Dothan based SOC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233515
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Mar 2015 06:31:03 +0000 (06:31 +0000)]
[X86] Family 6 model 29 is a Penryn based processor not a Nehalem based processor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233514
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Mon, 30 Mar 2015 05:15:57 +0000 (05:15 +0000)]
[MCJIT] In debug memory dump output, don't truncate 64 bit addresses
Summary: In dumpMemorySections a cast was too short, and in resolveRelocations a format string was too short.
Test Plan:
Enable debug build and run a program which invokes MCJIT::finalizeObject(). Saw valid input as below (highlighted addresses were previously truncated):
```
Parse relocations:
Resolving relocations Section #0 **0x7f4c1337b000**
----- Contents of section socket1 before relocations -----
**0x00007f4c1337b000**: 18 01 00 00 01 01 01 0a 00 00 00 00 04 03 02 01
0x00007f4c1337b010: 7b 1a f8 ff 00 00 00 00 18 11 00 00 05 00 00 00
```
Reviewers: lhames
Reviewed By: lhames
Subscribers: llvm-commits, ast
Differential Revision: http://reviews.llvm.org/D8681
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233512
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 30 Mar 2015 04:02:55 +0000 (04:02 +0000)]
[Orc] Add missing #include. Hopefully this will appease the modules buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233510
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 30 Mar 2015 03:37:06 +0000 (03:37 +0000)]
[MCJIT][Orc] Refactor RTDyldMemoryManager, weave RuntimeDyld::SymbolInfo through
MCJIT.
This patch decouples the two responsibilities of the RTDyldMemoryManager class,
memory management and symbol resolution, into two new classes:
RuntimeDyld::MemoryManager and RuntimeDyld::SymbolResolver.
The symbol resolution interface is modified slightly, from:
uint64_t getSymbolAddress(const std::string &Name);
to:
RuntimeDyld::SymbolInfo findSymbol(const std::string &Name);
The latter passes symbol flags along with symbol addresses, allowing RuntimeDyld
and others to reason about non-strong/non-exported symbols.
The memory management interface removes the following method:
void notifyObjectLoaded(ExecutionEngine *EE,
const object::ObjectFile &) {}
as it is not related to memory management. (Note: Backwards compatibility *is*
maintained for this method in MCJIT and OrcMCJITReplacement, see below).
The RTDyldMemoryManager class remains in-tree for backwards compatibility.
It inherits directly from RuntimeDyld::SymbolResolver, and indirectly from
RuntimeDyld::MemoryManager via the new MCJITMemoryManager class, which
just subclasses RuntimeDyld::MemoryManager and reintroduces the
notifyObjectLoaded method for backwards compatibility).
The EngineBuilder class retains the existing method:
EngineBuilder&
setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager> mcjmm);
and includes two new methods:
EngineBuilder&
setMemoryManager(std::unique_ptr<MCJITMemoryManager> MM);
EngineBuilder&
setSymbolResolver(std::unique_ptr<RuntimeDyld::SymbolResolver> SR);
Clients should use EITHER:
A single call to setMCJITMemoryManager with an RTDyldMemoryManager.
OR (exclusive)
One call each to each of setMemoryManager and setSymbolResolver.
This patch should be fully compatible with existing uses of RTDyldMemoryManager.
If it is not it should be considered a bug, and the patch either fixed or
reverted.
If clients find the new API to be an improvement the goal will be to deprecate
and eventually remove the RTDyldMemoryManager class in favor of the new classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233509
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 29 Mar 2015 22:07:07 +0000 (22:07 +0000)]
[Orc] Add missing inline keyword to the function introduced in r233504.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233506
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 29 Mar 2015 21:55:27 +0000 (21:55 +0000)]
[Orc] Use raw TargetAddresses for callback trampoline addresses, rather than IR.
Add convenience function for building a typed IR Constant from trampoline
addresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233504
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 29 Mar 2015 20:49:03 +0000 (20:49 +0000)]
Silence sign compare warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233502
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 29 Mar 2015 20:33:07 +0000 (20:33 +0000)]
[inline asm] Don't reject duplicated matching constraints
They're harmless and it's easy to generate them from clang, leading to
a crash in LLVM. Found by afl-fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233500
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 29 Mar 2015 19:13:40 +0000 (19:13 +0000)]
Use SDValue bool check to tidyup some possible vector folding ops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233498
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 29 Mar 2015 16:49:51 +0000 (16:49 +0000)]
Use SDValue bool check to tidyup some possible ReassociateOps. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233495
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Sun, 29 Mar 2015 09:14:29 +0000 (09:14 +0000)]
AVX-512: Fixed the "commutative" property flag in VPANDN instruction
By Asaf Badouh (asaf.badouh@intel.com)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233489
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 29 Mar 2015 01:07:57 +0000 (01:07 +0000)]
Fix a variable name in MSVC specific part of rr233487.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233488
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 29 Mar 2015 01:00:23 +0000 (01:00 +0000)]
[X86] Implement getHostCPUFeatures for X86.
Plan to use this as part of CPU 'native' support so we can stop picking a different CPU name if CPU doesn't support AVX or AVX2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233487
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 28 Mar 2015 21:07:24 +0000 (21:07 +0000)]
Delete MCInstPrinter::AvailableFeatures.
All the ports have been fixed to read the feature bits from the subtarget passed
to the print methods. Also, delete the call to setAvailableFeatures in the
constructor of NVPTX's instprinter as the instprinter wasn't using the feature
bits anywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233486
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 28 Mar 2015 20:56:05 +0000 (20:56 +0000)]
[X86] Read the feature bits from the subtarget that is passed to printInst
instead of from MCInstPrinter::AvailableFeatures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233485
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 28 Mar 2015 20:44:05 +0000 (20:44 +0000)]
[Objdump] Pass the correct subtarget to printInst.
This fixes a bug I introduced in r233411.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233484
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 28 Mar 2015 19:42:41 +0000 (19:42 +0000)]
[PowerPC] Add asm parser support for bitmask forms of rotate-and-mask instructions
The asm syntax for the 32-bit rotate-and-mask instructions can take a 32-bit
bitmask instead of an (mb, me) pair. This syntax is not specified in the Power
ISA manual, but is accepted by GNU as, and is documented in IBM's Assembler
Language Reference. The GNU Multiple Precision Arithmetic Library (gmp)
contains assembly that uses this syntax.
To implement this, I moved the isRunOfOnes utility function from
PPCISelDAGToDAG.cpp to PPCMCTargetDesc.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233483
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 28 Mar 2015 18:31:31 +0000 (18:31 +0000)]
[DAGCombiner] Fixed incorrect test for buildvector of constant integers.
DAGCombiner::ReassociateOps was correctly testing for an constant integer scalar but failed to correctly test for constant integer vectors (it was testing for any constant vector).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233482
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Sat, 28 Mar 2015 16:44:57 +0000 (16:44 +0000)]
[ConstantFold] Don't fold ppc_fp128 <-> int bitcasts
PPC_FP128 is really the sum of two consecutive doubles, where the first double
is always stored first in memory, regardless of the target endianness. The
memory layout of i128, however, depends on the target endianness, and so we
can't fold this without target endianness information. As a result, we must not
do this folding in lib/IR/ConstantFold.cpp (it could be done instead in
Analysis/ConstantFolding.cpp, but that's not done now).
Fixes PR23026.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233481
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 28 Mar 2015 04:59:14 +0000 (04:59 +0000)]
Convert feature strings to lowercase even if they have a '+'/'-' in front of them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233475
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 28 Mar 2015 04:40:43 +0000 (04:40 +0000)]
Partially revert the changes I made in r233473 to keep the code concise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233474
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 28 Mar 2015 04:25:41 +0000 (04:25 +0000)]
clang-format X86ATTInstPrinter.{h,cpp} before I make changes to these files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233473
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 28 Mar 2015 04:03:51 +0000 (04:03 +0000)]
[SparcInstPrinter] Use the subtarget that is passed to the print function
instead of the one passed to the constructor.
Unfortunately, I don't have a test case for this change. In order to test my
change, I will have to run the code after line 90 in printSparcAliasInstr. I
couldn't make that happen because printAliasInstr would always handle the
printing of fcmp instructions that the code after line 90 is supposed to handle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233471
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 28 Mar 2015 03:24:19 +0000 (03:24 +0000)]
Update comment to match code behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233470
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Mar 2015 02:43:53 +0000 (02:43 +0000)]
Verifier: Allow subroutine types to have no type array
Loosen one check from r233446: as long as `DIBuilder` requires a
non-null type for every subprogram, we should allow a null type array.
Also add tests for the rest of `MDSubroutineType`, which were somehow
missing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233468
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Sat, 28 Mar 2015 02:37:33 +0000 (02:37 +0000)]
Fix comparison functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233467
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Mar 2015 02:26:45 +0000 (02:26 +0000)]
DebugInfo: Fix testcases with invalid MDSubprogram nodes
Fix testcases that don't pass the verifier after a WIP patch to check
`MDSubprogram` operands more effectively. I found the following issues:
- When `isDefinition: false`, the `variables:` field might point at
`!{i32 786468}`, or at a tuple that pointed at an empty tuple with
the comment "previously: invalid DW_TAG_base_type" (I vaguely recall
adding those comments during an upgrade script). In these cases, I
just dropped the array.
- The `variables:` field might point at something like `!{!{!8}}`,
where `!8` was an `MDLocation`. I removed the extra layer of
indirection.
- Invalid `type:` (not an `MDSubroutineType`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233466
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Sat, 28 Mar 2015 01:22:37 +0000 (01:22 +0000)]
[CodeGen] "PromoteInteger" f32 to f64 doesn't make sense.
The original f32->f64 promotion logic was refactored into roughly the
currently shape in r37781. However, starting with r132263, the
legalizer has been split into different kinds, and the previous
"Promote" (which did the right thing) was search-and-replace'd into
"PromoteInteger". The divide gradually deepened, with type legalization
("PromoteInteger") being separated from ops legalization
("Promote", which still works for floating point ops).
Fast-forward to today: there's no in-tree target with legal f64 but
illegal f32 (rather: no tests were harmed in the making of this patch).
With such a target, i.e., if you trick the legalizer into going through
the PromoteInteger path for FP, you get the expected brokenness.
For instance, there's no PromoteIntRes_FADD (the name itself sounds
wrong), so we'll just hit some assert in the PromoteInteger path.
Don't pretend we can promote f32 to f64. Instead, always soften.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233464
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 27 Mar 2015 23:41:42 +0000 (23:41 +0000)]
[ARM] Enable changing instprinter's behavior based on the per-function
subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233451
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 27 Mar 2015 23:24:22 +0000 (23:24 +0000)]
clang-format ARMInstPrinter.{h,cpp} before I make changes to these files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233448
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 27 Mar 2015 23:18:08 +0000 (23:18 +0000)]
[SCEV] Look at backedge dominating conditions.
Summary:
This change teaches ScalarEvolution::isLoopBackedgeGuardedByCond to look
at edges within the loop body that dominate the latch. We don't do an
exhaustive search for all possible edges, but only a quick walk up the
dom tree.
Reviewers: atrick, hfinkel
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8627
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233447
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 23:05:04 +0000 (23:05 +0000)]
Verifier: Check operands of MDType subclasses and MDCompileUnit
Add verify checks for `MDType` subclasses and for `MDCompileUnit`.
These new checks don't yet incorporate everything from `Verify()`, but
at least they sanity check the operands. Also downcast accessors as
possible.
A lot of these accessors can't be downcast as far as we'd like because
of arrays of typed objects (stored in a generic `MDTuple`) and
`MDString`-based type references. Eventually I'll port over `DIRef<>`
and `DITypedArray<>` from `DebugInfo.h` to clean those up as well.
Updated bitrotted testcases separately in r233415 and r233443 to reduce
churn on the off-chance this needs to be reverted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233446
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 23:00:49 +0000 (23:00 +0000)]
DebugInfo: Require non-null in DIBuilder::retainType()
Assert that a non-null value is being passed in. Note that I fixed the
one offender in clang in r233443.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233445
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 27 Mar 2015 22:31:12 +0000 (22:31 +0000)]
Fixing a bug with optimized catch-all handlers in WinEHPrepare
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233439
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 22:04:28 +0000 (22:04 +0000)]
Verifier: Call verifyModule() from llc and opt
Change `llc` and `opt` to run `verifyModule()`. This ensures that we
check the full module before `FunctionPass::doInitialization()` ever
gets called (I was getting crashes in `DwarfDebug` instead of verifier
failures when testing a WIP patch that checks operands of compile
units). In `opt`, also move up debug-info-stripping so that it still
runs before verification.
There was a fair bit of broken code that was sitting in tree.
Interestingly, some were cases of a `select` that referred to itself in
`-instcombine` tests (apparently an intermediate result). I split them
off to `*-noverify.ll` tests with RUN lines like this:
opt < %s -S -disable-verify -instcombine | opt -S | FileCheck %s
This avoids verifying the input file (so we can get the broken code into
`-instcombine), but still verifies the output with a second call to
`opt` (to verify that `-instcombine` will clean it up like it should).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233432
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 27 Mar 2015 21:45:49 +0000 (21:45 +0000)]
[CMake] Removing duplicates from the list of test suites to generate targets for.
Not doing this causes some headaches for users migrating from autoconf to CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233428
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 27 Mar 2015 21:45:18 +0000 (21:45 +0000)]
fix typo and 80-col; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233427
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 27 Mar 2015 21:34:24 +0000 (21:34 +0000)]
Add two small structs for readability in place of std::pair and std::tuple. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233422
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 27 Mar 2015 20:56:11 +0000 (20:56 +0000)]
Constrain the type of a parameter now that callers without this constraint have been removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233419
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 20:46:33 +0000 (20:46 +0000)]
DebugInfo: Fix bad debug info for compile units and types
Fix debug info in these tests, which started failing with a WIP patch to
verify compile units and types. The problems look like they were all
caused by bitrot. They fell into these categories:
- Using `!{i32 0}` instead of `!{}`.
- Using `!{null}` instead of `!{}`.
- Using `!MDExpression()` instead of `!{}`.
- Using `!8` instead of `!{!8}`.
- `file:` references that pointed at `MDCompileUnit`s instead of the
same `MDFile` as the compile unit.
- `file:` references that were numerically off-by-one or (off-by-ten).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233415
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 27 Mar 2015 20:41:42 +0000 (20:41 +0000)]
[R600/SI] Fix testcase check line.
Missing colon, instruction typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233414
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 27 Mar 2015 20:37:20 +0000 (20:37 +0000)]
[AArch64InstPrinter] Use the feature bits of the subtarget passed to the print
method.
This enables the instprinter to print a different system register name based on
the feature bits of the per-function subtarget.
Differential Revision: http://reviews.llvm.org/D8668
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233412
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 27 Mar 2015 20:36:02 +0000 (20:36 +0000)]
[MCInstPrinter] Enable MCInstPrinter to change its behavior based on the
per-function subtarget.
Currently, code-gen passes the default or generic subtarget to the constructors
of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which
enables some targets (AArch64, ARM, and X86) to change their instprinter's
behavior based on the subtarget feature bits. Since the backend can now use
different subtargets for each function, instprinter has to be changed to use the
per-function subtarget rather than the default subtarget.
This patch takes the first step towards enabling instprinter to change its
behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to
AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the
various print methods table-gen auto-generates.
I will follow up with changes to instprinters of AArch64, ARM, and X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233411
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 27 Mar 2015 20:35:49 +0000 (20:35 +0000)]
[CodeGen] Don't attempt a tail-call with a non-forwarded explicit sret.
Tailcalls are only OK with forwarded sret pointers. With explicit sret,
one approximation is to check that the pointer isn't an Instruction, as
in that case it might point into some local memory (alloca). That's not
OK with tailcalls.
Explicit sret counterpart to r233409.
Differential Revison: http://reviews.llvm.org/D8510
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233410
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 27 Mar 2015 20:28:30 +0000 (20:28 +0000)]
[CodeGen] Don't attempt a tail-call with implicit sret.
Tailcalls are only OK with forwarded sret pointers. With sret demotion,
they're not, as we'd have a pointer into a soon-to-be-dead stack frame.
Differential Revison: http://reviews.llvm.org/D8510
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233409
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 27 Mar 2015 20:13:55 +0000 (20:13 +0000)]
Recommit r233116 better: Remove a redundant instcombine involving bitcasts of geps of bitcasts
This just didn't need to be here at all, but the assertion I tried to
add wasn't appropriate either - the circumstance isn't impossible, it's
just not important to deal with it here - the gep-rooted version of this
instcombine will handle this case, we don't need to duplicate it for the
case where the gep happens to be used in a bitcast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233404
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Fri, 27 Mar 2015 19:10:06 +0000 (19:10 +0000)]
R600/SI: Fix VOP2 VI encoding
Broken by "R600/SI: Refactor VOP2 instruction defs".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233399
91177308-0d34-0410-b5e6-
96231b3b80d8
Anna Zaks [Fri, 27 Mar 2015 18:52:01 +0000 (18:52 +0000)]
[asan] Speed up isInterestingAlloca check
We make many redundant calls to isInterestingAlloca in the AddressSanitzier
pass. This is especially inefficient for allocas that have many uses. Let's
cache the results to speed up compilation.
The compile time improvements depend on the input. I did not see much
difference on benchmarks; however, I have a test case where compile time
goes from minutes to under a second.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233397
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Fri, 27 Mar 2015 18:51:42 +0000 (18:51 +0000)]
[bpf] add support for bpf pseudo instruction
Expose bpf pseudo load instruction via intrinsic. It is used by front-ends that
can encode file descriptors directly into IR instead of relying on relocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233396
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 27 Mar 2015 18:37:15 +0000 (18:37 +0000)]
[RegisterCoalescer] Refine the terminal rule to still consider the terminal
nodes.
When a node is terminal it is pushed at the end of the list of the copies to
coalesce instead of being completely ignored. In effect, this reduces its
priority over non-terminal nodes.
Because of that, we do not miss the rematerialization opportunities, nor the
copies that can be merged with more complex, than the terminal rule,
interference checks.
Related to PR22768.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233395
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 17:56:39 +0000 (17:56 +0000)]
LLParser: Require non-null scope for MDLocation and MDLocalVariable
Change `LLParser` to require a non-null `scope:` field for both
`MDLocation` and `MDLocalVariable`. There's no need to wait for the
verifier for this check. This also allows their `::getImpl()` methods
to assert that the incoming scope is non-null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233394
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 27 Mar 2015 17:51:30 +0000 (17:51 +0000)]
Remove superfluous .str() and replace std::string concatenation with Twine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233392
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 27 Mar 2015 17:31:15 +0000 (17:31 +0000)]
Add a -raw option to the -section mode of llvm-objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233390
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 17:29:58 +0000 (17:29 +0000)]
Verifier: Check fields of MDVariable subclasses
Check fields from `MDLocalVariable` and `MDGlobalVariable` and change
the accessors to downcast to the right types. `getType()` still returns
`Metadata*` since it could be an `MDString`-based reference.
Since local variables require non-null scopes, I also updated `LLParser`
to require a `scope:` field.
A number of testcases had grown bitrot and started failing with this
patch; I committed them separately in r233349. If I just broke your
out-of-tree testcases, you're probably hitting similar problems (so have
a look there).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233389
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 27 Mar 2015 17:29:11 +0000 (17:29 +0000)]
DebugInfo: Fix another bitrotted testcase
Fix another case of a missing `scope:` field on an `MDLocalVariable`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233388
91177308-0d34-0410-b5e6-
96231b3b80d8
Vladimir Sukharev [Fri, 27 Mar 2015 17:11:29 +0000 (17:11 +0000)]
[AArch64] Don't store available subtarget features in AArch64SysReg::SysRegMapper
Subtarget features must not be a part of the target machine. So, they are now not being stored in SysRegMapper, but provided each time fromString()/toString() are called
Reviewers: jmolloy
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8655
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233386
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Fri, 27 Mar 2015 16:53:06 +0000 (16:53 +0000)]
CMake: enable installing utils
Added a new boolean CMake flag, LLVM_INSTALL_UTILS. When set,
the 'install' target will include in the bin directory the
utils binaries - e.g. FileCheck. This mirrors the autoconfig
behavior.
Test Plan:
Locally verified that utils binaries are copied when flag is set,
and not copied when flag is not set.
Reviewers: jfb, dschuff, beanz
Reviewed By: beanz
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8587
Patch by Mircea Trofin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233385
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 27 Mar 2015 15:55:06 +0000 (15:55 +0000)]
Work around pr23045 and make it easier to reproduce.
Dropping old debug format requires the entire module to be read upfront.
This was failing only with the gold plugin, but that is just because
llvm-link was not upgrading metadata.
The new testcase using llvm-link shows the problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233381
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 27 Mar 2015 15:01:40 +0000 (15:01 +0000)]
Close unique sections when switching away from them.
It is not possible to switch back to unique secitons, so close them
automatically when switching away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233380
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 27 Mar 2015 13:52:12 +0000 (13:52 +0000)]
Fix subprogram-linkonce-weak.ll and subprogram-linkonce-weak-odr.ll for Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233375
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 27 Mar 2015 11:01:53 +0000 (11:01 +0000)]
[Support] Remove statically initialized yet dead code.
The last user of this code vanished with r223368, but this function still was
around being executed on every process start, allocating some memory and then
never being used again. No functional change.
Also avoids occasional complaints about the benign leak in this function, like
PR23037.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233371
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Fri, 27 Mar 2015 10:36:57 +0000 (10:36 +0000)]
Reapply r233175 and r233183: float2int.
This re-adds float2int to the tree, after fixing PR23038. It turns
out the argument to APSInt() is true-if-unsigned, rather than
true-if-signed :(. Added testcase and explanatory comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233370
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Fri, 27 Mar 2015 06:10:13 +0000 (06:10 +0000)]
Complete the MachineScheduler fix made way back in r210390.
"Fix the MachineScheduler's logic for updating ready times for in-order.
Now the scheduler updates a node's ready time as soon as it is
scheduled, before releasing dependent nodes."
This fix was only made in one variant of the ScheduleDAGMI driver.
Francois de Ferriere reported the issue in the other bit of code where
it was also needed.
I never got around to coming up with a test case, but it's an
obvious fix that shouldn't be delayed any longer.
I'll try to refactor this code a little better.
I did verify performance on a wide variety of targets and saw no
negative impact with this fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233366
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 27 Mar 2015 06:06:48 +0000 (06:06 +0000)]
[NFC] Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233365
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 27 Mar 2015 06:01:56 +0000 (06:01 +0000)]
[NFC] Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233363
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 27 Mar 2015 05:53:16 +0000 (05:53 +0000)]
Code cleanup [NFC]
The assertion here was more expensive then it needed to be. We're only inserting allocas in the entry block, so we only need to consider ones in the entry block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233362
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 27 Mar 2015 05:47:00 +0000 (05:47 +0000)]
More code cleanup [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233361
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 27 Mar 2015 05:39:32 +0000 (05:39 +0000)]
More code cleanup [NFC]
Minor naming, one potentially unsafe cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233359
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 27 Mar 2015 05:34:44 +0000 (05:34 +0000)]
Code simplification and style cleanup
All the removed assertions are either implied locally by the assert at the top of the function or properties of the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233358
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 27 Mar 2015 05:09:33 +0000 (05:09 +0000)]
Require a GC strategy be specified for functions which use gc.statepoint
This was discussed a while back and I left it optional for migration. Since it's been far more than the 'week or two' that was discussed, time to actually make this manditory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233357
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 27 Mar 2015 04:52:48 +0000 (04:52 +0000)]
Allow explicit spill slots to be specified for a gc.statepoint
This patch adds support for explicitly provided spill slots in the GC arguments of a gc.statepoint. This is somewhat analogous to gcroot, but leverages the STATEPOINT MI node and StackMap infrastructure. The motivation for this is:
1) The stack spilling code for gc.statepoints hasn't advanced as fast as I'd like. One major option is to give up on doing spilling in the backend and do it at the IR level instead. We'd give up the ability to have gc values in registers, but that's a minor cost in practice. We are not neccessarily moving in that direction, but having the ability to prototype such a thing cheaply is interesting.
2) I want to port the gcroot lowering to use the statepoint infastructure. Given the metadata printers for gcroot expect a fixed set of stack roots, it's easiest to just reuse the explicit stack slots and pass them directly to the underlying statepoint.
I'm holding off on the documentation for the new feature until I'm reasonable sure this is going to stick around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233356
91177308-0d34-0410-b5e6-
96231b3b80d8