platform/upstream/llvm.git
9 years agoUse new MachineInstr mayLoadOrStore() API.
Chad Rosier [Thu, 21 May 2015 21:59:57 +0000 (21:59 +0000)]
Use new MachineInstr mayLoadOrStore() API.

llvm-svn: 237965

9 years ago[InlineSpiller] Fix rematerialization for bundles.
Quentin Colombet [Thu, 21 May 2015 21:41:55 +0000 (21:41 +0000)]
[InlineSpiller] Fix rematerialization for bundles.

Prior to this patch, we could update the operand of another MI in the same
bundle.

Longer version:
Before InlineSpiller rematerializes a vreg, it iterates over operands of each MI
in a bundle, collecting all (MI, OpNo) pairs that reference that vreg.

Then if it does rematerialize, it goes through the pair list and replaces the
operands with the new (rematerialized) vreg.  The problem is, it tries to
replace all of these operands in the main MI ! This works fine for single MIs.
However, if we are processing a bundle of MIs and the list contains multiple
pairs - the rematerialization will either crash trying to access a non-existing
operand of the main MI, or silently corrupt one of the existing ones. It will
also ignore other MIs in the bundle.

The obvious fix is to use the MI pointers saved in collected (MI, OpNo) pairs.
This must have been the original intent of the pair list but somehow these
pointers got lost.

Patch by Dmitri Shtilman <dshtilman@icloud.com>!

Differential revision: http://reviews.llvm.org/D9904

<rdar://problem/21002163>

llvm-svn: 237964

9 years ago[AArch64] Enhance the load/store optimizer with target-specific alias analysis.
Chad Rosier [Thu, 21 May 2015 21:36:46 +0000 (21:36 +0000)]
[AArch64] Enhance the load/store optimizer with target-specific alias analysis.

Phabricator: http://reviews.llvm.org/D9863
llvm-svn: 237963

9 years agofix typo in comment; NFC
Sanjay Patel [Thu, 21 May 2015 21:29:13 +0000 (21:29 +0000)]
fix typo in comment; NFC

llvm-svn: 237962

9 years agoMake it easier to use DwarfContext with MCJIT
Keno Fischer [Thu, 21 May 2015 21:24:32 +0000 (21:24 +0000)]
Make it easier to use DwarfContext with MCJIT

Summary:
This supersedes http://reviews.llvm.org/D4010, hopefully properly
dealing with the JIT case and also adds an actual test case.
DwarfContext was basically already usable for the JIT (and back when
we were overwriting ELF files it actually worked out of the box by
accident), but in order to resolve relocations correctly it needs
to know the load address of the section.
Rather than trying to get this out of the ObjectFile or requiring
the user to create a new ObjectFile just to get some debug info,
this adds the capability to pass in that info directly.
As part of this I separated out part of the LoadedObjectInfo struct
from RuntimeDyld, since it is now required at a higher layer.

Reviewers: lhames, echristo

Reviewed By: echristo

Subscribers: vtjnash, friss, rafael, llvm-commits

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

llvm-svn: 237961

9 years agoPut GEPOperator member function definition in the appropriate .cpp file
David Blaikie [Thu, 21 May 2015 21:17:12 +0000 (21:17 +0000)]
Put GEPOperator member function definition in the appropriate .cpp file

Last commit put it in Constants.cpp instead of Operator.cpp

llvm-svn: 237960

9 years agoOne line fix - bug with final clause of task construct
Jonathan Peyton [Thu, 21 May 2015 21:16:38 +0000 (21:16 +0000)]
One line fix - bug with final clause of task construct

Should be looking at parent_task->td_flags.final instead of the recently allocated task.

llvm-svn: 237959

9 years ago[opaque pointer type] Allow gep_type_iterator to work with the pointee type from...
David Blaikie [Thu, 21 May 2015 21:12:43 +0000 (21:12 +0000)]
[opaque pointer type] Allow gep_type_iterator to work with the pointee type from the GEP instruction

The raw non-instruction/constant form of this is still relying on being
able to access the pointee type from a pointer type - those will be
cleaned up later. For now, just focus on the cases where the pointee
type is easily accessible.

llvm-svn: 237958

9 years agoStop forwarding (get|set)Aligment from MCSectionData to MCSection.
Rafael Espindola [Thu, 21 May 2015 21:02:35 +0000 (21:02 +0000)]
Stop forwarding (get|set)Aligment from MCSectionData to MCSection.

llvm-svn: 237956

9 years ago[MachineInstr] Add mayLoadOrStore API. NFC.
Chad Rosier [Thu, 21 May 2015 21:00:30 +0000 (21:00 +0000)]
[MachineInstr] Add mayLoadOrStore API. NFC.

llvm-svn: 237955

9 years agoResubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format).
Alex Lorenz [Thu, 21 May 2015 20:54:45 +0000 (20:54 +0000)]
Resubmit r237708 (MIR Serialization: print and parse LLVM IR using MIR format).

This commit is a 2nd attempt at committing the initial MIR serialization patch.
The first commit (r237708) made the incremental buildbots unstable and was
reverted in r237730. The original commit didn't add a terminating null
character to the LLVM IR source which was passed to LLParser, and this
sometimes caused the test 'llvmIR.mir' to fail with a parsing error because
the LLVM IR source didn't have a null character immediately after the end
and thus LLLexer encountered some garbage characters that ultimately caused
the error.

This commit also includes the other test fixes I committed in
r237712 (llc path fix) and r237723 (remove target triple) which
also got reverted in r237730.

--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

llvm-svn: 237954

9 years agoAdded a new command in ProcessGDBRemote that can figure out the performance character...
Greg Clayton [Thu, 21 May 2015 20:52:06 +0000 (20:52 +0000)]
Added a new command in ProcessGDBRemote that can figure out the performance characterisitics of your GDB remote server.

To addess this, attach to any GDB server and when stopped type:

(lldb) process plugin packet speed-test

The default will send a variety of packets with different amounts of data to send/receive and print the performance of each packet type:

Testing sending 1000 packets of various sizes:
qSpeedTest(send=0      , recv=0      ) in 0.057837000 sec for  17289.97 packets/sec (  0.057837 ms per packet) with standard deviation of   0.007705 ms
qSpeedTest(send=0      , recv=4      ) in 0.056162000 sec for  17805.63 packets/sec (  0.056162 ms per packet) with standard deviation of   0.004439 ms
qSpeedTest(send=0      , recv=8      ) in 0.057687000 sec for  17334.93 packets/sec (  0.057687 ms per packet) with standard deviation of   0.008135 ms
qSpeedTest(send=0      , recv=16     ) in 0.058547000 sec for  17080.29 packets/sec (  0.058547 ms per packet) with standard deviation of   0.005884 ms
qSpeedTest(send=0      , recv=32     ) in 0.058289000 sec for  17155.89 packets/sec (  0.058289 ms per packet) with standard deviation of   0.004057 ms
qSpeedTest(send=0      , recv=64     ) in 0.061324000 sec for  16306.83 packets/sec (  0.061324 ms per packet) with standard deviation of   0.010838 ms
qSpeedTest(send=0      , recv=128    ) in 0.065688000 sec for  15223.48 packets/sec (  0.065688 ms per packet) with standard deviation of   0.006997 ms
qSpeedTest(send=0      , recv=256    ) in 0.070621000 sec for  14160.09 packets/sec (  0.070621 ms per packet) with standard deviation of   0.006188 ms
qSpeedTest(send=0      , recv=512    ) in 0.086738000 sec for  11528.97 packets/sec (  0.086738 ms per packet) with standard deviation of   0.007867 ms
qSpeedTest(send=0      , recv=1024   ) in 0.146375000 sec for   6831.77 packets/sec (  0.146375 ms per packet) with standard deviation of   0.010313 ms
qSpeedTest(send=4      , recv=0      ) in 0.057807000 sec for  17298.94 packets/sec (  0.057807 ms per packet) with standard deviation of   0.009702 ms
....

