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

106838 Commits

Author SHA1 Message Date
Aaron Ballman
eb3884b0cf Reverting r215966, r215965, r215964, r215963, r215960, r215959, r215958, and r215957 (these commits all rely on previous commits) due to build breakage. These commits cause failed assertions when testing Clang using MSVC 2013. The asserts are triggered from the std::equal call within ArrayRef::equals due to being passed invalid input (ArrayRef.begin() is returning a nullptr which is problematic).
llvm-svn: 215981
2014-08-19 14:59:02 +00:00
Toma Tabacu
e91297ac8b [mips] Add assembler support for .set arch=x directive.
Summary:
This directive is similar to ".set mipsX".
It is used to change the CPU target of the assembler, enabling it to accept instructions for a specific CPU.

This patch only implements the r4000 CPU (which is treated internally as generic mips3) and the generic ISAs.

Contains work done by Matheus Almeida.

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 215978
2014-08-19 14:22:52 +00:00
Mayur Pandey
2a3606586c InstCombine: ((A & ~B) ^ (~A & B)) to A ^ B
Proof using CVC3 follows:
$ cat t.cvc
A, B : BITVECTOR(32);
QUERY BVXOR((A & ~B),(~A & B)) = BVXOR(A,B);
$ cvc3 t.cvc
Valid.

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

llvm-svn: 215974
2014-08-19 08:19:19 +00:00
Craig Topper
2886bca389 Const-correct and prevent a copy of a SmallPtrSet.
llvm-svn: 215973
2014-08-19 07:44:27 +00:00
Craig Topper
14e09e556b Prevent use of the implicit copy constructor on SmallPtrSetImpl. An accidental copy caused my SmallPtrSet->SmallPtrSetImpl conversion commit to fail the other day.
llvm-svn: 215971
2014-08-19 06:57:14 +00:00
Mayur Pandey
720f33cd8e test commit (spelling correction)
llvm-svn: 215970
2014-08-19 06:41:55 +00:00
Rafael Espindola
7721c6470e Make it explicit that ExecutionEngine takes ownership of the modules.
llvm-svn: 215967
2014-08-19 04:04:25 +00:00
Duncan P. N. Exon Smith
8c232ac3f1 IR: Reduce RAUW traffic in ConstantVector
Avoid creating a new `ConstantVector` on an RAUW of one of its members.
This reduces RAUW traffic on any containing constant.

This is part of PR20515.

llvm-svn: 215966
2014-08-19 02:24:46 +00:00
Duncan P. N. Exon Smith
57af14339b IR: Fix ConstantArray::replaceUsesOfWithOnConstant()
Previously, `ConstantArray::replaceUsesOfWithOnConstant()` neglected to
check whether it becomes a `ConstantDataArray`.  Call
`ConstantArray::getImpl()` to check for that.

llvm-svn: 215965
2014-08-19 02:21:00 +00:00
Duncan P. N. Exon Smith
40c36e0a4f IR: Factor out replaceUsesOfWithOnConstantImpl(), NFC
Factor out common code, and take advantage of the new function to
add early returns to the callers.

llvm-svn: 215964
2014-08-19 02:16:51 +00:00
Duncan P. N. Exon Smith
44554287b5 IR: Split up Constant{Array,Vector}::get(), NFC
Introduce `getImpl()` that tries the simplification logic from `get()`
and then gives up.  This allows the logic to be reused elsewhere in a
follow-up commit.

llvm-svn: 215963
2014-08-19 02:11:30 +00:00
Akira Hatanaka
857513b388 [X86, X87 stackifier] Do not mark an operand of a debug instruction as kill.
<rdar://problem/16952634>

llvm-svn: 215962
2014-08-19 02:09:57 +00:00
Duncan P. N. Exon Smith
d82edcc72a IR: Reduce RAUW traffic in ConstantExpr
Avoid RAUW-ing `ConstantExpr` when an operand changes unless the new
`ConstantExpr` already has users.  This prevents the RAUW from rippling
up the expression tree unnecessarily.

This commit indirectly adds test coverage for r215953 (this is how I
came across the bug).

This is part of PR20515.

llvm-svn: 215960
2014-08-19 01:12:53 +00:00
Duncan P. N. Exon Smith
b39b2d0a5d IR: Replace uses of ConstantAggrUniqueMap with ConstantUniqueMap
Now that `ConstantAggrUniqueMap` and `ConstantUniqueMap` work the same
way, change the aggregates to use the new one.

llvm-svn: 215959
2014-08-19 01:02:18 +00:00
Duncan P. N. Exon Smith
4136c243eb Remove extraneous typenames from r215957
llvm-svn: 215958
2014-08-19 00:55:34 +00:00
Duncan P. N. Exon Smith
8f16ed0d77 IR: Rewrite ConstantUniqueMap
Rewrite `ConstantUniqueMap` to be more similar to
`ConstantAggrUniqueMap`.

  - Use a `DenseMap` with custom MapInfo instead of a `std::map` with
    linear lookups and deletion.
  - Don't waste memory explicitly storing (heavyweight) keys.

