1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
Commit Graph

205251 Commits

Author SHA1 Message Date
Nikita Popov
276c80db80 [AA] Add helper to update result (NFC)
This pattern was repeated a few times, and for some reason always
using insert or try_emplace, even though we know in advance that
we're looking for an existing entry and not trying to create a
new one.
2020-10-18 16:43:26 +02:00
Florian Hahn
7d15a0e076 [DSE] Add tests for elimination at end of function with lifetime. 2020-10-18 15:39:18 +01:00
Dávid Bolvanský
c00f77d038 [LoopIdiom] Regenerate test checks; NFC 2020-10-18 14:07:04 +02:00
Florian Hahn
367dd6168d [DSE] Add tests with noalias store between noop load/store.
This adds 2 new tests from PR47887 and regenerates the check lines for
the file.
2020-10-18 10:43:24 +01:00
Fangrui Song
e0fdba735c Delete unneeded X86RegisterInfo::hasReservedSpillSlot. NFC
Only PowerPC and RISCV need to override it.
2020-10-17 23:18:55 -07:00
Craig Topper
e59aedc474 [X86] Remove unnecessary defaulted argument from function in X86FoldTablesEmitter.cpp. NFC
Nothing ever calls it with anything other than the default value.
So just delete it and the code that handled the non-default value.
2020-10-17 22:21:32 -07:00
Fangrui Song
7ff937698c [PrologEpilogInserter][test] Improve SpilledToReg test
D39386 made CalleeSavedInfo possible to spill a register to another register
(vector register for POWER9) but did not actually test live-in.
2020-10-17 20:36:22 -07:00
Craig Topper
95f53f42e4 [X86] Mark the Key Locker instructions as NotMemoryFoldable to make the X86FoldTablesEmitter not crash.
loadiwkey and aesenc128kl share the same opcode but one is memory
and one is register. But they're behavior is quite different. We
were crashing because one has an output register and one doesn't
and the backend couldn't account for that. But since they aren't
foldable we can just add NotMemoryFoldable so they won't be looked at.
2020-10-17 18:02:54 -07:00
Dávid Bolvanský
99be25a2bd [Tests] Added tests for D88328 2020-10-18 02:06:39 +02:00
Dávid Bolvanský
1673db2f55 [InferAttrs] Add argmemonly attribute to string libcalls
Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D89602
2020-10-18 01:33:26 +02:00
Nikita Popov
7f6c688445 [BasicAA] Avoid alias query if result cannot be used (NFCI)
Rather then querying first and then checking additional conditions,
check the conditions first. They are much cheaper than the alias
query.
2020-10-18 00:00:15 +02:00
Nikita Popov
38146647e2 [BasicAA] Fix stale comment (NFC)
DataLayout is always around...
2020-10-17 23:58:58 +02:00
Dávid Bolvanský
80e98a1b7e Revert "[InferAttrs] Add argmemonly attribute to string libcalls"
This reverts commit b77dd32a6fcc53908aaffc065d4d5b05026ddda7. Sanitizer tests are broken.
2020-10-17 23:29:02 +02:00
Dávid Bolvanský
1dc947d412 [InferAttrs] Add argmemonly attribute to string libcalls
Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D89602
2020-10-17 22:42:36 +02:00
Roman Lebedev
1e8f7ebb6c [SCEV] Model ashr exact x, C as (abs(x) EXACT/u (1<<C)) * signum(x)
It's not pretty, but probably better than modelling it
as an opaque SCEVUnknown, i guess.

It is relevant e.g. for the loop that was brought up in
https://bugs.llvm.org/show_bug.cgi?id=46786#c26
as an example of what we'd be able to better analyze
once SCEV handles `ptrtoint` (D89456).

But as it is evident, even if we deal with `ptrtoint` there,
we also fail to model such an `ashr`.
Also, modeling of mul-of-exact-shr/div could use improvement.

As per alive2:
https://alive2.llvm.org/ce/z/tnfZKd
```
define i8 @src(i8 %0) {
  %2 = ashr exact i8 %0, 4
  ret i8 %2
}

declare i8 @llvm.abs(i8, i1)
declare i8 @llvm.smin(i8, i8)
declare i8 @llvm.smax(i8, i8)

define i8 @tgt(i8 %x) {
  %abs_x = call i8 @llvm.abs(i8 %x, i1 false)
  %div = udiv exact i8 %abs_x, 16
  %t0 = call i8 @llvm.smax(i8 %x, i8 -1)
  %t1 = call i8 @llvm.smin(i8 %t0, i8 1)
  %r = mul nsw i8 %div, %t1
  ret i8 %r
}
```
Transformation seems to be correct!
2020-10-17 21:22:24 +03:00
Roman Lebedev
245883434c [NFC][SCEV] Refactor getAbsExpr() out of createSCEV() 2020-10-17 21:21:02 +03:00
Roman Lebedev
77dcef99bf [NFC][SCEV] Add 'getMinusOne()' method 2020-10-17 21:20:58 +03:00
Roman Lebedev
74a371421e [NFC][SCEV] Add some more ptrtoint/PR46786 -related tests 2020-10-17 21:04:44 +03:00
Sanjay Patel
63b7ca0b03 [InstCombine] (~A & B) ^ A -> A | B
Differential Revision: https://reviews.llvm.org/D86395
2020-10-17 12:20:18 -04:00
Mircea Trofin
b9ede41112 [NFC][ML] Avoid source of some signed/unsigned warnings in TFUtilsTest 2020-10-17 09:07:02 -07:00
Nikita Popov
9385ab1c9d [MemCpyOpt] Extract common function for unwinding check
These two cases should be using the same logic. Not NFC, as this
resolves the TODO regarding use of the underlying object.
2020-10-17 15:30:39 +02:00
Pedro Tammela
c9d7ed4029 [NFC] fix some typos in LoopUnrollPass
This patch fixes a couple of typos in the LoopUnrollPass.cpp comments