It will then also use various sizes to receive 4MB of data from the GDB server and print out the stats:

Testing receiving 4.0MB of data using varying receive packet sizes:
qSpeedTest(send=0      , recv=32     ) 131072 packets needed to receive 4.0MB in 7.721290000 sec for 0.518048 MB/sec for  16975.40 packets/sec (  0.058909 ms per packet)
qSpeedTest(send=0      , recv=64     )  65536 packets needed to receive 4.0MB in 4.029236000 sec for 0.992744 MB/sec for  16265.12 packets/sec (  0.061481 ms per packet)
qSpeedTest(send=0      , recv=128    )  32768 packets needed to receive 4.0MB in 2.233854000 sec for 1.790627 MB/sec for  14668.82 packets/sec (  0.068172 ms per packet)
qSpeedTest(send=0      , recv=256    )  16384 packets needed to receive 4.0MB in 1.160024000 sec for 3.448204 MB/sec for  14123.84 packets/sec (  0.070802 ms per packet)
qSpeedTest(send=0      , recv=512    )   8192 packets needed to receive 4.0MB in 0.701603000 sec for 5.701230 MB/sec for  11676.12 packets/sec (  0.085645 ms per packet)
qSpeedTest(send=0      , recv=1024   )   4096 packets needed to receive 4.0MB in 0.596786000 sec for 6.702570 MB/sec for   6863.43 packets/sec (  0.145700 ms per packet)

There is a JSON mode so we can use this in the test suite to track GDB server performance for each platform:

