1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

94766 Commits

Author SHA1 Message Date
Hal Finkel
fd36621506 BBVectorize: Add initial stores to the write set when tracking uses
When computing the use set of a store, we need to add the store to the write
set prior to iterating over later instructions. Otherwise, if there is a later
aliasing load of that store, that load will not be tagged as a use, and bad
things will happen.

trackUsesOfI still adds later dependent stores of an instruction to that
instruction's write set, but it never sees the original instruction, and so
when tracking uses of a store, the store must be added to the write set by the
caller.

Fixes PR16834.

llvm-svn: 188329
2013-08-13 23:34:32 +00:00
Nick Lewycky
d738bd4283 Remove duplicate copy of testcase in r188327.
llvm-svn: 188328
2013-08-13 22:55:05 +00:00
Nick Lewycky
eab287a60a Revert r187191, which broke opt -mem2reg on the testcases included in PR16867.
However, opt -O2 doesn't run mem2reg directly so nobody noticed until r188146
when SROA started sending more things directly down the PromoteMemToReg path.

In order to revert r187191, I also revert dependent revisions r187296, r187322
and r188146. Fixes PR16867. Does not add the testcases from that PR, but both
of them should get added for both mem2reg and sroa when this revert gets
unreverted.

llvm-svn: 188327
2013-08-13 22:51:58 +00:00
Jack Carter
15a173ab4f [Mips][msa] Value types for MSA support.
Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td, 
and CodeGenTarget.cpp

Patch by Daniel Sanders

llvm-svn: 188326
2013-08-13 22:34:26 +00:00
Hans Wennborg
581964696d Options: explicit handling of --
Clients of the option parsing library should handle it explicitly
using a KIND_REMAINING_ARGS option.

Clang and lld have been updated in r188316 and r188318, respectively.

Also fix -Wsign-compare warning in the option parsing test.

llvm-svn: 188323
2013-08-13 22:23:05 +00:00
Jim Grosbach
a6bd8c2220 DAG: Combine (and (setne X, 0), (setne X, -1)) -> (setuge (add X, 1), 2)
A common idiom is to use zero and all-ones as sentinal values and to
check for both in a single conditional ("x != 0 && x != (unsigned)-1").
That generates code, for i32, like:
  testl %edi, %edi
  setne %al
  cmpl  $-1, %edi
  setne %cl
  andb  %al, %cl

With this transform, we generate the simpler:
  incl  %edi
  cmpl  $1, %edi
  seta  %al

Similar improvements for other integer sizes and on other platforms. In
general, combining the two setcc instructions into one is better.

rdar://14689217

llvm-svn: 188315
2013-08-13 21:30:58 +00:00
Hans Wennborg
714e82ffc5 Options: Add new option kind that consumes remaining arguments
This adds KIND_REMAINING_ARGS, a class of options that consume
all remaining arguments on the command line.

This will be used to support /link in clang-cl, which is used
to forward all remaining arguments to the linker.

It also allows us to remove the hard-coded handling of "--",
allowing clients (clang and lld) to implement that functionality
themselves with this new option class.

Differential Revision: http://llvm-reviews.chandlerc.com/D1387

llvm-svn: 188314
2013-08-13 21:09:50 +00:00
Jack Carter
da7e928e92 [Mips][msa] Added initial MSA support.
* msa SubtargetFeature
* registers
* ld.[bhwd], and st.[bhwd] instructions

Does not correctly prohibit use of both 32-bit FPU registers and MSA together.

Patch by Daniel Sanders

llvm-svn: 188313
2013-08-13 20:54:07 +00:00
Jack Carter
cb8856c2c6 [Mips] Support for unaligned load/store microMips instructions
This includes instructions lwl, lwr, swl and swr.

Patch by Zoran Jovnovic

llvm-svn: 188312
2013-08-13 20:19:16 +00:00
Daniel Dunbar
a1f2b781ab [lit] Support use of setup.py from other directories.
llvm-svn: 188309
2013-08-13 19:08:48 +00:00
Michael Gottesman
30dcd21864 Update makeLibCall to return both the call and the chain associated with the libcall instead of just the call. This allows us to specify libcalls that return void.
LowerCallTo returns a pair with the return value of the call as the first
element and the chain associated with the return value as the second element. If
we lower a call that has a void return value, LowerCallTo returns an SDValue
with a NULL SDNode and the chain for the call. Thus makeLibCall by just
returning the first value makes it impossible for you to set up the chain so
that the call is not eliminated as dead code.

I also updated all references to makeLibCall to reflect the new return type.

