Commit Graph

151554 Commits

Author SHA1 Message Date
Anna Thomas
f3a2f4ad16 [LoopUnrollRuntime] Support multiple exit blocks unrolling when prolog remainder generated
With the NFC refactoring in rL307417 (git SHA 987dd01), all the logic
is in place to support multiple exit/exiting blocks when prolog
remainder is generated.
This patch removed the assert that multiple exit blocks unrolling is only
supported when epilog remainder is generated.

Also, added test runs and checks with PROLOG prefix in
runtime-loop-multiple-exits.ll test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 20:12:32 +00:00
Craig Topper
9fec2431ce [PatternMatch] Implemenet m_SignMask using Constant::isMinSignedValue instead of doing splat detection and analyzing the resulting APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:56:23 +00:00
Craig Topper
7383d9c9fd [PatternMatch] Implement m_AnyZero using Constant::isZeroValue instead of ORing together isNullValue and isNegativeZeroValue. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:56:21 +00:00
Craig Topper
caa219e9a8 [PatternMatch] Implement m_One and m_AllOnes using Constant::isOneValue/isAllOnesValue instead of doing our own splat detection and checking the resulting APInt.
Should result in less compiled code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307431 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:56:20 +00:00
Craig Topper
8614bf0c87 [APInt] Add a fastpath for the single word case of isOneValue to match isNullValue, isAllOnesValue, etc. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:56:18 +00:00
Sanjay Patel
16c930ae14 [DAGCombiner] use local variable to shorten code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:34:42 +00:00
Quentin Colombet
4e13bac06c [RegAllocFast] Don't insert kill flags of super-register for partial kill
When reusing a register for a new definition, the fast register allocator
used to insert a kill flag at the previous last use of that register to
inform later passes that this register is free between the redef and the
last use. However, this may be wrong when subregisters are involved.
Indeed, a partially redef would have trigger a kill of the full super
register, potentially wrongly marking all the other subregisters as
free. Given we don't track which lanes are still live, we cannot set the
kill flag in such case.

Note: This bug has been latent for about 7 years (r104056).

llvmg.org/PR33677

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307428 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:25:45 +00:00
Quentin Colombet
b8caa0933a [RegAllocFast] Add the proper initialize method to use the .mir infrastructure
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307427 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:25:42 +00:00
Zachary Turner
0faf466014 [llvm-pdbutil] Fix build.
Some platforms require an explicit specialization of std::hash
for PdbRaw_FeaturesSig.  Also a test involving case sensitivity
needed to be fixed.  For now that particular check just accepts
any path even if they're completely different.  Long term we
should output paths in the correct case to match MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 19:00:06 +00:00
Davide Italiano
5c0bc9394d [Local] Update the comment for removeUnreachableBlocks.
It referenced a wrong function name, and didn't mention what the
second argument did. This should be slightly more accurate now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:54:14 +00:00
Matthias Braun
44a5145435 FuzzerUtilDarwin.cpp: We need to pass modifiable strings to posix_spawn
This fixes a bug where unmodifiable strings where passed to posix_spawn.

This is an attempt to unbreak the greendragon libFuzzer bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:53:24 +00:00
Zachary Turner
f8cc5477f0 Use windows path syntax when writing PDB module name.
Without this we would just append whatever the user
wrote on the command line, so if we're in C:\foo
and we run lld-link bar/baz.obj, we would write
C:\foo\bar/baz.obj in various places in the PDB.
MSVC linker does not do this, so we shouldn't either.
This fixes some differences in the diff test, so we
update the test as well.

Differential Revision: https://reviews.llvm.org/D35092

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:46:14 +00:00
Zachary Turner
b85b70f834 Fix some differences between lld and MSVC generated PDBs.
A couple of things were different about our generated PDBs.

1) We were outputting the wrong Version on the PDB Stream.
   The version we were setting was newer than what MSVC is setting.
   It's not clear what the implications are, but we change LLD
   to use PdbImplVC70, as MSVC does.