(lldb) process plugin packet speed-test --json
{ "packet_speeds" : {
    "num_packets" : 1000,
    "results" : [
     {"send_size" :      0, "recv_size" :      0, "total_time_nsec" :     64516000, "standard_deviation_nsec" :     20566 },
     {"send_size" :      0, "recv_size" :      4, "total_time_nsec" :     59648000, "standard_deviation_nsec" :     10493 },
     {"send_size" :      0, "recv_size" :      8, "total_time_nsec" :     56894000, "standard_deviation_nsec" :      5480 },
     {"send_size" :      0, "recv_size" :     16, "total_time_nsec" :     59422000, "standard_deviation_nsec" :      6557 },
     {"send_size" :      0, "recv_size" :     32, "total_time_nsec" :     61159000, "standard_deviation_nsec" :     12384 },
     {"send_size" :      0, "recv_size" :     64, "total_time_nsec" :     61386000, "standard_deviation_nsec" :      9208 },
     {"send_size" :      0, "recv_size" :    128, "total_time_nsec" :     64768000, "standard_deviation_nsec" :      4737 },
     {"send_size" :      0, "recv_size" :    256, "total_time_nsec" :     71046000, "standard_deviation_nsec" :      5904 },
     {"send_size" :      0, "recv_size" :    512, "total_time_nsec" :     87233000, "standard_deviation_nsec" :      8967 },
     {"send_size" :      0, "recv_size" :   1024, "total_time_nsec" :    146629000, "standard_deviation_nsec" :      9526 },
     {"send_size" :      4, "recv_size" :      0, "total_time_nsec" :     57131000, "standard_deviation_nsec" :      7884 },
     {"send_size" :      4, "recv_size" :      4, "total_time_nsec" :     56772000, "standard_deviation_nsec" :      6064 },
     {"send_size" :      4, "recv_size" :      8, "total_time_nsec" :     57450000, "standard_deviation_nsec" :      6341 },
     {"send_size" :      4, "recv_size" :     16, "total_time_nsec" :     58279000, "standard_deviation_nsec" :      5998 },
     {"send_size" :      4, "recv_size" :     32, "total_time_nsec" :     59995000, "standard_deviation_nsec" :      6294 },
     {"send_size" :      4, "recv_size" :     64, "total_time_nsec" :     61632000, "standard_deviation_nsec" :      7838 },
     {"send_size" :      4, "recv_size" :    128, "total_time_nsec" :     66535000, "standard_deviation_nsec" :      8026 },
     {"send_size" :      4, "recv_size" :    256, "total_time_nsec" :     72754000, "standard_deviation_nsec" :      9519 },
     {"send_size" :      4, "recv_size" :    512, "total_time_nsec" :     87072000, "standard_deviation_nsec" :      9268 },
     {"send_size" :      4, "recv_size" :   1024, "total_time_nsec" :    147221000, "standard_deviation_nsec" :      9702 },
     {"send_size" :      8, "recv_size" :      0, "total_time_nsec" :     57900000, "standard_deviation_nsec" :      7356 },
     {"send_size" :      8, "recv_size" :      4, "total_time_nsec" :     58116000, "standard_deviation_nsec" :      7630 },
     {"send_size" :      8, "recv_size" :      8, "total_time_nsec" :     57745000, "standard_deviation_nsec" :      8541 },
     {"send_size" :      8, "recv_size" :     16, "total_time_nsec" :     59091000, "standard_deviation_nsec" :      7851 },
     {"send_size" :      8, "recv_size" :     32, "total_time_nsec" :     59943000, "standard_deviation_nsec" :      6761 },
     {"send_size" :      8, "recv_size" :     64, "total_time_nsec" :     62097000, "standard_deviation_nsec" :      8580 },
     {"send_size" :      8, "recv_size" :    128, "total_time_nsec" :     69942000, "standard_deviation_nsec" :     16645 },
     {"send_size" :      8, "recv_size" :    256, "total_time_nsec" :     72927000, "standard_deviation_nsec" :     11031 },
     {"send_size" :      8, "recv_size" :    512, "total_time_nsec" :     87221000, "standard_deviation_nsec" :      8002 },
     {"send_size" :      8, "recv_size" :   1024, "total_time_nsec" :    148696000, "standard_deviation_nsec" :     10383 },
     {"send_size" :     16, "recv_size" :      0, "total_time_nsec" :     59890000, "standard_deviation_nsec" :     15160 },
     {"send_size" :     16, "recv_size" :      4, "total_time_nsec" :     56664000, "standard_deviation_nsec" :      4650 },
     {"send_size" :     16, "recv_size" :      8, "total_time_nsec" :     57574000, "standard_deviation_nsec" :      7787 },
     {"send_size" :     16, "recv_size" :     16, "total_time_nsec" :     59312000, "standard_deviation_nsec" :      8104 },
     {"send_size" :     16, "recv_size" :     32, "total_time_nsec" :     59764000, "standard_deviation_nsec" :      7496 },
     {"send_size" :     16, "recv_size" :     64, "total_time_nsec" :     61644000, "standard_deviation_nsec" :      8331 },
     {"send_size" :     16, "recv_size" :    128, "total_time_nsec" :     66476000, "standard_deviation_nsec" :      9251 },
     {"send_size" :     16, "recv_size" :    256, "total_time_nsec" :     72386000, "standard_deviation_nsec" :      8627 },
     {"send_size" :     16, "recv_size" :    512, "total_time_nsec" :     87810000, "standard_deviation_nsec" :     12318 },
     {"send_size" :     16, "recv_size" :   1024, "total_time_nsec" :    146918000, "standard_deviation_nsec" :     11595 },
     {"send_size" :     32, "recv_size" :      0, "total_time_nsec" :     56493000, "standard_deviation_nsec" :      6577 },
     {"send_size" :     32, "recv_size" :      4, "total_time_nsec" :     57069000, "standard_deviation_nsec" :      5931 },
     {"send_size" :     32, "recv_size" :      8, "total_time_nsec" :     57563000, "standard_deviation_nsec" :      8157 },
     {"send_size" :     32, "recv_size" :     16, "total_time_nsec" :     59694000, "standard_deviation_nsec" :      6932 },
     {"send_size" :     32, "recv_size" :     32, "total_time_nsec" :     60852000, "standard_deviation_nsec" :      8010 },
     {"send_size" :     32, "recv_size" :     64, "total_time_nsec" :     61926000, "standard_deviation_nsec" :      8372 },
     {"send_size" :     32, "recv_size" :    128, "total_time_nsec" :     66734000, "standard_deviation_nsec" :      8047 },
     {"send_size" :     32, "recv_size" :    256, "total_time_nsec" :     72000000, "standard_deviation_nsec" :      8103 },
     {"send_size" :     32, "recv_size" :    512, "total_time_nsec" :     88268000, "standard_deviation_nsec" :     12289 },
     {"send_size" :     32, "recv_size" :   1024, "total_time_nsec" :    147946000, "standard_deviation_nsec" :     12122 },
     {"send_size" :     64, "recv_size" :      0, "total_time_nsec" :     58126000, "standard_deviation_nsec" :      5895 },
     {"send_size" :     64, "recv_size" :      4, "total_time_nsec" :     58927000, "standard_deviation_nsec" :      8933 },
     {"send_size" :     64, "recv_size" :      8, "total_time_nsec" :     58163000, "standard_deviation_nsec" :      6663 },
     {"send_size" :     64, "recv_size" :     16, "total_time_nsec" :     59901000, "standard_deviation_nsec" :      8340 },
     {"send_size" :     64, "recv_size" :     32, "total_time_nsec" :     60365000, "standard_deviation_nsec" :      6319 },
     {"send_size" :     64, "recv_size" :     64, "total_time_nsec" :     61776000, "standard_deviation_nsec" :      7461 },
     {"send_size" :     64, "recv_size" :    128, "total_time_nsec" :     66984000, "standard_deviation_nsec" :      6810 },
     {"send_size" :     64, "recv_size" :    256, "total_time_nsec" :     73913000, "standard_deviation_nsec" :      8826 },
     {"send_size" :     64, "recv_size" :    512, "total_time_nsec" :     88134000, "standard_deviation_nsec" :      8356 },
     {"send_size" :     64, "recv_size" :   1024, "total_time_nsec" :    146932000, "standard_deviation_nsec" :      7571 },
     {"send_size" :    128, "recv_size" :      0, "total_time_nsec" :     57616000, "standard_deviation_nsec" :      6158 },
     {"send_size" :    128, "recv_size" :      4, "total_time_nsec" :     59091000, "standard_deviation_nsec" :      7458 },
     {"send_size" :    128, "recv_size" :      8, "total_time_nsec" :     60263000, "standard_deviation_nsec" :     11999 },
     {"send_size" :    128, "recv_size" :     16, "total_time_nsec" :     59238000, "standard_deviation_nsec" :      6102 },
     {"send_size" :    128, "recv_size" :     32, "total_time_nsec" :     60783000, "standard_deviation_nsec" :      6244 },
     {"send_size" :    128, "recv_size" :     64, "total_time_nsec" :     62975000, "standard_deviation_nsec" :      8947 },
     {"send_size" :    128, "recv_size" :    128, "total_time_nsec" :     65742000, "standard_deviation_nsec" :      5907 },
     {"send_size" :    128, "recv_size" :    256, "total_time_nsec" :     72402000, "standard_deviation_nsec" :      6601 },
     {"send_size" :    128, "recv_size" :    512, "total_time_nsec" :     87457000, "standard_deviation_nsec" :      9004 },
     {"send_size" :    128, "recv_size" :   1024, "total_time_nsec" :    148412000, "standard_deviation_nsec" :     10532 },
     {"send_size" :    256, "recv_size" :      0, "total_time_nsec" :     58705000, "standard_deviation_nsec" :      7274 },
     {"send_size" :    256, "recv_size" :      4, "total_time_nsec" :     58818000, "standard_deviation_nsec" :      5453 },
     {"send_size" :    256, "recv_size" :      8, "total_time_nsec" :     59451000, "standard_deviation_nsec" :      6926 },
     {"send_size" :    256, "recv_size" :     16, "total_time_nsec" :     60237000, "standard_deviation_nsec" :      5781 },
     {"send_size" :    256, "recv_size" :     32, "total_time_nsec" :     61456000, "standard_deviation_nsec" :      5591 },
     {"send_size" :    256, "recv_size" :     64, "total_time_nsec" :     62615000, "standard_deviation_nsec" :      7588 },
     {"send_size" :    256, "recv_size" :    128, "total_time_nsec" :     68554000, "standard_deviation_nsec" :      7766 },
     {"send_size" :    256, "recv_size" :    256, "total_time_nsec" :     74557000, "standard_deviation_nsec" :      8748 },
     {"send_size" :    256, "recv_size" :    512, "total_time_nsec" :     87929000, "standard_deviation_nsec" :      9510 },
     {"send_size" :    256, "recv_size" :   1024, "total_time_nsec" :    148522000, "standard_deviation_nsec" :     11394 },
     {"send_size" :    512, "recv_size" :      0, "total_time_nsec" :     59697000, "standard_deviation_nsec" :      7825 },
     {"send_size" :    512, "recv_size" :      4, "total_time_nsec" :     59427000, "standard_deviation_nsec" :      5706 },
     {"send_size" :    512, "recv_size" :      8, "total_time_nsec" :     59538000, "standard_deviation_nsec" :      6863 },
     {"send_size" :    512, "recv_size" :     16, "total_time_nsec" :     61139000, "standard_deviation_nsec" :      7645 },
     {"send_size" :    512, "recv_size" :     32, "total_time_nsec" :     62203000, "standard_deviation_nsec" :      7985 },
     {"send_size" :    512, "recv_size" :     64, "total_time_nsec" :     62577000, "standard_deviation_nsec" :      8118 },
     {"send_size" :    512, "recv_size" :    128, "total_time_nsec" :     68722000, "standard_deviation_nsec" :     10581 },
     {"send_size" :    512, "recv_size" :    256, "total_time_nsec" :     74290000, "standard_deviation_nsec" :      8931 },
     {"send_size" :    512, "recv_size" :    512, "total_time_nsec" :     88635000, "standard_deviation_nsec" :      7771 },
     {"send_size" :    512, "recv_size" :   1024, "total_time_nsec" :    149589000, "standard_deviation_nsec" :     11456 },
     {"send_size" :   1024, "recv_size" :      0, "total_time_nsec" :     63243000, "standard_deviation_nsec" :      6331 },
     {"send_size" :   1024, "recv_size" :      4, "total_time_nsec" :     64381000, "standard_deviation_nsec" :      8372 },
     {"send_size" :   1024, "recv_size" :      8, "total_time_nsec" :     63481000, "standard_deviation_nsec" :      5608 },
     {"send_size" :   1024, "recv_size" :     16, "total_time_nsec" :     65549000, "standard_deviation_nsec" :      8826 },
     {"send_size" :   1024, "recv_size" :     32, "total_time_nsec" :     65485000, "standard_deviation_nsec" :      6822 },
     {"send_size" :   1024, "recv_size" :     64, "total_time_nsec" :     67125000, "standard_deviation_nsec" :      9829 },
     {"send_size" :   1024, "recv_size" :    128, "total_time_nsec" :     72680000, "standard_deviation_nsec" :      7641 },
     {"send_size" :   1024, "recv_size" :    256, "total_time_nsec" :     79206000, "standard_deviation_nsec" :      9854 },
     {"send_size" :   1024, "recv_size" :    512, "total_time_nsec" :     92418000, "standard_deviation_nsec" :      9107 },
     {"send_size" :   1024, "recv_size" :   1024, "total_time_nsec" :    152392000, "standard_deviation_nsec" :     11124 }
    ]
  },
  "download_speed" : {
    "byte_size" : 4194304,
    "results" : [
     {"send_size" :      0, "recv_size" :     32, "total_time_nsec" :   7735630000 },
     {"send_size" :      0, "recv_size" :     64, "total_time_nsec" :   3985169000 },
     {"send_size" :      0, "recv_size" :    128, "total_time_nsec" :   2128791000 },
     {"send_size" :      0, "recv_size" :    256, "total_time_nsec" :   1172077000 },
     {"send_size" :      0, "recv_size" :    512, "total_time_nsec" :    703833000 },
     {"send_size" :      0, "recv_size" :   1024, "total_time_nsec" :    594966000 }
    ]
  }
}

