1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

115199 Commits

Author SHA1 Message Date
Sanjay Patel
1a17022bda optimize the AVX2 (integer) version of vperm2 into a shuffle
...because this is what happens when an instruction
set puts its underwear on after its pants.

This is an extension of r232852, r233100, and 233110:
http://llvm.org/viewvc/llvm-project?view=revision&revision=232852
http://llvm.org/viewvc/llvm-project?view=revision&revision=233100
http://llvm.org/viewvc/llvm-project?view=revision&revision=233110

llvm-svn: 233127
2015-03-24 22:39:29 +00:00
David Blaikie
0dc1532dd9 Opaque Pointer Types: GEP API migrations to specify the gep type explicitly
The changes to InstCombine do seem a bit silly - it doesn't make
anything obviously better to have the caller access the pointers element
type (the thing I'm trying to remove) than the GEP itself, but it's a
helpful migration step. This will allow me to more obviously lock down
GEP (& Load, etc) API usage, then fix all the code that accesses pointer
element types except the places that need to be removed (most of the
InstCombines) anyway - at which point I'll need to just remove all that
code because it won't be meaningful anymore (there will be no pointer
types, so no bitcasts to combine)

llvm-svn: 233126
2015-03-24 22:38:16 +00:00
Philip Reames
d57b6c2219 Merge empty landing pads in SimplifyCFG
This patch tries to merge duplicate landing pads when they branch to a common shared target.

Given IR that looks like this:
lpad1:
  %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
         cleanup
  br label %shared_resume
lpad2:
  %exn2 = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
          cleanup
  br label %shared_resume
shared_resume:
  call void @fn()
  ret void
}

We can rewrite the users of both landing pad blocks to use one of them. This will generally allow the shared_resume block to be merged with the common landing pad as well.

Without this change, tail duplication would likely kick in - creating N (2 in this case) copies of the shared_resume basic block.

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

llvm-svn: 233125
2015-03-24 22:28:45 +00:00
Rafael Espindola
080774aa10 Add -m -m elf_x86_64 to gold invocations.
Otherwise the tests would fail if the default was not elf_x86_64.

This fixes PR22966.

Patch by H.J. Lu!

llvm-svn: 233124
2015-03-24 22:20:19 +00:00
David Blaikie
8b46a1bcb2 Revert "Remove an InstCombine that seems to have become redundant."
Assertion fires in compiler-rt. Guess it does fire..

This reverts commit r233116.

llvm-svn: 233121
2015-03-24 21:50:35 +00:00
Rafael Espindola
4d759582ac Reset the CFA offset at the start of every FDE.
This fixes PR21515.

llvm-svn: 233120
2015-03-24 21:47:31 +00:00
Peter Collingbourne
c55866b5f0 AArch64: use a different means to determine whether to byte swap relocations.
This code depended on a bug in the FindAssociatedSection function that would
cause it to return the wrong result for certain absolute expressions. Instead,
use EvaluateAsRelocatable.

llvm-svn: 233119
2015-03-24 21:47:03 +00:00
Peter Collingbourne
e3e4b234d3 MC: Add more stringent symbol checking to test.
llvm-svn: 233118
2015-03-24 21:47:00 +00:00
David Blaikie
0914ef9c6b Remove an InstCombine that seems to have become redundant.
Assert that this doesn't fire - I'll remove all of this later, but just
leaving it in for a while in case this is firing & we just don't have
test coverage.

llvm-svn: 233116
2015-03-24 21:31:31 +00:00
Sanjay Patel
c077161b46 [X86, AVX] instcombine vperm2 intrinsics with zero inputs into shuffles
This is the IR optimizer follow-on patch for D8563: the x86 backend patch
that converts this kind of shuffle back into a vperm2.

This is also a continuation of the transform that started in D8486. 
In that patch, Andrea suggested that we could convert vperm2 intrinsics that
use zero masks into a single shuffle. 

This is an implementation of that suggestion.

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

llvm-svn: 233110
2015-03-24 20:36:42 +00:00
Rafael Espindola
04257c30fe [llvm-readobj] add support for macho universal binary.
Patch by Keyue Hu (Chilledheart)!

llvm-svn: 233107
2015-03-24 20:26:55 +00:00
Hans Wennborg
fbd19841f0 Revert r233062 ""float2int": Add a new pass to demote from float to int where possible."
This caused PR23008, compiles failing with: "Use still stuck around after Def is
destroyed: %.sroa.speculated"