2) For the optional debug stream indices in the DBI Stream, we
   were outputting 0 to mean "the stream is not present".  MSVC
   outputs uint16_t(-1), which is the "correct" way to specify
   that a stream is not present.  So we fix that as well.
3) We were setting the PDB Stream signature to 0.  This is supposed
   to be the result of calling time(nullptr).  Although this leads
   to non-deterministic builds, a better way to solve that is by
   having a command line option explicitly for generating a
   reproducible build, and have the default behavior of lld-link
   match the default behavior of link.

To test this, I'm making use of the new and improved `pdb diff`
sub command.  To make it suitable for writing tests against, I had
to modify the diff subcommand slightly to print less verbose output.
Previously it would always print | <column> | <value1> | <value2> |
which is quite verbose, and the values are fragile.  All we really
want to know is "did we produce the same value as link?"  So I added
command line options to print a single character representing the
result status (different, identical, equivalent), and another to
hide the value display.  Note that just inspecting the diff output
used to write the test, you can see some things that are obviously
wrong.  That is just reflective of the fact that this is the state
of affairs today, not that we're asserting that this is "correct".
We can use this as a starting point to discover differences, fix
them, and update the test.

Differential Revision: https://reviews.llvm.org/D35086

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:45:56 +00:00
Zachary Turner
3324d0bf04 [llvm-pdbutil] Improve diff mode.
We're getting to the point that some MS tools (e.g. DIA) can recognize
our PDBs but others (e.g. link.exe) cannot. I think the way forward is
to improve our tooling to help us find differences more easily. For
example, if we can compile the same program with clang-cl and cl and
have a tool tell us all the places where the PDBs differ, this could
tell us what we're doing wrong. It's tricky though, because there are a
lot of "benign" differences in a PDB. For example, if the string table
in one PDB consists of "foo" followed by "bar" and in the other PDB it
consists of "bar" followed by "foo", this is not necessarily a critical
difference, as long as the uses of these strings also refer to the
correct location. On the other hand, if the second PDB doesn't even
contain the string "foo" at all, this is a critical difference.

diff mode has been in llvm-pdbutil for quite a while, but because of the
above challenge along with some others, it's been hard to make it
useful. I think this patch addresses that. It looks for all the same
things, but it now prints the output in tabular format (carefully
formatted and aligned into tables and fields), and it highlights
critical differences in red, non-critical differences in yellow, and
identical fields in green.  This makes it easy to spot the places we
differ, and the general concept of outputting arbitrary fields in
tabular format can be extended to provide analysis into many of the
different types of information that show up in a PDB.