llvm-svn: 237953

9 years ago[PPC64] Handle vpkudum mask pattern correctly when vpkudum isn't available
Bill Schmidt [Thu, 21 May 2015 20:48:49 +0000 (20:48 +0000)]
[PPC64] Handle vpkudum mask pattern correctly when vpkudum isn't available

My recent patch to add support for ISA 2.07 vector pack/unpack
instructions didn't properly check for availability of the vpkudum
instruction when recognizing it as a special vector shuffle case.
This causes us to leave the vector shuffle in place (rather than
converting it to a vector permute) so that it can be recognized later
as a vpkudum, but that pattern is invalid for processors prior to
POWER8.  Thus LLVM crashes with an "unable to select" message.  We
observed this since one of our buildbots is configured to generate
code for a POWER7.

This patch fixes the problem by checking for availability of the
vpkudum instruction during custom lowering of vector shuffles.

I've added a test case variant for the vpkudum pattern when the
instruction isn't available.

llvm-svn: 237952

9 years agoStop creating MCSectionData is the ELF writer.
Rafael Espindola [Thu, 21 May 2015 20:43:13 +0000 (20:43 +0000)]
Stop creating MCSectionData is the ELF writer.

Now is is just its use of MCSymbolData that requires it to take a non const
MCAssembler.

llvm-svn: 237951