llvm-svn: 188300
2013-08-13 17:54:56 +00:00
Carlo Kok
1b6e9cea0f Output DW_AT_stmt_list dwarf debug info as DW_FORM_sec_offset instead of DW_FORM_data4 as it is a section offset (fixes the coff/dwarf debug info statement locations)
llvm-svn: 188297
2013-08-13 17:46:57 +00:00
Carlo Kok
d10cf40934 For COFF only: dwarf debug info output a label reference as a section relative item only when it's one of dw_from strp, sec_offset, ref_addr or op_call_ref instead of going by size.
llvm-svn: 188296
2013-08-13 17:45:53 +00:00
Dmitry Vyukov
fe91b1efa2 dfsan: fix lint warnings
llvm-svn: 188293
2013-08-13 16:52:41 +00:00
Joey Gouly
c5221430a1 ARMv8: SWP and SWPB are obsoleted on ARMv8.
llvm-svn: 188288
2013-08-13 16:40:47 +00:00
Arnold Schwaighofer
dfaac373ee Also remove logic in LateVectorize
llvm-svn: 188285
2013-08-13 16:12:04 +00:00
Arnold Schwaighofer
406976609b Remove logic that decides whether to vectorize or not depending on O-levels
I have moved this logic into clang and opt.

llvm-svn: 188281
2013-08-13 15:51:25 +00:00
Evgeniy Stepanov
0caff76271 Fix compiler warnings.
../lib/Target/X86/X86ISelLowering.cpp:9715:7: error: unused variable 'OpVT' [-Werror,-Wunused-variable]
  EVT OpVT = Op0.getValueType();
      ^
../lib/Target/X86/X86ISelLowering.cpp:9763:14: error: unused variable 'NumElems' [-Werror,-Wunused-variable]
    unsigned NumElems = VT.getVectorNumElements();

llvm-svn: 188269
2013-08-13 14:04:20 +00:00
Mihai Popa
f30d3c418d Fix signed overflow in when computing encodings for ADR instructions
llvm-svn: 188268
2013-08-13 14:02:13 +00:00
Elena Demikhovsky
42b33ee116 AVX-512: Added CMP and BLEND instructions.
Lowering for SETCC.

llvm-svn: 188265
2013-08-13 13:24:07 +00:00
Vladimir Medic
c797d9a921 This patch introduces changes to MipsAsmParser register parsing routines. The code now follows more deterministic path and makes the code more efficient and easier to maintain.
llvm-svn: 188264
2013-08-13 13:07:09 +00:00
Benjamin Kramer
3078fbe0e8 GCC warns about removing const with a c-style cast.
llvm-svn: 188259
2013-08-13 09:57:55 +00:00
Evgeniy Stepanov
7a9f4fb383 Pass DIEHash::collectAttributes output argument by-pointer instead of by-value.
Before this, collectAttributes() was operating on a local object.

llvm-svn: 188254
2013-08-13 07:57:01 +00:00
David Majnemer
eca1e24e80 [-cxx-abi microsoft] Stick zero initialized symbols into the .bss section for COFF
Summary:
We need to do two things:

- Initialize BSSSection in MCObjectFileInfo::InitCOFFMCObjectFileInfo
- Teach TargetLoweringObjectFileCOFF::SelectSectionForGlobal what to do
  with it

This fixes PR16861.

Reviewers: rnk

Reviewed By: rnk

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1361

llvm-svn: 188244
2013-08-13 01:23:53 +00:00
Eric Christopher
aae98d918e Add the start of DIE hashing for DWARF4 type units and split dwarf
CUs.

Currently only hashes the name of CUs and the names of any children,
but it's an obvious first step to show the framework. The testcase
should continue to be correct, however, as it's an empty TU.

llvm-svn: 188243
2013-08-13 01:21:55 +00:00
Nick Lewycky
ce26d6b8d0 Fix an oversight in isPotentiallyReachable where we wouldn't do any CFG-walking
to find loops if the From and To instructions were in the same block.

Refactor the code a little now that we need to fill to start the CFG-walking
algorithm with more than one starting basic block sometimes.

Special thanks to Andrew Trick for catching an error in my understanding of
natural loops in code review.

llvm-svn: 188236
2013-08-13 00:03:47 +00:00
Eric Christopher
60bb3151e8 Add comment and source to testcase.
llvm-svn: 188234
2013-08-12 23:59:26 +00:00
Eric Christopher
302cbd1330 Reflow comment.
llvm-svn: 188233
2013-08-12 23:59:24 +00:00
Eric Christopher
d5768dc3b1 Remove empty constructor.
llvm-svn: 188232
2013-08-12 23:59:18 +00:00
Matt Arsenault
1d8ad32d3e Slightly simplify code with helper functions
e.g. Use Ty->getPointerElementType()
instead of cast<PointerType>(Ty)->getElementType()