Differential Revision: https://reviews.llvm.org/D89603
2020-10-17 14:20:55 +01:00
David Green
e1c6fdf0df [ARM] Basic getArithmeticReductionCost reduction costs
This adds some basic costs for MVE reductions - currently just costing
the simple legal add vectors as a single MVE instruction. More complex
costing can be added in the future when the framework more readily
allows it.

Differential Revision: https://reviews.llvm.org/D88980
2020-10-17 10:29:00 +01:00
David Green
afa83bbf3d [ARM] Add a very basic active_lane_mask cost
This adds a very basic cost for active_lane_mask under MVE - making the
assumption that they will be free and then apologizing for that in a
comment.

In reality they may either be free (by being nicely folded into a tail
predicated loop), cost the same as a VCTP or be expanded into vdup's,
adds and cmp's. It is difficult to detect the difference from a single
getIntrinsicInstrCost call, so makes the assumption that the vectorizer
is adding them, and only added them where it makes sense.

We may need to change this in the future to better model predicate costs
in the vectorizer, especially at -Os or non-tail predicated loops. The
vectorizer currently does not query the cost of these instructions but
that will change in the future and a zero cost there probably makes the
most sense at the moment.

Differential Revision: https://reviews.llvm.org/D88989
2020-10-17 10:09:42 +01:00
Juneyoung Lee
e7de338270 Add support for !noundef metatdata on loads
This patch adds metadata !noundef and makes load instructions can optionally have it.
A load with !noundef always return a well-defined value (has no undef bit or isn't poison).
If the loaded value isn't well defined, the behavior is undefined.

This metadata can be used to encode the assumption from C/C++ that certain reads of variables should have well-defined values.
It is helpful for optimizing freeze instructions away, because freeze can be removed when its operand has well-defined value, and showing that a load from arbitrary location is well-defined is usually hard otherwise.

The same information can be encoded with llvm.assume with operand bundle; using metadata is chosen because I wasn't sure whether code motion can be freely done when llvm.assume is inserted from clang instead.
The existing codebase already is stripping unknown metadata when doing code motion, so using metadata is UB-safe as well.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D89050
2020-10-17 13:50:10 +09:00
Juneyoung Lee
59a2a236c5 [LangRef] Rename the names of metadata in load/store's syntax (NFC)
Discussed in D89050
2020-10-17 13:30:02 +09:00
Alok Kumar Sharma
b846ffc438 [DebugInfo] Support for DWARF operator DW_OP_over
LLVM rejects DWARF operator DW_OP_over. This DWARF operator is needed
for Flang to support assumed rank array.

  Summary:
Currently LLVM rejects DWARF operator DW_OP_over. Below error is
produced when llvm finds this operator.
[..]
invalid expression
!DIExpression(151, 20, 16, 48, 30, 35, 80, 34, 6)
warning: ignoring invalid debug info in over.ll
[..]
There were some parts missing in support of this operator, which are
now completed.

  Testing
-added a unit testcase
-check-debuginfo
-check-llvm

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D89208
2020-10-17 08:42:28 +05:30
Craig Topper
cf43cfffa7 [TargetLowering] Extract simplifySetCCs ctpop into a separate function. NFCI
As requested in D89346. This allows us to add some early outs.

I reordered some checks a little bit to make the more common bail outs happen earlier. Like checking opcode before checking hasOneUse. And I moved the bit width check to make sure it was safe to look through a truncate to the spot where we look through truncates instead of after.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D89494
2020-10-16 19:47:56 -07:00
Alina Sbirlea
fceac90d83 [MemorySSA] Verify clobbering within reachable blocks.
Resolves PR45976.
2020-10-16 17:46:28 -07:00
Arthur Eubanks
8e256a7b8c [NPM] Fix some PhaseOrdering tests under NPM
These either already have corresponding NPM RUN lines,
or need to be fixed to not use -analyze.
2020-10-16 16:58:14 -07:00
Amara Emerson
d0a261bc18 [AArch64][GlobalISel] Select csinc if a select has a 1 on RHS.
Differential Revision: https://reviews.llvm.org/D89513
2020-10-16 16:49:52 -07:00
Albion Fung
21b1fbd81e [PowerPC] Implementation of 128-bit Binary Vector Rotate builtins
This patch implements 128-bit Binary Vector Rotate builtins for PowerPC10.

Differential Revision: https://reviews.llvm.org/D86819
2020-10-16 18:03:22 -04:00
Peng Guo
c701c394b3 [objdump][macho] Check arch before formating reloc name as arm64 addend
Before formating ARM64_RELOC_ADDEND relocation target name as a hex
number, the architecture need to be checked since other architectures
can define a different relocation type with the same integer as
ARM64_RELOC_ADDEND.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D89094
2020-10-16 14:30:22 -07:00
Jameson Nash
fe8adca85b Revert "make the AsmPrinterHandler array public"
I messed up one of the tests.
2020-10-16 17:22:07 -04:00
Renato Golin
da57cade00 Revert "Fix Windows llvm-objdump tests"
It had already been fixed in a different way.
2020-10-16 21:49:47 +01:00
Stanislav Mekhanoshin
9c088650a5 [AMDGPU] Fix gfx1032 description in AMDGPUUsage.rst. NFC.
Differential Revision: https://reviews.llvm.org/D89565
2020-10-16 13:29:20 -07:00
Renato Golin
5c69dabe4f Fix Windows llvm-objdump tests
Broken in e95f9a23fad with path issues.
2020-10-16 21:28:32 +01:00
Jameson Nash
310509685d make the AsmPrinterHandler array public
This lets external consumers customize the output, similar to how
AssemblyAnnotationWriter lets the caller define callbacks when printing
IR. The array of handlers already existed, this just cleans up the code
so that it can be exposed publically.

Differential Revision: https://reviews.llvm.org/D74158
2020-10-16 16:27:31 -04:00
Artem Belevich
c59b73d34c [VectorCombine] Avoid crossing address space boundaries.
We can not bitcast pointers across different address spaces, and VectorCombine
should be careful when it attempts to find the original source of the loaded
data.

Differential Revision: https://reviews.llvm.org/D89577
2020-10-16 13:19:31 -07:00
Stanislav Mekhanoshin
7bd9c67ef6 [AMDGPU] Drop array size in AMDGCNGPUs and R600GPUs
Differential Revision: https://reviews.llvm.org/D89568
2020-10-16 12:37:22 -07:00
Nikita Popov
7ebc22e3f8 Revert "Recommit "[SCEV] Use nw flag and symbolic iteration count to sharpen ranges of AddRecs""
This reverts commit 32b72c3165bf65cca2e8e6197b59eb4c4b60392a.

While better than before, this change still introduces a large
compile-time regression (>3% on mafft):
https://llvm-compile-time-tracker.com/compare.php?from=fbd62fe60fb2281ca33da35dc25ca3c87ec0bb51&to=32b72c3165bf65cca2e8e6197b59eb4c4b60392a&stat=instructions

Additionally, the logic here doesn't look quite right to me,
I will comment in more detail on the differential revision.
2020-10-16 21:36:33 +02:00
Florian Hahn
5407cf6224 [SCEV] Add additional tests where the max BTC is limited by wrapping. 2020-10-16 20:36:02 +01:00
Arthur Eubanks
73f501c86d [CGSCC] Add -abort-on-max-devirt-iterations-reached option
Aborts if we hit the max devirtualization iteration.
Will be useful for testing that changes to devirtualization don't cause
devirtualization to repeat passes more times than necessary.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D89519
2020-10-16 12:34:52 -07:00
Austin Kerbow
eef8b924be [AMDGPU] Run hazard recognizer pass later
If instructions were removed in peephole passes after the hazard recognizer was
run it is possible that new hazards could be introduced.

Fixes: SWDEV-253090

Reviewed By: rampitec, arsenm

Differential Revision: https://reviews.llvm.org/D89077
2020-10-16 12:15:51 -07:00
Fangrui Song
7035946398 [llvm-objdump][test] Unsupport system-windows for source-interleave-prefix.test 2020-10-16 11:44:33 -07:00
Fangrui Song
5cc9b5580a [llvm-objdump][test] Delete source-interleave-prefix-windows.test
It needs more work: http://45.33.8.238/win/25999/step_11.txt
2020-10-16 11:42:25 -07:00
Amara Emerson
d0c901f0e6 [AArch64][GlobalISel] Add selection support for v2s32 and v2s64 reductions for FADD/ADD.
We'll need legalizer lower() support for the other types to work.

Differential Revision: https://reviews.llvm.org/D89159
2020-10-16 11:41:57 -07:00
Arthur Eubanks
2e7520c9af [test] Pin null-function.ll to legacy PM
The NPM prints CGSCCs in a different way.
2020-10-16 11:24:28 -07:00
LLVM GN Syncbot
92111fd84e [gn build] Port 3d4bba302d2 2020-10-16 18:13:18 +00:00
Nico Weber
fac13d2341 [gn build] (manually) port 3d4bba302d246 2020-10-16 14:12:38 -04:00