Also reverting follow-up r233064.

llvm-svn: 233105
2015-03-24 20:07:08 +00:00
Sanjoy Das
5e0d47a08c [IRCE] Fix how IRCE checks for no-sign-overflow.
IRCE requires the induction variables it handles to not sign-overflow.
The current scheme of checking if sext({X,+,S}) == {sext(X),+,sext(S)}
fails when SCEV simplifies sext(X) too.  After this change we //also//
check no-signed-wrap by looking at the flags set on the SCEVAddRecExpr.

llvm-svn: 233102
2015-03-24 19:29:22 +00:00
Sanjoy Das
867451d1ec [IRCE] Fix a regression introduced in r232444.
IRCE should not try to eliminate range checks that check an induction
variable against a loop-varying length.

llvm-svn: 233101
2015-03-24 19:29:18 +00:00
Sanjay Patel
b1b1054a09 [X86, AVX] recognize shufflevector with zero input as a vperm2 (PR22984)
vperm2x128 instructions have the special ability (aka free hardware capability)
to shuffle zero values into a vector.

This patch recognizes that type of shuffle and generates the appropriate
control byte.

https://llvm.org/bugs/show_bug.cgi?id=22984

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

llvm-svn: 233100
2015-03-24 19:19:07 +00:00
Duncan P. N. Exon Smith
5a400c0e6a DebugInfo: Reorder definitions of MDLocation and MDFile, NFC
Move definition of `MDLocation` after `MDLocalScope` so that the latter
is available for casts in the former.  Similarly, move the definition of
`MDFile` as early as possible so that other classes can cast to it in
their definitions.  (Follow-up commits will take advantage of this.)

llvm-svn: 233096
2015-03-24 17:34:33 +00:00
Duncan P. N. Exon Smith
f3cc216d43 Verifier: Start recursing into !dbg attachments
The main verifier already recurses through the other entry points, so we
might as well descend here too.

This temporarily duplicates some work already done in
`verifyDebugInfo()`, but eventually I'll be removing the other side.

llvm-svn: 233095
2015-03-24 17:32:19 +00:00
Duncan P. N. Exon Smith
5205e351d5 Verifier: !llvm.dbg.cu must point at compile units
Duplicate this check from `verifyDebugInfo()`.

llvm-svn: 233094
2015-03-24 17:18:03 +00:00
Duncan P. N. Exon Smith
234968b5ab DebugInfo: Add MDLocalScope, a legal scope for locals
Add a subclass of `MDScope` to explicitly categorize the legal scopes
for locals -- in particular, scopes that are legal for `MDLocation`,
`MDLexicalBlockBase`, and `MDLocalVariable`.  This provides a convenient
`isa<>` target for the verifier, and eventually I'll be changing the
above classes' `getScope()` to specifically return it.  Currently, its
subclasses are `MDSubprogram`, `MDLexicalBlock`, and
`MDLexicalBlockFile`.

I've gone with `MDLocalScope` for now -- a little ambiguous since it's a
scope *for* locals, not a scope that's local -- but I'm open to more
descriptive names if someone can think of something better.  Regardless,
the code docs should make it clear enough.

llvm-svn: 233092
2015-03-24 16:44:29 +00:00
David Blaikie
05fce2b87b Refactor: Simplify boolean expressions in lib/Analysis
Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

Reviewed By: nlewycky

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

llvm-svn: 233091
2015-03-24 16:33:19 +00:00
David Blaikie
eefd19904e Refactor: Simplify boolean expressions in AArch64 target
Simplify boolean expressions using `true` and `false` with `clang-tidy`

Patch by Richard Thomson.

Reviewed By: rengolin

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

llvm-svn: 233089
2015-03-24 16:24:01 +00:00
Daniel Sanders
e5e125c433 [mips] Support 16-bit offsets for 'm' inline assembly memory constraint.
Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 233086
2015-03-24 15:19:14 +00:00
Marek Olsak
744cadde2c R600/SI: Insert more NOPs after READLANE on VI, don't use NOPs on CI
This is a candidate for stable.