Differential Revision: https://reviews.llvm.org/D35039

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:45:37 +00:00
Craig Topper
41cafc737b vim: add 'builtin', 'nobuiltin', 'nonnull', and 'speculatable' to the keyword list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:28:45 +00:00
Gor Nishanov
d73686e841 [cloning] Do not duplicate types when cloning functions
Summary:
This is an addon to the change rl304488 cloning fixes. (Originally rl304226 reverted rl304228 and reapplied rl304488 https://reviews.llvm.org/D33655)

rl304488 works great when DILocalVariables that comes from the inlined function has a 'unique-ed' type, but,
in the case when the variable type is distinct we will create a second DILocalVariable in the scope of the original function that was inlined.

Consider cloning of the following function:
```
define private void @f() !dbg !5 {
  %1 = alloca i32, !dbg !11
  call void @llvm.dbg.declare(metadata i32* %1, metadata !14, metadata !12), !dbg !18
  ret void, !dbg !18
}

!14 = !DILocalVariable(name: "inlined", scope: !15, file: !6, line: 5, type: !17) ; came from an inlined function
!15 = distinct !DISubprogram(name: "inlined", linkageName: "inlined", scope: null, file: !6, line: 8, type: !7, isLocal: true, isDefinition: true, scopeLine: 9, isOptimized: false, unit: !0, variables: !16)
!16 = !{!14}
!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "some_struct", size: 32, align: 32)
```

Without this fix, when function 'f' is cloned, we will create another DILocalVariable for "inlined", due to its type being distinct.

```
define private void @f.1() !dbg !23 {
  %1 = alloca i32, !dbg !26
  call void @llvm.dbg.declare(metadata i32* %1, metadata !28, metadata !12), !dbg !30
  ret void, !dbg !30
}

!14 = !DILocalVariable(name: "inlined", scope: !15, file: !6, line: 5, type: !17)
!15 = distinct !DISubprogram(name: "inlined", linkageName: "inlined", scope: null, file: !6, line: 8, type: !7, isLocal: true, isDefinition: true, scopeLine: 9, isOptimized: false, unit: !0, variables: !16)
!16 = !{!14}
!17 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "some_struct", size: 32, align: 32)
 ;
!28 = !DILocalVariable(name: "inlined", scope: !15, file: !6, line: 5, type: !29) ; OOPS second DILocalVariable
!29 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "some_struct", size: 32, align: 32)
```

Now we have two DILocalVariable for "inlined" within the same scope. This result in assert in AsmPrinter/DwarfDebug.h:131: void llvm::DbgVariable::addMMIEntry(const llvm::DbgVariable &): Assertion `V.Var == Var && "conflicting variable"' failed.
(Full example: See: https://bugs.llvm.org/show_bug.cgi?id=33492)

In this change we prevent duplication of types so that when a metadata for DILocalVariable is cloned it will get uniqued to the same metadate node as an original variable.

Reviewers: loladiro, dblaikie, aprantl, echristo

Reviewed By: loladiro

Subscribers: EricWF, llvm-commits

Differential Revision: https://reviews.llvm.org/D35106

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307418 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:24:20 +00:00
Anna Thomas
987dd01d1b [LoopUnrollRuntime] NFC: use the precomputed loop exit in ConnectProlog
Minor refactoring to use the preexisting loop exit that's already
calculated. We do not need to recompute the loop exit in ConnectProlog.
Apart from avoiding redundant computation, this is required for
supporting multiple loop exits when Prolog remainder loops are generated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 18:05:28 +00:00
Tony Jiang
9163803bf0 [PPC CodeGen] Expand the bitreverse.i32 intrinsic.
Differential Revision: https://reviews.llvm.org/D33572
Fix PR: https://bugs.llvm.org/show_bug.cgi?id=33093

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 16:41:55 +00:00
Simon Pilgrim
2541a59ac3 Fix some more -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 16:40:06 +00:00
Matthew Simpson
94fdc9b458 [ARM] Implement interleaved access bug fix from r306334
r306334 fixed a bug in AArch64 dealing with wide interleaved accesses having
pointer types. The bug also exists in ARM, so this patch copies over the fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 16:15:05 +00:00
Sam Kolton
f9327929eb [AMDGPU] Assembler: refactor convert methods (VOP3 and MIMG)
Summary: Simplified converter methods for VOP3 and MIMG.

Reviewers: dp, artem.tamazov

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, vpykhtin, t-tye

Differential Revision: https://reviews.llvm.org/D35047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 15:21:52 +00:00
Rafael Espindola
2e124626b4 Fix variable names. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 15:20:55 +00:00
Sanjay Patel
b1044ac0c1 [x86] add SBB optimization for SETAE (uge) condition code
x86 scalar select-of-constants (Cond ? C1 : C2) combining/lowering is a mess 
with missing optimizations. We handle some patterns, but miss logical variants.

To clean that up, we should convert all select-of-constants to logic/math and 
enhance the combining for the expected patterns from that. DAGCombiner already 
has the foundation to allow the transforms, so we just need to fill in the holes 
for x86 math op lowering. Selecting 0 or -1 needs extra attention to produce the
optimal code as shown here.

Attempt to verify that all of these IR forms are logically equivalent:
http://rise4fun.com/Alive/plxs

Earlier steps in this series:
rL306040
rL306072

Differential Revision: https://reviews.llvm.org/D34652


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 14:56:20 +00:00
Sanjay Patel
28bebe46a8 [DemandedBits] fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 14:39:26 +00:00
Dmitry Preobrazhensky
c956bf87e0 [AMDGPU][mc][gfx9] Added support of op_sel/op_sel_hi for V_MAD_MIX*
See https://bugs.llvm.org//show_bug.cgi?id=33595

Reviewers: vpykhtin, artem.tamazov, arsenm

Differential Revision: https://reviews.llvm.org/D35021

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307402 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 14:29:06 +00:00
Chad Rosier
86dfeddc70 [ValueTracking] Fix the identity case (LHS => RHS) when the LHS is false.
Prior to this commit both of the added test cases were passing.  However, in the
latter case (test7) we were doing a lot more work to arrive at the same answer
(i.e., we were using isImpliedCondMatchingOperands() to determine the
implication.).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307400 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 13:55:55 +00:00
Andrew V. Tischenko
255ac753d5 NFC: I simply added CHECK-LABEL to prevent false matches in the tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 13:41:33 +00:00
Simon Pilgrim
5e45678e17 [Lanai] Fix -Wimplicit-fallthrough warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307396 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 13:22:47 +00:00
Simon Pilgrim
3b6486c8f9 [Hexagon] Fix some more -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307395 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 13:21:43 +00:00
Simon Pilgrim
8cbd9aac54 [AArch64] Fix -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 13:03:28 +00:00
Anna Thomas
25f28db283 [SafepointIRVerifier] Avoid false positives in GC verifier for compare between pointers
Today the safepoint IR verifier catches some unrelocated uses of base
pointers that are actually valid.

With this change, we narrow down the set of false positives.
Specifically, the verifier knows about compares to null and compares
between 2 unrelocated pointers.

Reviewed by: skatkov

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D35057

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307392 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 13:02:29 +00:00
Florian Hahn
287aa279ce [AArch64] Use 16 bytes as preferred function alignment on Cortex-A57.
Summary:
This change gives a 0.89% speed on execution time, a 0.94% improvement
in benchmark scores and a 0.62% increase in binary size on a Cortex-A57.
These numbers are the geomean results on a wide range of benchmarks from
the test-suite, SPEC2000, SPEC2006 and a range of proprietary suites.

The software optimization guide for the Cortex-A57 recommends 16 byte
branch alignment.

Reviewers: t.p.northover, mcrosier, javed.absar, kristof.beyls, sbaranga

Reviewed By: kristof.beyls

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: https://reviews.llvm.org/D34954

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307389 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:43:01 +00:00
Daniel Jasper
9889fe2290 Fix uninitalized memory access introduced in r307350.
Found by MSAN :).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:23:13 +00:00
Simon Pilgrim
daa5b43a38 [PowerPC] Fix -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307382 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:21:44 +00:00
Simon Pilgrim
26aa51226a [AMDGPU] Fix -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307381 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:18:57 +00:00
Florian Hahn
d04ee305d8 [AArch64] Use 16 bytes as preferred function alignment on Cortex-A72.
Summary:
This change gives a 0.34% speed on execution time, a 0.61% improvement
in benchmark scores and a 0.57% increase in binary size on a Cortex-A72.
These numbers are the geomean results on a wide range of benchmarks from
the test-suite, SPEC2000, SPEC2006 and a range of proprietary suites.

The software optimization guide for the Cortex-A72 recommends 16 byte
branch alignment.


Reviewers: t.p.northover, kristof.beyls, rengolin, sbaranga, mcrosier, javed.absar

Reviewed By: kristof.beyls

Subscribers: llvm-commits, aemerson

Differential Revision: https://reviews.llvm.org/D34961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307380 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:15:49 +00:00
Simon Pilgrim
4a533c58e1 [Sparc] Fix -Wimplicit-fallthrough warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:14:46 +00:00
Alex Lorenz
9976ad92c3 Update the Windows version of updateTripleOSVersion to account for
changes in r307372


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307377 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:08:52 +00:00
Simon Pilgrim
03251f283c [SystemZ] Fix -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307376 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:07:09 +00:00
Simon Pilgrim
1289f803e2 [Arm] Fix -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:05:45 +00:00
Simon Pilgrim
244313d541 [Hexagon] Fix -Wimplicit-fallthrough warnings. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307374 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 10:04:12 +00:00
Alex Lorenz
25b2f9273d [Support] sys::getProcessTriple should return a macOS triple using
the system's version of macOS

sys::getProcessTriple returns LLVM_HOST_TRIPLE, whose system version might not
be the actual version of the system on which the compiler running. This commit
ensures that, for macOS, sys::getProcessTriple returns a triple with the
system's macOS version.

rdar://33177551

Differential Revision: https://reviews.llvm.org/D34446


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307372 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 09:53:47 +00:00
Florian Hahn
20cee5d628 [AArch64] Add test case for preferred function alignment (NFC).
Reviewers: evandro, joelkevinjones, mcrosier

Reviewed By: joelkevinjones, mcrosier

Subscribers: mcrosier, aemerson, llvm-commits, rengolin, evandro, javed.absar, joelkevinjones, kristof.beyls

Differential Revision: https://reviews.llvm.org/D34951

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307369 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 09:17:53 +00:00
Diana Picus
4f529ec57c [ARM] GlobalISel: Fixup r307365
Rename member DebugLoc -> DbgLoc (so it doesn't conflict with the class
name).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 08:53:27 +00:00
Diana Picus
a479e53b55 [ARM] GlobalISel: Select hard G_FCMP for s32
We lower to a sequence consisting of:
- MOVi 0 into a register
- VCMPS to do the actual comparison and set the VFP flags
- FMSTAT to move the flags out of the VFP unit
- MOVCCi to either use the "zero register" that we have previously set
  with the MOVi, or move 1 into the result register, based on the values
  of the flags

As was the case with soft-float, for some predicates (one, ueq) we
actually need two comparisons instead of just one. When that happens, we
generate two VCMPS-FMSTAT-MOVCCi sequences and chain them by means of
using the result of the first MOVCCi as the "zero register" for the
second one. This is a bit overkill, since one comparison followed by
two non-flag-setting conditional moves should be enough. In any case,
the backend manages to CSE one of the comparisons away so it doesn't
matter much.

Note that unlike SelectionDAG and FastISel, we always use VCMPS, and not
VCMPES. This makes the code a lot simpler, and it also seems correct
since the LLVM Lang Ref defines simple true/false returns if the
operands are QNaN's. For SNaN's, even VCMPS throws an Invalid Operand
exception, so they won't be slipping through unnoticed.

Implementation-wise, this introduces a template so we can share the same
code that we use for handling integer comparisons, since the only
differences are in the details (exact opcodes to be used etc). Hopefully
this will be easy to extend to s64 G_FCMP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 08:39:04 +00:00
Craig Topper
dc02fd0b4d [TableGen] Cleanup capturing of instruction namespace for the fast isel emitter to remove a std::string and duplicated code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307363 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 06:22:36 +00:00
Craig Topper
77eddb74c0 [TableGen] Use StringRef instead of std::string for CodeGenInstruction namespace. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307362 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 06:22:35 +00:00
Craig Topper
2986f4761d [TableGen] Add a proper namespace to an Instruction in an AsmMatcher test. This is required after r307358.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307361 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 05:50:45 +00:00
Rafael Espindola
ef8ed10be5 Reduce code duplication.
By addding a mapNameToDWARFSection we only need to check section names
in one place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307359 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 05:36:53 +00:00
Craig Topper
3e595d0a2b [TableGen] Fix some mismatches in the use of Namespace fields versus Target name in some of our emitters.
Some of our emitters were using the name of the Target to reference things that were created by others emitters using Namespace.

Apparently all targets have the same Target name as their instruction and register Namespace field?

Someone on IRC had a target that didn't do this and was getting build errors. This patch is a necessary, but maybe not sufficient fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307358 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 05:19:25 +00:00