1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
Commit Graph

171314 Commits

Author SHA1 Message Date
Fedor Sergeev
827d148a24 [SimpleLoopUnswitch] partial unswitch needs to be careful when replacing invariants with constants
When partial unswitch operates on multiple conditions at once, .e.g:
   if (Cond1 || Cond2 || NonInv) ...

it should infer (and replace) values for individual conditions only on one
side of unswitch and not another.

More precisely only these derivations hold true:
   (Cond1 || Cond2) == false  =>  Cond1 == Cond2 == false
   (Cond1 && Cond2) == true   =>  Cond1 == Cond2 == true

By the way we organize unswitching it means only replacing on "continue" blocks
and never on "unswitched" ones. Since trivial unswitch does not have "unswitched"
blocks it does not have this problem.

Fixes PR 39568.

Reviewers: chandlerc, asbirlea
Differential Revision: https://reviews.llvm.org/D54211

llvm-svn: 346350
2018-11-07 20:05:11 +00:00
Jessica Paquette
358484f9be [MachineOutliner][NFC] Remove Parent field from SuffixTreeNode
This is only used for calculating ConcatLen. This isn't necessary,
since it's easily derived from the traversal setting suffix indices.

Remove that. Rename CurrIdx to CurrNodeLen to better describe what's
going on.

llvm-svn: 346349
2018-11-07 19:56:13 +00:00
Martin Elshuber
859bba7aa8 [Support] Fix line width to 80
Test commit

llvm-svn: 346348
2018-11-07 19:35:04 +00:00
Jessica Paquette
8db496fe15 [MachineOutliner][NFC] Traverse suffix tree using a RepeatedSubstring iterator
This takes the traversal methods introduced in r346269 and adapts them
into an iterator. This allows the outliner to iterate over repeated substrings
within the suffix tree directly without having to initially find all of the
substrings and then iterate over them after you've found them.

llvm-svn: 346345
2018-11-07 19:20:55 +00:00
Matt Davis
89fe6b1c0c [llvm-mca] Move the AssembleInput logic into its own class.
Summary:
This patch introduces a CodeRegionGenerator class which is responsible for parsing some type of input and creating a 'CodeRegions' instance for use by llvm-mca.  In the future, we will also have a CodeRegionGenerator subclass for converting an input object file into CodeRegions.  For now, we only have the subclass for converting input assembly into CodeRegions.

This is mostly a NFC patch, as the logic remains close to the original, but now encapsulated in its own class and moved outside of llvm-mca.cpp.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: mgorny, tschuett, gbedwell, llvm-commits

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

llvm-svn: 346344
2018-11-07 19:20:04 +00:00
Petr Hosek
d08d83a26c [llvm-mt] Accept and ignore notify_update flag
This flag is being set by CMake when invoking mt.

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

llvm-svn: 346341
2018-11-07 18:36:50 +00:00
Jessica Paquette
5a2029a827 [MachineOutliner] Don't store outlined function numberings on OutlinedFunction
NFC-ish. This doesn't change the behaviour of the outliner, but does make sure
that you won't end up with say

OUTLINED_FUNCTION_2:
...
ret

OUTLINED_FUNCTION_248:
...
ret

as the only outlined functions in your module. Those should really be

OUTLINED_FUNCTION_0:
...
ret

OUTLINED_FUNCTION_1:
...
ret

If we produce outlined functions, they probably should have sequential numbers
attached to them. This makes it a bit easier+stable to write outliner tests.

The point of this is to move towards a bit more stability in outlined function
names. By doing this, we at least don't rely on the traversal order of the
suffix tree. Instead, we rely on the order of the candidate list, which is
*far* more consistent. The candidate list is ordered by the end indices of
candidates, so we're more likely to get a stable ordering. This is still
susceptible to changes in the cost model though (like, if we suddenly find new
candidates, for example).

llvm-svn: 346340
2018-11-07 18:36:43 +00:00
Mandeep Singh Grang
811edd5b75 [LoopSink] Do not sink instructions into non-cold blocks
Summary: This fixes PR39570.

Reviewers: danielcdh, rnk, bkramer

Reviewed By: rnk

Subscribers: llvm-commits

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

llvm-svn: 346337
2018-11-07 18:26:24 +00:00
Than McIntosh
ac90f953ca [X86] improve split-stack machine BB placement
Summary:
The conditional branch created to support -fsplit-stack for X86 is
left unbiased/unhinted, resulting in less than ideal block placement:
the __morestack call block is kept on the main hot path. Bias the
branch to insure that the stack allocation block is treated as a
"cold" block during machine basic block placement.