llvm-svn: 233080
2015-03-24 13:40:38 +00:00
Marek Olsak
54f696654d R600/SI: Select V_BFE_U32 for and+shift with a non-literal offset
llvm-svn: 233079
2015-03-24 13:40:34 +00:00
Marek Olsak
4534b3e944 R600/SI: Custom-select 32-bit S_BFE from bitwise opcodes
llvm-svn: 233078
2015-03-24 13:40:27 +00:00
Marek Olsak
94b7dfa0f9 R600/SI: Improve BFM support
llvm-svn: 233077
2015-03-24 13:40:21 +00:00
Marek Olsak
b3b6175988 R600/SI: Use V_FRACT_F64 for faster 64-bit floor on SI
Other f64 opcodes not supported on SI can be lowered in a similar way.

v2: use complex VOP3 patterns
llvm-svn: 233076
2015-03-24 13:40:15 +00:00
Marek Olsak
319154a0b6 R600/SI: Expand fract to floor, then only select V_FRACT on CI
V_FRACT is buggy on SI.

R600-specific code is left intact.

v2: drop the multiclass, use complex VOP3 patterns
llvm-svn: 233075
2015-03-24 13:40:08 +00:00
Benjamin Kramer
ddeec2a32e Internalize the StackMapLiveness pass.
No need to have its own header when it's not used anywhere. NFC.

llvm-svn: 233072
2015-03-24 13:20:54 +00:00
Michael Kuperstein
1278cdeb94 Revert "Use std::bitset for SubtargetFeatures"
This reverts commit r233055.

It still causes buildbot failures (gcc running out of memory on several platforms, and a self-host failure on arm), although less than the previous time.

llvm-svn: 233068
2015-03-24 12:56:59 +00:00
Aaron Ballman
ca3c41adf3 Silencing some MSVC warnings "C4805: '^' : unsafe mix of type 'bool' and type 'unsigned int' in operation"; NFC.
llvm-svn: 233067
2015-03-24 12:47:51 +00:00
Simon Atanasyan
6273f8a523 [mips] Simplify boolean expressions in Mips target with clang-tidy
No functional changes.

Patch by Richard Thomson.

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

llvm-svn: 233065
2015-03-24 12:24:56 +00:00
Benjamin Kramer
99a748be6f [float2int] Sort includes and add missing raw_ostream include.
llvm-svn: 233064
2015-03-24 11:28:47 +00:00
Daniel Sanders
a19a2fd8a5 [mips] Distinguish 'R', 'ZC', and 'm' inline assembly memory constraint.
Summary:
Previous behaviour of 'R' and 'm' has been preserved for now. They will be
improved in subsequent commits.

The offset permitted by ZC varies according to the subtarget since it is
intended to match the restrictions of the pref, ll, and sc instructions.

The restrictions on these instructions are:
* For microMIPS: 12-bit signed offset.
* For Mips32r6/Mips64r6: 9-bit signed offset.
* Otherwise: 16-bit signed offset.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 233063
2015-03-24 11:26:34 +00:00
James Molloy
32530d77c8 "float2int": Add a new pass to demote from float to int where possible.
It is possible to have code that converts from integer to float, performs operations then converts back, and the result is provably the same as if integers were used.

This can come from different sources, but the most obvious is a helper function that uses floats but the arguments given at an inlined callsites are integers.

This pass considers all integers requiring a bitwidth less than or equal to the bitwidth of the mantissa of a floating point type (23 for floats, 52 for doubles) as exactly representable in floating point.

To reduce the risk of harming efficient code, the pass only attempts to perform complete removal of inttofp/fptoint operations, not just move them around.

llvm-svn: 233062
2015-03-24 11:15:23 +00:00
Michael Kuperstein
c6ff005c9e Use std::bitset for SubtargetFeatures
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first time this was committed (r229831), it caused several buildbot failures. 
At least some of the ARM ones were due to gcc/binutils issues, and should now be fixed.

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

llvm-svn: 233055
2015-03-24 09:17:25 +00:00
Lang Hames
92f163bb4c [Orc] Move delta-handling for trampoline sizes into the resolver block.
This is the first step towards adding a target-independent callback
handler API.

llvm-svn: 233049
2015-03-24 04:27:02 +00:00
Lang Hames
5569df9c3b [Orc] Whitespace fix. NFC.
llvm-svn: 233048
2015-03-24 04:07:28 +00:00
Lang Hames
2a432406f6 [Orc] Use std::string to capture name by value.
This just updates the code to reflect the comment, but this bug actually hit the
out-of-tree lazy demo. I'm working on a patch to add the lazy-demo's
functionality to lli so that we can test this in-tree soon.