9 years ago[lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just...
Kostya Serebryany [Thu, 21 May 2015 20:39:13 +0000 (20:39 +0000)]
[lib/Fuzzer] ignore flags that start with --; use git pull --rebase instead of just git pull

llvm-svn: 237950

9 years agoIR / debug info: Add a DWOId field to DICompileUnit,
Adrian Prantl [Thu, 21 May 2015 20:37:30 +0000 (20:37 +0000)]
IR / debug info: Add a DWOId field to DICompileUnit,
so DWARF skeleton CUs can be expression in IR. A skeleton CU is a
(typically empty) DW_TAG_compile_unit that has a DW_AT_(GNU)_dwo_name and
a DW_AT_(GNU)_dwo_id attribute. It is used to refer to external debug info.

This is a prerequisite for clang module debugging as discussed in
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/040076.html.
In order to refer to external types stored in split DWARF (dwo) objects,
such as clang modules, we need to emit skeleton CUs, which identify the
dwarf object (i.e., the clang module) by filename (the SplitDebugFilename)
and a hash value, the dwo_id.

This patch only contains the IR changes. The idea is that a CUs with a
non-zero dwo_id field will be emitted together with a DW_AT_GNU_dwo_name
and DW_AT_GNU_dwo_id attribute.

http://reviews.llvm.org/D9488
rdar://problem/20091852

llvm-svn: 237949

9 years agoDebug info: Adapt to new DIBuilder interface.
Adrian Prantl [Thu, 21 May 2015 20:37:26 +0000 (20:37 +0000)]
Debug info: Adapt to new DIBuilder interface.

llvm-svn: 237948

9 years ago[PPC/LoopUnrollRuntime] Don't avoid high-cost trip count computation on the PPC/A2
Hal Finkel [Thu, 21 May 2015 20:30:23 +0000 (20:30 +0000)]
[PPC/LoopUnrollRuntime] Don't avoid high-cost trip count computation on the PPC/A2

On X86 (and similar OOO cores) unrolling is very limited, and even if the
runtime unrolling is otherwise profitable, the expense of a division to compute
the trip count could greatly outweigh the benefits. On the A2, we unroll a lot,
and the benefits of unrolling are more significant (seeing a 5x or 6x speedup
is not uncommon), so we're more able to tolerate the expense, on average, of a
division to compute the trip count.

llvm-svn: 237947

9 years agoDon't import module `lock` at global scope.
Zachary Turner [Thu, 21 May 2015 20:16:02 +0000 (20:16 +0000)]
Don't import module `lock` at global scope.

`lock` depends on `fcntl`, which doesn't exist on Windows.  Until
someone implements an equivalent locking mechanism on Windows, we
can't have lock imported globally.

llvm-svn: 237946

9 years agoFix race condition when detaching/killing an inferior.
Zachary Turner [Thu, 21 May 2015 19:56:26 +0000 (19:56 +0000)]
Fix race condition when detaching/killing an inferior.

llvm-svn: 237945

9 years agowriteSymbolTable now only needs a MCContext.
Rafael Espindola [Thu, 21 May 2015 19:54:44 +0000 (19:54 +0000)]
writeSymbolTable now only needs a MCContext.

It used to use an MCAssembler just to record the alignment of the sections.

llvm-svn: 237944

9 years agoPass a const MCAssembler to writeSectionHeader.
Rafael Espindola [Thu, 21 May 2015 19:46:39 +0000 (19:46 +0000)]
Pass a const MCAssembler to writeSectionHeader.

It never creates sections, so it can use Asm.getSectionData instead of
Asm.getOrCreateSectionData.

llvm-svn: 237943

9 years agoYAML: Null terminate block scalar's value.
Alex Lorenz [Thu, 21 May 2015 19:45:02 +0000 (19:45 +0000)]
YAML: Null terminate block scalar's value.

The commit null terminates the string value in the `yaml::BlockScalarNode`
class.

This change is motivated by the initial MIR serialization commit (r237708)
that I reverted in r237730 because the LLVM IR source from the block
scalar node wasn't terminated by a null character and thus the buildbots
failed on one testcase sometimes. This change enables me to recommit
the reverted commit.

llvm-svn: 237942

9 years agoRevert r237766, "Support: Introduce LLVM_FALLTHROUGH macro."
Peter Collingbourne [Thu, 21 May 2015 19:44:44 +0000 (19:44 +0000)]
Revert r237766, "Support: Introduce LLVM_FALLTHROUGH macro."

The value of this macro seems to be very low unless we actually start
using it everywhere, and I don't have immediate plans to make that
happen.

llvm-svn: 237941

9 years agoRemove unused argument. NFC.
Rafael Espindola [Thu, 21 May 2015 19:42:35 +0000 (19:42 +0000)]
Remove unused argument. NFC.

llvm-svn: 237940

9 years agoFix StreamingMemoryObject to respect known object size.
Derek Schuff [Thu, 21 May 2015 19:40:19 +0000 (19:40 +0000)]
Fix StreamingMemoryObject to respect known object size.

The existing code for method StreamingMemoryObject.fetchToPos does not respect
the corresonding call to setKnownObjectSize(). As a result, it allows the
StreamingMemoryObject to read bytes past the object size.

This patch provides a test case, and code to fix the problem.

Patch by Karl Schimpf
Differential Revision: http://reviews.llvm.org/D8931

llvm-svn: 237939

9 years agoFetch alignment directly out of MCSection. NFC.
Rafael Espindola [Thu, 21 May 2015 19:36:43 +0000 (19:36 +0000)]
Fetch alignment directly out of MCSection. NFC.

llvm-svn: 237938

9 years agoAdd support for VSX scalar single-precision arithmetic in the PPC target
Nemanja Ivanovic [Thu, 21 May 2015 19:32:49 +0000 (19:32 +0000)]
Add support for VSX scalar single-precision arithmetic in the PPC target

http://reviews.llvm.org/D9891
Following up on the VSX single precision loads and stores added earlier, this
adds support for elementary arithmetic operations on single precision values
in VSX registers. These instructions utilize the new VSSRC register class.
Instructions added:
xsaddsp
xsdivsp
xsmulsp
xsresp
xsrsqrtesp
xssqrtsp
xssubsp

llvm-svn: 237937

9 years agoMove alignment from MCSectionData to MCSection.
Rafael Espindola [Thu, 21 May 2015 19:20:38 +0000 (19:20 +0000)]
Move alignment from MCSectionData to MCSection.

This starts merging MCSection and MCSectionData.

There are a few issues with the current split between MCSection and
MCSectionData.

* It optimizes the the not as important case. We want the production
of .o files to be really fast, but the split puts the information used
for .o emission in a separate data structure.

* The ELF/COFF/MachO hierarchy is not represented in MCSectionData,
leading to some ad-hoc ways to represent the various flags.

* It makes it harder to remember where each item is.

The attached patch starts merging the two by moving the alignment from
MCSectionData to MCSection.

Most of the patch is actually just dropping 'const', since
MCSectionData is mutable, but MCSection was not.

llvm-svn: 237936

9 years agodotest.py - debug feature that helps find dosep races
Vince Harron [Thu, 21 May 2015 19:09:29 +0000 (19:09 +0000)]
dotest.py - debug feature that helps find dosep races

SUMMARY
dosep.py starts lots and lots of dotest instances.

This option helps you find if two (or more) dotest instances are using
the same directory at the same time.

Enable it to cause test failures and stderr messages if dotest
instances try to run in the same directory simultaneously.

It is disabled by default because it litters the test directories with
".dirlock" files

TEST PLAN
Set lldbtest.debug_confirm_directory_exclusivity = True
run ./dosep.py

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

llvm-svn: 237935

9 years agoReplace low-level constraint building with higher level functions
Tobias Grosser [Thu, 21 May 2015 19:02:44 +0000 (19:02 +0000)]
Replace low-level constraint building with higher level functions

Instead of explicitly building constraints and adding them to our maps we
now use functions like map_order_le to add the relevant information to the
maps.

llvm-svn: 237934

9 years agoXPASS a bunch of GdbRemote/LldbGdbServer tests
Vince Harron [Thu, 21 May 2015 18:55:39 +0000 (18:55 +0000)]
XPASS a bunch of GdbRemote/LldbGdbServer tests

Depends on r237932
"Fixed intermittent failures in TestGdbRemote*/TestLldbGdbServer"

Test Plan:
Ran dosep 100x, no failures in these tests

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

llvm-svn: 237933

9 years agoFixed intermittent failures in TestGdbRemote*/TestLldbGdbServer
Vince Harron [Thu, 21 May 2015 18:54:12 +0000 (18:54 +0000)]
Fixed intermittent failures in TestGdbRemote*/TestLldbGdbServer

test/tools/lldb-server/commandline/Test* were actually executing in
their parent directory. This looks fine at first because they aren't
compiling an inferior executable.

Unfortunately, they still call "make clean" during their cleanup,
which is likely causing all kinds of havok in tests running in the
parent directory

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

llvm-svn: 237932

9 years agoRe-enable packet logging for GdbRemote/LldbServer tests
Vince Harron [Thu, 21 May 2015 18:51:20 +0000 (18:51 +0000)]
Re-enable packet logging for GdbRemote/LldbServer tests

Creates logs in session dir

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

llvm-svn: 237931

9 years ago[LoopDistribute] Remove a layer of pointer indirection.
Benjamin Kramer [Thu, 21 May 2015 18:32:07 +0000 (18:32 +0000)]
[LoopDistribute] Remove a layer of pointer indirection.

Just store InstPartitions directly into the std::list. No functional change
intended.

llvm-svn: 237930

9 years agoItanium mangler: don't trip an assertion when unresolved members have implicit bases.
Douglas Gregor [Thu, 21 May 2015 18:28:18 +0000 (18:28 +0000)]
Itanium mangler: don't trip an assertion when unresolved members have implicit bases.

When we find a member of the current instantation, the base of the
unresolved member expression is implicit; use nullptr for such
bases. This is not a change in behavior: the AST already contains null
in such cases, so non-asserts builds do the right thing already. Fixes
rdar://problem/21020559.

llvm-svn: 237929

9 years agoFix lldb executable discovery on OS X
Vince Harron [Thu, 21 May 2015 18:21:07 +0000 (18:21 +0000)]
Fix lldb executable discovery on OS X

It was broken by r237632

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

llvm-svn: 237928

9 years ago[TestChangeValueAPI] Remove expectedFailureGcc decorator.
Siva Chandra [Thu, 21 May 2015 18:20:46 +0000 (18:20 +0000)]
[TestChangeValueAPI] Remove expectedFailureGcc decorator.

Test Plan: dotest.py -C <clang|gcc> -p TestChangeValueAPI

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 237927

9 years agodotest.py - log session to a file instead of a StringIO class
Vince Harron [Thu, 21 May 2015 18:20:21 +0000 (18:20 +0000)]
dotest.py - log session to a file instead of a StringIO class

That way, if the test gets killed (by a dosep timeout) we get to see the session
trace

Test Plan:
Run dotest.py
Kill it while it's running, check the session dir for Test* files

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

llvm-svn: 237926

9 years agoAdd logging for XTIMEOUT/UnexpectedSuccess
Vince Harron [Thu, 21 May 2015 18:18:52 +0000 (18:18 +0000)]
Add logging for XTIMEOUT/UnexpectedSuccess

If an expected timeout test times out, touch
<session-dir>/ExpectedTimeout-<test-name>

If an expected timeout test passes, touch
<session-dir>/UnexpectedCompletion-<test-name>

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

llvm-svn: 237925

9 years agoModify dosep.py to add default session dir parameter
Vince Harron [Thu, 21 May 2015 18:15:09 +0000 (18:15 +0000)]
Modify dosep.py to add default session dir parameter

This ensures that all spawned dotest instances store their traces
in the same location.

Test Plan:
run dosep.py with and without a -s option for dotest

cd lldb/test
./dosep.py
./dosep.py -o '-s /tmp/traces'

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

llvm-svn: 237923

9 years ago[TestBuiltinTrap] Change skipIfGcc to expectedFailure for GCC <= 4.6.
Siva Chandra [Thu, 21 May 2015 18:12:19 +0000 (18:12 +0000)]
[TestBuiltinTrap] Change skipIfGcc to expectedFailure for GCC <= 4.6.

Test Plan: dotest.py -C gcc -p TestBuiltinTrap

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 237922

9 years agoTestInlineStepping - made XFAIL more specific
Vince Harron [Thu, 21 May 2015 18:07:16 +0000 (18:07 +0000)]
TestInlineStepping - made XFAIL more specific

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

llvm-svn: 237921

9 years agoUpdate Makefile to reflect that TestNumThreads now uses std::thread instead of pthreads.
Adrian McCarthy [Thu, 21 May 2015 17:47:58 +0000 (17:47 +0000)]
Update Makefile to reflect that TestNumThreads now uses std::thread instead of pthreads.

llvm-svn: 237919

9 years agouse range-based for-loops; NFCI
Sanjay Patel [Thu, 21 May 2015 17:43:26 +0000 (17:43 +0000)]
use range-based for-loops; NFCI

llvm-svn: 237918

9 years agouse range-based for-loops; NFCI
Sanjay Patel [Thu, 21 May 2015 17:22:45 +0000 (17:22 +0000)]
use range-based for-loops; NFCI

llvm-svn: 237917

9 years agoFix task team synchronization
Jonathan Peyton [Thu, 21 May 2015 17:20:01 +0000 (17:20 +0000)]
Fix task team synchronization

The fix simply syncs up the new threads to have the same task_state and
task_team as the old threads.  The master thread is skipped,
because it shouldn't at this point have the team's task_team value yet
-- it should still have parent_team's task_team.  It gets pointed at
the new team's task_team later, after __kmp_allocate_team returns, and
the master has stored a memo of it's old task_state.

llvm-svn: 237916

9 years agoFix warning on builds without asserts.
Rafael Espindola [Thu, 21 May 2015 17:09:22 +0000 (17:09 +0000)]
Fix warning on builds without asserts.

llvm-svn: 237915

9 years agouse range-based for-loop
Sanjay Patel [Thu, 21 May 2015 17:04:17 +0000 (17:04 +0000)]
use range-based for-loop

llvm-svn: 237914

9 years agoAvoid unnecessary section switching. NFC.
Rafael Espindola [Thu, 21 May 2015 17:00:40 +0000 (17:00 +0000)]
Avoid unnecessary section switching. NFC.

llvm-svn: 237913

9 years agoRemove yet another method of creating begin and end symbol for sections.
Rafael Espindola [Thu, 21 May 2015 16:52:32 +0000 (16:52 +0000)]
Remove yet another method of creating begin and end symbol for sections.

I missed this one when first unifying how we handle begin and end symbols.

llvm-svn: 237912

9 years agodon't repeat function names in comments; NFC
Sanjay Patel [Thu, 21 May 2015 16:42:22 +0000 (16:42 +0000)]
don't repeat function names in comments; NFC

llvm-svn: 237911

9 years agoSize enum so we can store it as 16-bits and avoid casts. NFC
Pete Cooper [Thu, 21 May 2015 16:40:18 +0000 (16:40 +0000)]
Size enum so we can store it as 16-bits and avoid casts.  NFC

llvm-svn: 237910

9 years agoUse existing helper for adding a section. NFC.
Rafael Espindola [Thu, 21 May 2015 16:19:32 +0000 (16:19 +0000)]
Use existing helper for adding a section. NFC.

llvm-svn: 237909

9 years agouse range-based for-loop; NFCI
Sanjay Patel [Thu, 21 May 2015 16:00:50 +0000 (16:00 +0000)]
use range-based for-loop; NFCI

llvm-svn: 237908

9 years agoOnly check for matching arch and UUID when looking for dsym in vincinity of executable.
Robert Flack [Thu, 21 May 2015 15:44:24 +0000 (15:44 +0000)]
Only check for matching arch and UUID when looking for dsym in vincinity of executable.

ModuleSpecs::FindMatchingModuleSpec looks for matching filenames but when
looking for the dSYM we should only be looking for a matching architecture and
and UUID. Jason pointed out this mistake in http://reviews.llvm.org/D9174 when
this function was incorrectly converted to not be Mac specific.

Test Plan:
Running LLDB on test/lang/c/shared_lib_stripped_symbols/a.out in a debugger I've
verified LocateDSYMInVincinityOfExecutable correctly locates the matching dSYM.

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

llvm-svn: 237907

9 years agostd::sort must be called with a strict weak ordering.
Manuel Klimek [Thu, 21 May 2015 15:38:25 +0000 (15:38 +0000)]
std::sort must be called with a strict weak ordering.

Found by a debug enabled stl.

llvm-svn: 237906

9 years ago[clang-tidy] Disable google-readability-casting for .c files and their headers.
Alexander Kornienko [Thu, 21 May 2015 14:08:56 +0000 (14:08 +0000)]
[clang-tidy] Disable google-readability-casting for .c files and their headers.

Some people have reasons to compile their .c files as C++ in some configurations
(e.g. for testing purposes), so just looking at LangOptions is not enough. This
patch disables the check on all .c files (and also for the headers included from
.c files).

llvm-svn: 237905

9 years agoAdd bug number for TestEvents
Tamas Berghammer [Thu, 21 May 2015 14:04:17 +0000 (14:04 +0000)]
Add bug number for TestEvents

llvm-svn: 237904

9 years agoAVX-512: Enabled SSE intrinsics on AVX-512.
Elena Demikhovsky [Thu, 21 May 2015 14:01:32 +0000 (14:01 +0000)]
AVX-512: Enabled SSE intrinsics on AVX-512.
Predicate UseAVX depricates pattern selection on AVX-512.
This predicate is necessary for DAG selection to select EVEX form.
But mapping SSE intrinsics to AVX-512 instructions is not ready yet.
So I replaced UseAVX with HasAVX for intrinsics patterns.

llvm-svn: 237903

9 years agoMake Triple::parseARMArch use ARMTargetParser
Renato Golin [Thu, 21 May 2015 13:52:20 +0000 (13:52 +0000)]
Make Triple::parseARMArch use ARMTargetParser

Simplifying Triple::parseARMArch, leaving all the parsing to ARMTargetParser.

This commit also adds AArch64 detection to ARMTargetParser canonicalization,
and a two RedHat arch names (v{6,7}hl, meaning hard-float / little-endian).

Adding enough unit tests to cover the basics. Clang checks fine.

llvm-svn: 237902

9 years agoHandle aggregate return types in SysV-arm ABI
Tamas Berghammer [Thu, 21 May 2015 13:44:40 +0000 (13:44 +0000)]
Handle aggregate return types in SysV-arm ABI

Differential revision: http://reviews.llvm.org/D9910

llvm-svn: 237901

9 years agoAdd float/double return value handling to SysV-arm ABI
Tamas Berghammer [Thu, 21 May 2015 13:34:46 +0000 (13:34 +0000)]
Add float/double return value handling to SysV-arm ABI

This is neccessary for evaluating expressions with float/double return
value and for displaying float/double return values in case of a thread
step out.

Differential revision: http://reviews.llvm.org/D9907

llvm-svn: 237900

9 years ago[RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization
Igor Laevsky [Thu, 21 May 2015 13:02:14 +0000 (13:02 +0000)]
[RewriteStatepointsForGC] Fix debug assertion during derivable pointer rematerialization

Correct assertion would be that there is no other uses from chain we are currently cloning. It is ok to have other uses of values not from this chain.

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

llvm-svn: 237899

9 years ago[ARM] Add dynamic symbols to the dynamic library writer
Denis Protivensky [Thu, 21 May 2015 12:52:00 +0000 (12:52 +0000)]
[ARM] Add dynamic symbols to the dynamic library writer

llvm-svn: 237898

9 years agoFix memory-dereferenceable.ll test
Artur Pilipenko [Thu, 21 May 2015 12:51:38 +0000 (12:51 +0000)]
Fix memory-dereferenceable.ll test

One of the testcases introduced by D9365 had incorrect !dereferenceable metadata on load. It must fail but it doesn't due to incorrect order of CHECK/CHECK-NOT commands in test. Fixed both.

Reviewed By: sanjoy

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

llvm-svn: 237897

9 years ago[ARM] Remove useless file with writer's instantiation stub
Denis Protivensky [Thu, 21 May 2015 12:31:15 +0000 (12:31 +0000)]
[ARM] Remove useless file with writer's instantiation stub

llvm-svn: 237896

9 years agoclang-format: [JS] Better support for fat arrows.
Manuel Klimek [Thu, 21 May 2015 12:23:34 +0000 (12:23 +0000)]
clang-format: [JS] Better support for fat arrows.

Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing to better recognize formal parameter
lists and return type declarations.
Recognizes arrow functions and parse function bodies as child blocks.

Patch by Martin Probst.

llvm-svn: 237895

9 years ago[ARM] Restructure cpu handling in the driver to mostly use the triple
John Brawn [Thu, 21 May 2015 12:19:49 +0000 (12:19 +0000)]
[ARM] Restructure cpu handling in the driver to mostly use the triple

Using the target cpu to determine some behaviour is sprinkled in
several places in the driver, but in almost all the information that
is needed can be found in the triple. Restructure things so that the
triple is used, and the cpu is only used if the exact cpu name is
needed.

Also add a check that the -mcpu argument is valid, and correct the
-march argument checking so that it handles -march=native correctly. I
would have liked to move these checks into the computation of the
triple, but the triple is calculated several times in several places
and that would lead to multiple error messages for the same thing.

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

llvm-svn: 237894

9 years agoTest commit. Fix typo in MemDerefPrinter.cpp comment.
Artur Pilipenko [Thu, 21 May 2015 11:57:38 +0000 (11:57 +0000)]
Test commit. Fix typo in MemDerefPrinter.cpp comment.

llvm-svn: 237893

9 years ago[ARM] Remove unused field in executable writer
Denis Protivensky [Thu, 21 May 2015 11:50:54 +0000 (11:50 +0000)]
[ARM] Remove unused field in executable writer

llvm-svn: 237892

9 years ago[ARM] Move out common Writer functionality to ARMELFWriter
Denis Protivensky [Thu, 21 May 2015 11:16:40 +0000 (11:16 +0000)]
[ARM] Move out common Writer functionality to ARMELFWriter

llvm-svn: 237891

9 years agoRemove unnecessary FIXME comment
Renato Golin [Thu, 21 May 2015 10:47:56 +0000 (10:47 +0000)]
Remove unnecessary FIXME comment

It has been fixed by commit r237797.

llvm-svn: 237890

9 years agoFixed unused variable warning in non-assert builds from rL237885
Simon Pilgrim [Thu, 21 May 2015 10:22:10 +0000 (10:22 +0000)]
Fixed unused variable warning in non-assert builds from rL237885

llvm-svn: 237889

9 years agoXFAIL TestEvents on Linux bacuse it is flaky
Tamas Berghammer [Thu, 21 May 2015 10:16:55 +0000 (10:16 +0000)]
XFAIL TestEvents on Linux bacuse it is flaky

llvm-svn: 237888

9 years agoXFAILing TestRaise on darwin due to an apparent bug
Pavel Labath [Thu, 21 May 2015 10:15:57 +0000 (10:15 +0000)]
XFAILing TestRaise on darwin due to an apparent bug

llvm-svn: 237887

9 years ago[ELF] Move start/end atom method assignment to OutputELFWriter. NFC
Denis Protivensky [Thu, 21 May 2015 10:11:27 +0000 (10:11 +0000)]
[ELF] Move start/end atom method assignment to OutputELFWriter. NFC

llvm-svn: 237886

9 years ago[X86][SSE] Improve support for 128-bit vector sign extension
Simon Pilgrim [Thu, 21 May 2015 10:05:03 +0000 (10:05 +0000)]
[X86][SSE] Improve support for 128-bit vector sign extension

This patch improves support for sign extension of the lower lanes of vectors of integers by making use of the SSE41 pmovsx* sign extension instructions where possible, and optimizing the sign extension by shifts on pre-SSE41 targets (avoiding the use of i64 arithmetic shifts which require scalarization).

It converts SIGN_EXTEND nodes to SIGN_EXTEND_VECTOR_INREG where necessary, that more closely matches the pmovsx* instruction than the default approach of using SIGN_EXTEND_INREG which splits the operation (into an ANY_EXTEND lowered to a shuffle followed by shifts) making instruction matching difficult during lowering. Necessary support for SIGN_EXTEND_VECTOR_INREG has been added to the DAGCombiner.

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

llvm-svn: 237885

9 years ago[mips] [IAS] Add 2 missing CHECK directives for fixups in mips-expansions.s.
Toma Tabacu [Thu, 21 May 2015 10:04:39 +0000 (10:04 +0000)]
[mips] [IAS] Add 2 missing CHECK directives for fixups in mips-expansions.s.

llvm-svn: 237884

9 years ago[ARM] Remove unused fields in dynamic library writer
Denis Protivensky [Thu, 21 May 2015 09:52:21 +0000 (09:52 +0000)]
[ARM] Remove unused fields in dynamic library writer

llvm-svn: 237883

9 years ago[OPENMP] Fixed codegen for parameters privatization.
Alexey Bataev [Thu, 21 May 2015 09:47:46 +0000 (09:47 +0000)]
[OPENMP] Fixed codegen for parameters privatization.

For parameters we shall take a derived type of parameters, not the original one.

llvm-svn: 237882

9 years ago[ARM] Add skeleton implementation of DSO linking
Denis Protivensky [Thu, 21 May 2015 09:28:25 +0000 (09:28 +0000)]
[ARM] Add skeleton implementation of DSO linking

llvm-svn: 237881

9 years ago[NativeProcessLinux] Fix handling of SIGSTOP
Pavel Labath [Thu, 21 May 2015 08:32:18 +0000 (08:32 +0000)]
[NativeProcessLinux] Fix handling of SIGSTOP

Summary:
Previously, NPL tried to reinject SIGSTOP into the inferior in an attempt to get the process to
start in the group-stop state. This was:
a) wrong (reinjection should be controlled by "process handle" lldb setting)
b) racy (it should use Resume for transparent resuming instead of RequestResume)
c) broken (llgs crashed on inferior SIGSTOP)