Only `ConstantExpr` and `InlineAsm` actually use this data structure, so
I also updated them to use it.

This code cleanup is a precursor to reducing RAUW traffic on
`ConstantExpr` -- I felt badly adding a new (linear) call to
`ConstantUniqueMap::FindExistingKey`, so this designs away the concern.

A follow-up commit will transition the users of `ConstantAggrUniqueMap`
over.

llvm-svn: 215957
2014-08-19 00:42:32 +00:00
Duncan P. N. Exon Smith
b7fe111865 IR: Declare LookupKey right before its use, NFC
llvm-svn: 215956
2014-08-19 00:24:26 +00:00
Duncan P. N. Exon Smith
d00193701d IR: ArrayRef-ize {Insert,Extract}ValueConstantExpr constructors
No functionality change.

llvm-svn: 215955
2014-08-19 00:23:17 +00:00
Duncan P. N. Exon Smith
544e6159e3 Prevent clang-format from moving the namespace closing brace, NFC
llvm-svn: 215954
2014-08-19 00:21:04 +00:00
Duncan P. N. Exon Smith
4847822e30 NVPTX: Use RAUW instead of reinventing the wheel
This code had a homemade RAUW that was incorrect when a user was a
constant: instead of calling `replaceUsersWithOnConstant()` it would
incorrectly update the operand in-place, invalidating
`LLVMContextImpl::ExprConstants`.  RAUW does the job better.

The ValueHandle that `GVMap` is holding onto needs to be removed first,
so this commit also removes each variable from the map on-the-fly.

Since deletions from `ExprConstants` use a linear search that compares
directly on the pointer value (instead of using the key), there isn't an
obvious way to expose this with a testcase.

llvm-svn: 215953
2014-08-19 00:20:02 +00:00
Duncan P. N. Exon Smith
bb7967e614 LLParser: Handle BlockAddresses on-the-fly
Previously all `blockaddress()` constants were treated as forward
references.  They were resolved twice:  once at the end of the function
in question, and again at the end of the module.  Furthermore, if the
same blockaddress was referenced N times, the parser created N distinct
`GlobalVariable`s (one for each reference).

Instead, resolve all block addresses at the beginning of the function,
creating the standard `BasicBlock` forward references used for all other
basic block references.  After the function, all references can be
resolved immediately.  To check for the condition of parsing block
addresses from within the same function, I created a reference to the
current per-function-state in `BlockAddressPFS`.

Also, create only one forward-reference per basic block.  Because
forward references to block addresses are rare, the data structure here
shouldn't matter.  If somehow it does someday, this can be pretty easily
changed to a `DenseMap<std::pair<ValID, ValID>, GV>`.

This is part of PR20515.

llvm-svn: 215952
2014-08-19 00:13:19 +00:00
Duncan P. N. Exon Smith
fe4e1226be verify-uselistorder: Call verifyModule() and improve output
Call `verifyModule()` after parsing and after every transformation.
Also convert some `DEBUG(dbgs())` to `errs()` to increase visibility
into what's going on.

llvm-svn: 215951
2014-08-18 23:44:14 +00:00
Rafael Espindola
d6b7a24a83 Use a range loop. NFC.
llvm-svn: 215948
2014-08-18 23:15:59 +00:00
Rafael Espindola
129bb223fd These classes only need a StringRef, not a MemoryBuffer.
llvm-svn: 215945
2014-08-18 22:28:28 +00:00
Rafael Espindola
f4983ff7d2 Delete unused method.
llvm-svn: 215944
2014-08-18 22:20:18 +00:00
Robin Morisset
6fd6f5e912 Answer to Philip Reames comments
- add check for volatile (probably unneeded, but I agree that we should be conservative about it).
- strengthen condition from isUnordered() to isSimple(), as I don't understand well enough Unordered semantics (and it also matches the comment better this way) to be confident in the previous behaviour (thanks for catching that one, I had missed the case Monotonic/Unordered).
- separate a condition in two.
- lengthen comment about aliasing and loads
- add tests in GVN/atomic.ll

llvm-svn: 215943
2014-08-18 22:18:14 +00:00
Robin Morisset
f6230dcf49 Weak relaxing of the constraints on atomics in MemoryDependencyAnalysis
Monotonic accesses do not have to kill the analysis, as long as the QueryInstr is not
itself atomic.

llvm-svn: 215942
2014-08-18 22:18:11 +00:00
Lang Hames
a9a28a5f89 [MCJIT] Respect target endianness in RuntimeDyldMachO and RuntimeDyldChecker.
This patch may address some of the issues described in http://llvm.org/PR20640.