llvm-svn: 233047
2015-03-24 04:07:01 +00:00
Simon Pilgrim
67352336fb [SelectionDAG] Fixed issue with uitofp vector constant folding being treated as sitofp
While the uitofp scalar constant folding treats an integer as an unsigned value (from lang ref):

%X = sitofp i8 -1 to double ; yields double:-1.0
%Y = uitofp i8 -1 to double ; yields double:255.0

The vector constant folding was always using sitofp:

%X = sitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0>
%Y = uitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0>

This patch fixes this so that the correct opcode is used for sitofp and uitofp.

%X = sitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double -1.0, double -1.0>
%Y = uitofp <2 x i8> <i8 -1, i8 -1> to <2 x double> ; yields <double 255.0, double 255.0>

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

llvm-svn: 233033
2015-03-23 22:44:55 +00:00
Duncan P. N. Exon Smith
13df1fd672 Remove dead prototype DebugInfoFinder::processExpression(), NFC
llvm-svn: 233031
2015-03-23 22:10:27 +00:00
Duncan P. N. Exon Smith
e1ff992bb4 DebugInfo: Overload get() in DIDescriptor subclasses
Continue to simplify the `DIDescriptor` subclasses, so that they behave
more like raw pointers.  Remove `getRaw()`, replace it with an
overloaded `get()`, and overload the arrow and cast operators.  Two
testcases started to crash on the arrow operators with this change
because of `scope:` references that weren't real scopes.  I fixed them.
Soon I'll add verifier checks for them too.

This also adds explicit dereference operators.  Previously, the builtin
dereference against `operator MDNode *()` would have worked, but now the
builtins are ambiguous.

llvm-svn: 233030
2015-03-23 21:54:07 +00:00
Rafael Espindola
497f3f85f5 Refactor how passes get a symbol at the end of a section.
There is now a canonical symbol at the end of a section that different
passes can request.

This also allows us to assert that we don't switch back to a section whose
end symbol has already been printed.

llvm-svn: 233026
2015-03-23 21:22:04 +00:00
David Blaikie
3ec1353923 Cleanup else-after-return and add an early-return to llvm-nm
The loop and error handling in checkMachOAndArchFlags didn't make sense
to me (a loop that only ever executes once? An error path that uses the
element the loop stopped at (which must always be a buffer overrun if
I'm reading that right?)... I'm confused) but I've made a guess at what
was intended.

Based on a patch by Richard Thomson to simplify boolean expressions.

llvm-svn: 233025
2015-03-23 21:17:43 +00:00
Ahmed Bougacha
dda2ff1737 [AArch64, ARM] Enable GlobalMerge with -O3 rather than -O1.
The pass used to be enabled by default with CodeGenOpt::Less (-O1).
This is too aggressive, considering the pass indiscriminately merges
all globals together.

Currently, performance doesn't always improve, and, on code that uses
few globals (e.g., the odd file- or function- static), more often than
not is degraded by the optimization.  Lengthy discussion can be found
on llvmdev (AArch64-focused;  ARM has similar problems):
  http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-February/082800.html
Also, it makes tooling and debuggers less useful when dealing with
globals and data sections.

GlobalMerge needs to better identify those cases that benefit, and this
will be done separately.  In the meantime, move the pass to run with
-O3 rather than -O1, on both ARM and AArch64.

llvm-svn: 233024
2015-03-23 21:17:36 +00:00
David Blaikie
9bd6b0151e Refactor: Simplify boolean expressions in R600 target
Simplify boolean expressions with `true` and `false` using `clang-tidy`

Patch by Richard Thomson.

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

llvm-svn: 233020
2015-03-23 20:56:44 +00:00
Rafael Espindola
d63afc96b5 Update variable name and reuse existing variable. NFC.
llvm-svn: 233014
2015-03-23 20:25:31 +00:00
Chad Rosier
99ad3fa4ff [AArch64] Add FileCheck that was missing from test in r232967.
llvm-svn: 233013
2015-03-23 20:25:15 +00:00
Chris Bieneman
12a0a5d060 Re-land: Generate targets for each lit suite.
Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

* Also fixed a minor issue that Duncan pointed out to me I was passing the suite to lit twice

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

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

llvm-svn: 233009
2015-03-23 20:04:00 +00:00
Chris Bieneman
513563f41e Raising minimum required CMake version to 2.8.12.2.
This commit is in reference to the llvm-dev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083672.html

llvm-svn: 233008
2015-03-23 20:03:57 +00:00