With this change, SIGSTOP is handled just like any other signal delivered to the inferior: we
stop all threads and report signal reception to lldb. SIGSTOP reinjection does not behave the
same way as it would outside the debugger, but simulating this is a hard problem and is not
normally necessary.

Test Plan: I have added a test which verifies we get SIGSTOP reports and we do not crash.

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

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

llvm-svn: 237880

9 years ago[OPENMP] Fixed codegen for lastprivate LCV in worksharing constructs.
Alexey Bataev [Thu, 21 May 2015 07:59:51 +0000 (07:59 +0000)]
[OPENMP] Fixed codegen for lastprivate LCV in worksharing constructs.

If loop control variable in a worksharing construct is marked as lastprivate, we should copy last calculated value of private counter back to original variable.

llvm-svn: 237879

9 years agotrivial log print fix
Vince Harron [Thu, 21 May 2015 05:57:28 +0000 (05:57 +0000)]
trivial log print fix

llvm-svn: 237878

9 years ago[TableGen] Resolve complex def names inside multiclasses
Hal Finkel [Thu, 21 May 2015 04:32:56 +0000 (04:32 +0000)]
[TableGen] Resolve complex def names inside multiclasses

We had not been trying hard enough to resolve def names inside multiclasses
that had complex concatenations, etc. Now we'll try harder.