llvm-svn: 188223
2013-08-12 23:15:58 +00:00
Rui Ueyama
9666dd3633 [FileCheck] Fix a bug that cause FileCheck to misidentify check-prefix
FileCheck should check to make sure the prefix was found, and not a word
containing it (e.g -check-prefix=BASEREL shouldn't match NOBASEREL).

Patch by Ron Ofir.

llvm-svn: 188221
2013-08-12 23:05:59 +00:00
Michael J. Spencer
bd9a40300e [Object/ELF] sh_type is not a bitfield. Fixes RuntimeDyld test failure on ARM.
llvm-svn: 188220
2013-08-12 22:59:14 +00:00
Matt Arsenault
c153cf6470 Add some braces, and spaces around operators
llvm-svn: 188219
2013-08-12 22:56:15 +00:00
Kevin Enderby
41399cecad Fix a crash with X86 Mach-O and a subtraction expression where both symbols are
undefined and produce an error message instead as this is a non-relocatable
expression with X86 Mach-O.

rdar://8920876

llvm-svn: 188218
2013-08-12 22:45:44 +00:00
Peter Collingbourne
723e9b89ec Reapply r188119 now that the bug it exposed is fixed.
llvm-svn: 188217
2013-08-12 22:38:43 +00:00
Peter Collingbourne
10cbe4a9bb DataFlowSanitizer: fix a use-after-free. Spotted by libgmalloc.
llvm-svn: 188216
2013-08-12 22:38:39 +00:00
Tom Stellard
9f798c877d R600: Set scheduling preference to Sched::Source
R600 doesn't need to do any scheduling on the SelectionDAG now that it
has a very good MachineScheduler.  Also, using the VLIW SelectionDAG
scheduler was having a major impact on compile times. For example with
the phatk kernel here are the LLVM IR to machine code compile times:

With Sched::VLIW

Total Compile Time:                  1.4890 Seconds (User + System)
SelectionDAG Instruction Scheduling: 1.1670 Seconds (User + System)

With Sched::Source

Total Compile Time:                  0.3330 Seconds (User + System)
SelectionDAG Instruction Scheduling: 0.0070 Seconds (User + System)

The code ouput was identical with both schedulers.  This may not be true
for all programs, but it gives me confidence that there won't be much
reduction, if any, in code quality by using Sched::Source.

llvm-svn: 188215
2013-08-12 22:33:21 +00:00
Michael Gottesman
4f8bae7094 Add editor C++ filetype declaration no functionality change.
llvm-svn: 188205
2013-08-12 21:10:23 +00:00
Shuxin Yang
b3af4b7f36 Revert r188188 and r188200.
In order to appease people (in Apple) who accuse me for committing "huge change" (?) without proper review. 

Thank Eric for fixing a compile-warning. 

llvm-svn: 188204
2013-08-12 21:07:31 +00:00
Michael Gottesman
4b904f1880 Fixed SelectionDAGBuilder.h C++ filetype declaration to use the canonical C++ instead of c++.
llvm-svn: 188203
2013-08-12 21:02:02 +00:00
Michael Gottesman
8ba1e36e9c Fixed another place in CodeGen where we had a typo in our editor C++ filetype declaration.
llvm-svn: 188202
2013-08-12 20:52:06 +00:00
Michael Gottesman
6b88b6e12b [branchfolding] Fix typo in C++ editor declaration.
llvm-svn: 188201
2013-08-12 20:49:27 +00:00
Eric Christopher
64cf0f48c3 Fix warning about unused member.
llvm-svn: 188200
2013-08-12 20:27:50 +00:00
Eric Christopher
6df5d15a24 Move the addition of the dwo_id as late as possible after everything
has been finalized except for sizes and offsets. Update test accordingly.

llvm-svn: 188199
2013-08-12 20:27:48 +00:00
Bill Wendling
f37b5b1f31 Move stack protector names to the same place.
llvm-svn: 188198
2013-08-12 20:09:37 +00:00
Michael Gottesman
7203dd4b96 [stack protector] Fixed typo.
llvm-svn: 188195
2013-08-12 19:44:09 +00:00
Michael Gottesman
defd024179 [stackprotector] Add in the stackprotector libcall.
We support this libcall on all platforms except for OpenBSD (See
lib/Codegen/StackProtector.cpp).

llvm-svn: 188193
2013-08-12 18:45:38 +00:00
Michael Gottesman
e32ebb94bd [stackprotector] Added intrinsic llvm.stackprotectorcheck.
llvm-svn: 188191
2013-08-12 18:35:32 +00:00
Shuxin Yang
4b4ff9ec1f Misc enhancements to LTO:
1. Add some helper classes for partitions. They are designed in a
     way such that the top-level LTO driver will not see much difference 
     with or without partitioning.

  2. Introduce work-dir. Now all intermediate files generated during 
     LTO phases will be saved under work-dir. User can specify the workdir
     via -lto-workdir=/path/to/dir. By default the work-dir will be 
     erased before linker exit. To keep the workdir, do -lto-keep, or -lto-keep=1.

    TODO: Erase the workdir, if the linker exit prematurely.  
      We are currently not able to remove directory on signal. The support 
      routines simply ignore directory.

  3. Add one new API lto_codegen_get_files_need_remove().
     Linker and LTO plugin will communicate via this API about which files
    (including directories) need to removed before linker exit.

llvm-svn: 188188
2013-08-12 18:29:43 +00:00
Nadav Rotem
bc08e7ce84 Fix PR16797 - Support PHINodes with multiple inputs from the same basic block.
Do not generate new vector values for the same entries because we know that the incoming values
from the same block must be identical.

llvm-svn: 188185
2013-08-12 17:46:44 +00:00