Subscribers: llvm-commits

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

llvm-svn: 346336
2018-11-07 17:41:57 +00:00
Florian Hahn
97c8f6a46c [NewGVN] Make sure we do not add a user to itself.
If we simplify an instruction to itself, we do not need to add a user to
itself. For congruence classes with a defining expression, we already
use a similar logic.

Fixes PR38259.

Reviewers: davide, efriedma, mcrosier

Reviewed By: davide

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

llvm-svn: 346335
2018-11-07 17:20:07 +00:00
James Y Knight
9fe36dfbc6 Workaround PPC backend bug in test for r346322.
It seems that the PPC backend croaks when lowering a call to a
function with an argument of type [2 x i32].

Just modify the type slightly to avoid this -- I wasn't actually
intending to stress test the backend...

llvm/lib/Target/PowerPC/PPCISelLowering.cpp:6172: llvm::SDValue llvm::PPCTargetLowering::LowerCall_64SVR4(...): Assertion `(!HasParameterArea || NumBytesActuallyUsed == ArgOffset) && "mismatch in size of parameter area"' failed.

llvm-svn: 346334
2018-11-07 17:01:47 +00:00
Clement Courbet
48dafb228c [llvm-exegesis] Remove superfluous move.
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/tools/llvm-exegesis/lib/X86/Target.cpp:155:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
    return std::move(Error);
           ^
/Users/buildslave/as-bldslv9_new/lld-x86_64-darwin13/llvm.src/tools/llvm-exegesis/lib/X86/Target.cpp:155:12: note: remove std::move call here
    return std::move(Error);
           ^~~~~~~~~~     ~

llvm-svn: 346333
2018-11-07 16:52:50 +00:00
Serge Guelton
509156acdd Fix ignorded type qualifier warning [NFC]
llvm-svn: 346332
2018-11-07 16:17:30 +00:00
Sanjay Patel
cf6a337475 [InstCombine] propagate FMF for fcmp+fabs folds
By morphing the instruction rather than deleting and creating a new one,
we retain fast-math-flags and potentially other metadata (profile info?).

llvm-svn: 346331
2018-11-07 16:15:01 +00:00
Clement Courbet
ef0f2c3fee [llvm-exegesis] Correclty handle all X86 memory encoding formats.
Summary:
Add unit tests to check the support for each supported format to avoid
regressions such as the one in PR36906.

Reviewers: gchatelet

Subscribers: tschuett, lebedev.ri, llvm-commits

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

llvm-svn: 346330
2018-11-07 16:14:55 +00:00
Clement Courbet
1a22f5f791 [llvm-exegesis] Increasing wrapping limit.
Summary: Fixes PR39097.

Reviewers: gchatelet

Subscribers: llvm-commits, tschuett

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

llvm-svn: 346328
2018-11-07 15:46:45 +00:00
Sanjay Patel
0e63578010 [InstCombine] peek through fabs() when checking isnan()
That should be the end of the missing cases for this fold.
See earlier patches in this series:
rL346321
rL346324

llvm-svn: 346327
2018-11-07 15:44:26 +00:00
Sanjay Patel
0836d33d44 [InstCombine] add tests for isnan(fabs(X)); NFC
llvm-svn: 346325
2018-11-07 15:36:23 +00:00
Sanjay Patel
d5269327f9 [InstCombine] add folds for fcmp Pred fabs(X), 0.0
Similar to rL346321, we had folds for the ordered
versions of these compares already, so add the
unordered siblings for completeness.

llvm-svn: 346324
2018-11-07 15:33:03 +00:00
Sanjay Patel
26560db745 [InstCombine] add tests for more fcmp+fabs preds; NFC
llvm-svn: 346323
2018-11-07 15:27:02 +00:00
James Y Knight
2ef80c3692 Add support for llvm.is.constant intrinsic (PR4898)
This adds the llvm-side support for post-inlining evaluation of the
__builtin_constant_p GCC intrinsic.

Also fixed SCCPSolver::visitCallSite to not blow up when seeing a call
to a function where canConstantFoldTo returns true, and one of the
arguments is a struct.

Updated from patch initially by Janusz Sobczak.

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

llvm-svn: 346322
2018-11-07 15:24:12 +00:00
Sanjay Patel
8c14908731 [InstCombine] add fold for fabs(X) u< 0.0
The sibling fold for 'oge' --> 'ord' was already here,
but this half was missing. 

The result of fabs() must be positive or nan, so asking 
if the result is negative or nan is the same as asking 
if the result is nan.

This is another step towards fixing:
https://bugs.llvm.org/show_bug.cgi?id=39475

llvm-svn: 346321
2018-11-07 15:11:32 +00:00
Sanjay Patel
e65ef5098e [InstCombine] add test for fcmp+fabs; NFC
llvm-svn: 346320
2018-11-07 15:01:09 +00:00
Calixte Denizet
fe50815f32 Fix unit tests after patch https://reviews.llvm.org/rL346313
Summary: Tests are broken so fix them.

Reviewers: marco-c

Reviewed By: marco-c

Subscribers: sylvestre.ledru, llvm-commits

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

llvm-svn: 346318
2018-11-07 14:46:26 +00:00
Sanjay Patel
1aa44e6e6c [InstCombine] add FMF to fcmp to show failure to propagate; NFC
llvm-svn: 346317
2018-11-07 14:44:09 +00:00
Sanjay Patel
9a59793e0b fix typos aggressively; NFC
llvm-svn: 346316
2018-11-07 14:35:36 +00:00
Sanjay Patel
fae8bdb1d4 [InstCombine] do not shrink switch conditions to illegal types (PR29009)
This patch makes shrinking switch conditions less aggressive which was introduced by:
rL274233

Note that we have 2 new bugs to track potential follow-ups that might have solved PR29009
in different ways:
https://bugs.llvm.org/show_bug.cgi?id=39569
https://bugs.llvm.org/show_bug.cgi?id=39578

Patch by:
@dendibakh (Denis Bakhvalov)

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

llvm-svn: 346315
2018-11-07 14:12:41 +00:00
Calixte Denizet
b70eb3f2b6 [GCOV] Flush counters before to avoid counting the execution before fork twice and for exec** functions we must flush before the call
Summary:
This is replacement for patch in https://reviews.llvm.org/D49460.
When we fork, the counters are duplicate as they're and so the values are finally wrong when writing gcda for parent and child.
So just before to fork, we flush the counters and so the parent and the child have new counters set to zero.
For exec** functions, we need to flush before the call to have some data.

Reviewers: vsk, davidxl, marco-c

Reviewed By: marco-c

Subscribers: llvm-commits, sylvestre.ledru, marco-c

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

llvm-svn: 346313
2018-11-07 13:49:17 +00:00
Andrea Di Biagio
0d6585af89 [X86][FixupLEA] Avoid checking target features for every single processed instruction. NFCI
llvm-svn: 346309
2018-11-07 12:26:00 +00:00
Dean Michael Berris
685eebeba5 [XRay] Clean up more std::copy(...)'s
Update a couple more places to use conversion from StringRef to string.

llvm-svn: 346306
2018-11-07 11:52:22 +00:00
Petar Avramovic
3cfb9fd6e6 [MIPS GlobalISel] Set operand order for G_MERGE and G_UNMERGE
Set operands order for G_MERGE_VALUES and G_UNMERGE_VALUES so
that least significant bits always go first, regardless of endianness.

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

llvm-svn: 346305
2018-11-07 11:45:43 +00:00
Dean Michael Berris
e28c33d0fe [XRay] Use explicit string conversion
Instead of using std::copy(...), use a conversion to string instead from
StringRef to std::string.

llvm-svn: 346304
2018-11-07 11:44:00 +00:00
Kristof Beyls
2fe686afa0 Introduce bug life cycle documentation.
Document what is expected during:
* triaging
* actively working on a bug
* closing/resolving

Also document how we maintain:
* product/component breakdown
* default-cc lists per component

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

llvm-svn: 346299
2018-11-07 08:49:36 +00:00
Matthias Braun
dbe475296c RegAllocFast: Leave unassigned virtreg entries in map
Set `LiveReg::PhysReg` to zero when freeing a register instead of
removing it from the entry from `LiveRegMap`. This way no iterators get
invalidated and we can avoid passing around and updating iterators all
over the place.

This does not change any allocator decisions. It is not completely NFC
because the arbitrary iteration order through `LiveRegMap` in
`spillAll()` changes so we may get a different order in those spill
sequences (the amount of spills does not change).

This is in preparation of https://reviews.llvm.org/D52010.

llvm-svn: 346298
2018-11-07 06:57:03 +00:00
Matthias Braun
1db48b8ffc RegAllocFast: Further cleanups; NFC
This is in preparation of https://reviews.llvm.org/D52010.

llvm-svn: 346297
2018-11-07 06:57:02 +00:00
Matthias Braun
699987ceed RegAllocFast: Refactor PhysRegState usage; NFC
This is in preparation of https://reviews.llvm.org/D52010.

llvm-svn: 346296
2018-11-07 06:57:00 +00:00
Max Kazantsev
8d48ba24d6 [NFC] Add missing test case, some test renaming
llvm-svn: 346295
2018-11-07 05:58:10 +00:00
Dean Michael Berris
d9e9a38395 [XRay] Use TSC delta encoding for custom/typed events
Summary:
This change updates the version number for FDR logs to 5, and update the
trace processing to support changes in the custom event records.

In the runtime, since we're already writing down the record preamble to
handle CPU migrations and TSC wraparound, we can use the same TSC delta
encoding in the custom event and typed event records that we use in
function event records. We do the same change to typed events (which
were unsupported before this change in the trace processing) which now
show up in the trace.

Future changes should increase our testing coverage to make custom and
typed events as first class entities in the FDR mode log processing
tools.

This change is also a good example of how we end up supporting new
record types in the FDR mode implementation. This shows the places where
new record types are added and supported.

Depends on D54139.

Reviewers: mboerger

Subscribers: hiraditya, arphaman, jfb, llvm-commits

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

llvm-svn: 346293
2018-11-07 04:37:42 +00:00
Fangrui Song
6656cc18c1 [llvm-strip] Check "strip" with StringRef::contains instead of ends_with
Summary: If argv[0] is version suffixed, e.g. llvm-strip-7, this will still work.

Reviewers: rupprecht, jhenderson, alexshap, jakehehrlich

Reviewed By: rupprecht

Subscribers: alexshap, jakehehrlich, llvm-commits

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

llvm-svn: 346292
2018-11-07 03:02:11 +00:00
Heejin Ahn
075bb2a339 [WebAssembly] Update more test cases after FixFunctionBitcasts
These test updates were missing from rL346286.

llvm-svn: 346291
2018-11-07 02:26:03 +00:00
Shoaib Meenai
4d007763b7 [cmake] Fix typo. NFC
llvm-svn: 346290
2018-11-07 02:22:59 +00:00
Matthias Braun
b375e31b89 RegAllocFast: Factor spill/reload creation into their own functions; NFC
This is in preparation of https://reviews.llvm.org/D52010.

llvm-svn: 346289
2018-11-07 02:04:12 +00:00
Matthias Braun
54fad8e39d RegAllocFast: Cleanups; NFC
This is in preparation of https://reviews.llvm.org/D52010.

llvm-svn: 346288
2018-11-07 02:04:11 +00:00
Matthias Braun
f32d8f4914 RegAllocFast: Rename statistic from NumCopies to NumCoalesced
The metric does not return the number of remaining (or inserted) copies
but the number of copies that were coalesced. Pick a more descriptive
name.

llvm-svn: 346287
2018-11-07 02:04:07 +00:00
Heejin Ahn
58e7365bdd [WebAssembly] Update test cases after FixFunctionBitcasts
Summary:
This updates generated binaries and corresponding test cases up to date
after applying FixFunctionBitcasts pass.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 346286
2018-11-07 01:58:50 +00:00
Sanjay Patel
f179477a91 [IR] add optional parameter for copying IR flags to compare instructions
As shown, this is used to eliminate redundant code in InstCombine,
and there are more cases where we should be using this pattern, but
we're currently unintentionally dropping flags. 

llvm-svn: 346282
2018-11-07 00:00:42 +00:00
Reid Kleckner
b374e0f7cc [Windows] Simplify WindowsSupport.h
Sink Windows version detection code from WindowsSupport.h to Path.inc.
These functions don't need to be inlined. I randomly picked Process.inc
for the Windows version helpers, since that's the most related file.

Sink MakeErrMsg to Program.inc since it's the main client.

Move those functions into the llvm namespace, and delete the scoped
handle copy and assignment operators.

Reviewers: zturner, aganea

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

llvm-svn: 346280
2018-11-06 23:39:59 +00:00
Joel E. Denny
f32a32c5f2 [FileCheck] Try to fix windows bots broken by r346272
llvm-svn: 346277
2018-11-06 22:42:10 +00:00
Jessica Paquette
68c8782fd8 [MachineOutliner][NFC] Remove OccurrenceCount from SuffixTreeNode
After changing the way we find candidates in r346269, this is no longer used.

llvm-svn: 346275
2018-11-06 22:23:13 +00:00
Jessica Paquette
8ee5dc69b2 [MachineOutliner][NFC] Remove IsInTree from SuffixTreeNode
After changing the way we find repeated substrings in r346269, this
field is no longer used by anything, so it can be removed.

llvm-svn: 346274
2018-11-06 22:21:11 +00:00