Patch by Amaury Sechet!

llvm-svn: 237877

9 years agoAsmPrinter: Compute absolute label difference directly
Duncan P. N. Exon Smith [Thu, 21 May 2015 02:41:23 +0000 (02:41 +0000)]
AsmPrinter: Compute absolute label difference directly

Create a low-overhead path for `EmitLabelDifference()` that emits a
emits an absolute number when (1) the output is an object stream and (2)
the two symbols are in the same data fragment.

This drops memory usage on Mach-O from 975 MB down to 919 MB (5.8%).
The only call is when `!doesDwarfUseRelocationsAcrossSections()` --
i.e., on Mach-O -- since otherwise an absolute offset from the start of
the section needs a relocation.  (`EmitLabelDifference()` is cheaper on
ELF anyway, since it creates 1 fewer temp symbol, and it gets called far
less often.  It's not clear to me if this is even a bottleneck there.)

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 237876

9 years agoMC: Initialize MCSymbolData::Offset directly
Duncan P. N. Exon Smith [Thu, 21 May 2015 01:59:58 +0000 (01:59 +0000)]
MC: Initialize MCSymbolData::Offset directly

Try to fix miscompile after r237873.  Looks like this union
initialization isn't legal (or at least not supported).

llvm-svn: 237875

9 years ago[MemCpyOpt] Do move the memset, but look at its dest's dependencies.
Ahmed Bougacha [Thu, 21 May 2015 01:43:39 +0000 (01:43 +0000)]
[MemCpyOpt] Do move the memset, but look at its dest's dependencies.

In effect a partial revert of r237858, which was a dumb shortcut.
Looking at the dependencies of the destination should be the proper
fix: if the new memset would depend on anything other than itself,
the transformation isn't correct.

llvm-svn: 237874

9 years agoMC: Simplify MCSymbolData initialization and remove MCSymbol pointer
Duncan P. N. Exon Smith [Thu, 21 May 2015 01:33:03 +0000 (01:33 +0000)]
MC: Simplify MCSymbolData initialization and remove MCSymbol pointer

Finally remove the `MCSymbolData::Symbol` pointer.  It was still being
used to track whether `MCSymbolData` had been initialized, but this is
better tracked by the bitfield in `MCSymbol`.

The only caller of `MCSymbolData::initialize()` was `MCAssembler`, which
(other than `Symbol`) passed in all-0 values.  Replace all that
indirection with a default constructor.

The main point is a cleanup (and there's more cleanup to do), but there
are also some small memory savings.  I measured ~989 MB down to ~975 MB,
cutting a little over 1% off the top of `llc`.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 237873

9 years agoAvoid using a C++11 library feature not present in libstdc++4.7.
Richard Smith [Thu, 21 May 2015 01:26:53 +0000 (01:26 +0000)]
Avoid using a C++11 library feature not present in libstdc++4.7.

llvm-svn: 237872

9 years ago[modules] If we re-enter a submodule from within itself (when submodule
Richard Smith [Thu, 21 May 2015 01:20:10 +0000 (01:20 +0000)]
[modules] If we re-enter a submodule from within itself (when submodule
visibility is enabled) or leave and re-enter it, restore the macro and module
visibility state from last time we were in that submodule.

This allows mutually-#including header files to stand a chance at being
modularized with local visibility enabled.

llvm-svn: 237871

9 years ago[Driver] Improve unused-argument diagnostic for extra sanitizer features.
Alexey Samsonov [Thu, 21 May 2015 01:07:52 +0000 (01:07 +0000)]
[Driver] Improve unused-argument diagnostic for extra sanitizer features.

Don't print unused-argument warning for sanitizer-specific feature flag
if this sanitizer was eanbled, and later disabled in the command line.
For example, now:
  clang -fsanitize=address -fsanitize-coverage=bb -fno-sanitize=address a.cc
doesn't print warning, but
  clang -fsanitize-coverage=bb
does. Same holds for -fsanitize-address-field-padding= and
-fsanitize-memory-track-origins= flags.

Fixes PR23604.

llvm-svn: 237870

9 years agoDocument the CoreCLR GC Strategy
Swaroop Sridhar [Thu, 21 May 2015 00:50:10 +0000 (00:50 +0000)]
Document the CoreCLR GC Strategy

Add notead about the CoreCLR GC Strategy to the
Garbage Collection document.

llvm-svn: 237869

9 years agoMC: Make MCSymbolData::Symbol private
Duncan P. N. Exon Smith [Thu, 21 May 2015 00:49:09 +0000 (00:49 +0000)]
MC: Make MCSymbolData::Symbol private

Make the back-pointer from `MCSymbolData` to `MCSymbol` private,
preparing to remove the back pointer entirely.  I've already updated all
the users, although for now it's still used to indicate whether
`MCSymbol::Data` has been initialized.

llvm-svn: 237868

9 years agoMC: Remove last use of MCSymbolData::getSymbol(), NFC
Duncan P. N. Exon Smith [Thu, 21 May 2015 00:39:24 +0000 (00:39 +0000)]
MC: Remove last use of MCSymbolData::getSymbol(), NFC

Remove the last use of `MCSymbolData::getSymbol()`.  There's some
*really* hairy stuff going on in `MachObjectWriter::WriteNList()` that I
want to come back to.  In particular, it updates `Symbol` to point at
its aliasee (if any), but leaves `Data` behind, and it's not clear
whether everything makes sense there.

For now I've left the logic unchanged by adding `OrigSymbol` and moving
the FIXME from r237750 up a bit higher.  I've filed PR23598 to track
looking into this.

llvm-svn: 237867

9 years agoFix the logic in DynamicLoaderMacOSXDYLD::Clear that would only remove the old dyld...
Jim Ingham [Thu, 21 May 2015 00:27:01 +0000 (00:27 +0000)]
Fix the logic in DynamicLoaderMacOSXDYLD::Clear that would only remove the old dyld notification
breakpoint only  if the process it was for is still alive.  We need to always remove this because
it has a pointer to the old loader, and    if we ever hit it we will crash.  I also put in a sanity
check in the callback function to make sure we don't invoke it if the process is wrong.

<rdar://problem/21006189>

llvm-svn: 237866

9 years agoFixed an issue with expressions that define types in the expression. We must currentl...
Greg Clayton [Thu, 21 May 2015 00:26:58 +0000 (00:26 +0000)]
Fixed an issue with expressions that define types in the expression. We must currently touch the members of the struct in the right order or our ClangASTImporter::DeportType() will copy the resulting type into the target AST incorrectly. This is a work around for <rdar://problem/21049838> which the copy type issue so that it doesn't happen.

<rdar://problem/20902950>

llvm-svn: 237865

9 years agoUsing -pthread instead of -lpthread to appease GCC.
Chaoren Lin [Thu, 21 May 2015 00:19:15 +0000 (00:19 +0000)]
Using -pthread instead of -lpthread to appease GCC.

llvm-svn: 237864

9 years agoRename a helper template function to 'bytes' to avoid a C++17 STL conflict
Reid Kleckner [Thu, 21 May 2015 00:13:09 +0000 (00:13 +0000)]
Rename a helper template function to 'bytes' to avoid a C++17 STL conflict

MSVC 2015 includes the std::data() template function added to C++17. ADL
causes both cl.exe and clang-cl to prefer std::data over our static
helper here, and we get errors about converting int64_t* to StringRef.
Renaming it to bytes avoids the ambiguity.

llvm-svn: 237863