llvm-svn: 215938
2014-08-18 21:43:16 +00:00
Kevin Enderby
a1dd557f72 Make llvm-objdump handle both arm and thumb disassembly from the same Mach-O
file with -macho, the Mach-O specific object file parser option.

After some discussion I chose to do this implementation contained in the logic
of llvm-objdump’s MachODump.cpp using a second disassembler for thumb when
needed and with updates mostly contained in the MachOObjectFile class.

llvm-svn: 215931
2014-08-18 20:21:02 +00:00
Quentin Colombet
191766f771 [X86][Haswell][SchedModel] Tidy up.
<rdar://problem/15607571>

llvm-svn: 215924
2014-08-18 17:56:01 +00:00
Quentin Colombet
35ae8395d0 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point XMM and YMM instructions.
Sub-group: Other instructions.

<rdar://problem/15607571>

llvm-svn: 215923
2014-08-18 17:55:59 +00:00
Quentin Colombet
339e7a4ae7 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point XMM and YMM instructions.
Sub-group: Logic instructions.

<rdar://problem/15607571>

llvm-svn: 215922
2014-08-18 17:55:56 +00:00
Quentin Colombet
a553451324 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point XMM and YMM instructions.
Sub-group: Math instructions.

<rdar://problem/15607571>

llvm-svn: 215921
2014-08-18 17:55:53 +00:00
Quentin Colombet
d6c4c7ce9b [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point XMM and YMM instructions.
Sub-group: Arithmetic instructions.

<rdar://problem/15607571>

llvm-svn: 215920
2014-08-18 17:55:51 +00:00
Quentin Colombet
7c1df6f078 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point XMM and YMM instructions.
Sub-group: Conversion instructions.

<rdar://problem/15607571>

llvm-svn: 215919
2014-08-18 17:55:49 +00:00
Quentin Colombet
f82b53ca5a [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point XMM and YMM instructions.
Sub-group: Move instructions.

<rdar://problem/15607571>

llvm-svn: 215918
2014-08-18 17:55:46 +00:00
Quentin Colombet
2138e9d6a6 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer MMX and XMM instructions.
Sub-group: Other instructions.

<rdar://problem/15607571>

llvm-svn: 215917
2014-08-18 17:55:43 +00:00
Quentin Colombet
5564e8d426 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer MMX and XMM instructions.
Sub-group: Logic instructions.

<rdar://problem/15607571>

llvm-svn: 215916
2014-08-18 17:55:41 +00:00
Quentin Colombet
1e0ae9ec68 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer MMX and XMM instructions.
Sub-group: Arithmetic instructions.

<rdar://problem/15607571>

llvm-svn: 215915
2014-08-18 17:55:39 +00:00
Quentin Colombet
2e17eeecda [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer MMX and XMM instructions.
Sub-group: Move instructions.

<rdar://problem/15607571>

llvm-svn: 215914
2014-08-18 17:55:36 +00:00
Quentin Colombet
5a5bf20c9d [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point x87 instructions.
Sub-group: Math instructions.

<rdar://problem/15607571>

llvm-svn: 215913
2014-08-18 17:55:32 +00:00
Quentin Colombet
7cb8772661 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point x87 instructions.
Sub-group: Arithmetic instructions.

<rdar://problem/15607571>

llvm-svn: 215912
2014-08-18 17:55:29 +00:00
Quentin Colombet
e9298615cc [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Floating Point x87 instructions.
Sub-group: Move instructions.

<rdar://problem/15607571>

llvm-svn: 215911
2014-08-18 17:55:26 +00:00
Quentin Colombet
1f6b927d67 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: Other instructions.

<rdar://problem/15607571>

llvm-svn: 215910
2014-08-18 17:55:23 +00:00
Quentin Colombet
18ca0e449b [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: Synchronization instructions.

<rdar://problem/15607571>

llvm-svn: 215909
2014-08-18 17:55:21 +00:00
Quentin Colombet
cc1d8c9134 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: String instructions.

<rdar://problem/15607571>

llvm-svn: 215908
2014-08-18 17:55:19 +00:00
Quentin Colombet
4256d926fe [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: Control transfer instructions.

<rdar://problem/15607571>

llvm-svn: 215907
2014-08-18 17:55:16 +00:00
Quentin Colombet
ce7a0aea69 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: Logic instructions.

<rdar://problem/15607571>

llvm-svn: 215906
2014-08-18 17:55:13 +00:00
Quentin Colombet
05843ffc63 [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: Arithmetic instructions.

<rdar://problem/15607571>

llvm-svn: 215905
2014-08-18 17:55:11 +00:00
Quentin Colombet
63d62b768f [X86][Haswell][SchedModel] Add architecture specific scheduling models.
Group: Integer instructions.
Sub-group: Move instructions.

<rdar://problem/15607571>

llvm-svn: 215904
2014-08-18 17:55:08 +00:00