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

187325 Commits

Author SHA1 Message Date
Simon Pilgrim
9f06a6bc79 isImmPCRel/isImmSigned - both functions should return bool not unsigned. NFCI. 2019-11-02 21:04:07 +00:00
Simon Pilgrim
9c641d37b8 MatchTableRecord::emit - fix boolean operator precedence warnings from PVS Studio. NFCI.
Make it clear that (Flags & MTRF_????) should resolve to a boolean.
2019-11-02 21:04:07 +00:00
Johannes Doerfert
caacbdd09d [Attributor][NFCI] Do not track unnecessary dependences
If we do not look at assumed information there is no need to track
dependences.
2019-11-02 15:26:30 -05:00
Johannes Doerfert
d2fb0393aa [Attributor][NFCI] Distinguish optional and required dependences
Dependences between two abstract attributes SRC and TRG come naturally in
two flavors:
  Either (1) "some" information of SRC is *required* for TRG to derive
  information, or (2) SRC is just an *optional* way for TRG to derive
  information.

While it is not strictly necessary to distinguish these types
explicitly, it can help us to converge faster, in terms of iterations,
and also cut down the number of `AbstractAttribute::update` calls.

As far as I can tell, we only use optional dependences for liveness so
far but that might change in the future. With this change the Attributor
can be informed about the "dependence class" and it will perform
appropriate actions when an Attribute is set to an invalid state, thus
one that cannot be used by others to derive information from.
2019-11-02 15:26:22 -05:00
Simon Pilgrim
7bd60f4f9a Fix -Wreorder warnings. NFCI. 2019-11-02 20:12:59 +00:00
Simon Pilgrim
52fd4336ea ARMAttributeParser - fix shadow variable name warnings from decodeULEB128 calls. NFCI.
Consistently rename the Length attribute to DecodeLength in decodeULEB128 calls.
2019-11-02 20:12:59 +00:00
Simon Pilgrim
c1f5f74bca GSYMTest::TestLineTable - check all LT1+LT2 comparisons.
PVS Studio was warning about "LT2 < LT2" but really we should be testing all permutations of LT1 and LT2.
2019-11-02 20:12:58 +00:00
Dávid Bolvanský
10e761fa76 [LegacyPassManager] Fixed "null check after derefencing" warning
The 'RequiredPass' pointer was utilized before it was verified against nullptr. Check lines: 1626, 1629.
2019-11-02 20:14:29 +01:00
Simon Pilgrim
a1ea2306ad X86_MC::createX86MCSubtargetInfo - X86_MC::ParseX86Triple never returns an empty string. NFCI.
PVS Studio was complaining that the expression '!ArchFS.empty()' is always true.
2019-11-02 18:46:53 +00:00
Simon Pilgrim
df63153e69 X86Operand::print - fix SymName shadow variable warning. NFCI. 2019-11-02 18:46:53 +00:00
Stefan Stipanovic
4e04be8943 NoFree argument attribute.
Summary: Deducing nofree atrribute for function arguments.

Reviewers: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67886
2019-11-02 19:40:48 +01:00
Simon Pilgrim
74d17e4d46 FastISel - fix uninitialized variable warnings in constructor. NFCI. 2019-11-02 18:03:22 +00:00
Simon Pilgrim
642c3f5896 llvm.coverage.FunctionRecord - fix uninitialized variable warning. NFCI. 2019-11-02 18:03:22 +00:00
Simon Pilgrim
31e401e4c2 X86AsmPrinter - fix uninitialized variable warnings. NFCI. 2019-11-02 18:03:21 +00:00
Simon Pilgrim
752e813994 DIEAbbrev - fix uninitialized variable warning. NFCI. 2019-11-02 18:03:21 +00:00
Simon Pilgrim
22ec1cf402 Fix uninitialized variable warning. NFCI. 2019-11-02 18:03:21 +00:00
Dávid Bolvanský
197accdae6 Revert "[Codegen] Both sides of '&&' are same; fixed"
This reverts commit edb42dccfafb2c0d25d19175c49d016a7c2e0b13. Buildbot timeouts.
2019-11-02 19:02:33 +01:00
Stefan Stipanovic
8973a4b594 Revert "NoFree argument attribute."
This reverts commit c12efa2ed0547f7f9f8fba0ad7a76a4cb08bf53a.
2019-11-02 17:31:02 +01:00
Simon Pilgrim
938b521380 TargetMachine - fix uninitialized variable warning. NFCI.
TargetPassConfig::addCoreISelPasses() always initializes O0WantsFastISel but it appeases static analyzers that complain that O0WantsFastISel isn't initialized in the constructor.
2019-11-02 16:11:01 +00:00
Simon Pilgrim
9d8f1e54ee CustomTypeNode/SpecialTableSymbolNode - fix uninitialized variable warnings. NFCI. 2019-11-02 16:04:20 +00:00
Dávid Bolvanský
7d756df5a7 [Codegen] Both sides of '&&' are same; fixed
Summary:
Found by PVS Studio

Not familiar with this code; no testcase.

Reviewers: craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69741
2019-11-02 16:43:16 +01:00
Stefan Stipanovic
e0f934d786 NoFree argument attribute.
Summary: Deducing nofree atrribute for function arguments.

Reviewers: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67886
2019-11-02 16:35:38 +01:00
Simon Pilgrim
a61555f25d Fix uninitialized variable warning. NFCI. 2019-11-02 14:42:38 +00:00
Simon Pilgrim
9d9f09657a [X86] Move computeZeroableShuffleElements before getTargetShuffleAndZeroables. NFCI.
Prep work toward merging some of the functionality.
2019-11-02 13:38:35 +00:00
Roman Lebedev
f757355f93 Revert BCmp Loop Idiom recognition transform (PR43870)
As discussed in https://bugs.llvm.org/show_bug.cgi?id=43870,
this transform is missing a crucial legality check:
the old (non-countable) loop would early-return upon first mismatch,
but there is no such guarantee for bcmp/memcmp.

We'd need to ensure that [PtrA, PtrA+NBytes) and [PtrB, PtrB+NBytes)
are fully dereferenceable memory regions. But that would limit
the transform to constant loop trip counts and would further
cripple it because dereferenceability analysis is *very* partial.

Furthermore, even if all that is done, every single test
would need to be rewritten from scratch.

So let's just give up.
2019-11-02 12:48:03 +03:00
Craig Topper
0eb122ca5d [IR] Avoid use of PointerType::getElementType() in one of the CallBrInst constructors.
We already have the FunctionType we can call getReturnType on.
I think this was due to a bad rebase of the CallBr patch while
it was in development when CallInst and InvokeInst were updated.
2019-11-02 01:39:21 -07:00
Pengfei Wang
e09b32f006 [X86][NFC] Fix buildbot failure on clang-x64-windows-msvc after commit
02728f49da7

Windows uses different VR numbers from Linux. So ignore the number
checking in the CHECK.
2019-11-02 01:18:24 -07:00
Johannes Doerfert
c45b74750a [Attributor] Ignore BlockAddress users in call site traversal
BlockAddress users will not "call" the function so they do not qualify
as call sites in the first place. When we delete a function with
BlockAddress users we need to first remove the body so they are properly
discarded.
2019-11-02 01:23:18 -05:00
Johannes Doerfert
1c11dea2c3 [AbstractCallSite][FIX] Correct faulty assertion
When the Attributor run on the IPConstantProp test case for multiple
callbacks it triggered a faulty assertion in the AbstractCallSite
implementation. The callee can well be at argument position 0.
2019-11-02 01:22:41 -05:00
Craig Topper
75ba60d523 [X86] Remove FeatureSSE3 from the implies list of HasFastHorizontalOps.
HasFastHorizontalOps is a tuning flag. It shouldn't imply an ISA flag.
2019-11-01 23:17:53 -07:00
Johannes Doerfert
1ef0965005 [Attributor][FIX] Do not try to cast if a cast is not required
When we replace constant returns at the call site we did issue a cast in
the hopes it would be a no-op if the types are equal. Turns out that is
not the case and we have to check it ourselves first.

Reused an IPConstantProp test for coverage. No functional change to the
test wrt. IPConstantProp.
2019-11-02 00:54:00 -05:00
Johannes Doerfert
9e5924766d [Attributor][FIX] Transform invoke of nounwind to call + br %normal_dest
Even if the invoked function may-return, we can replace it with a call
and branch if it is nounwind. We had almost everything in place to do
this but did not which actually caused a crash when we removed the
landingpad from the actually dead unwind block.

Exposed by the IPConstantProp tests.
2019-11-02 00:54:00 -05:00
Johannes Doerfert
eb3685d46d [Attributor][FIX] Make "known" and "assumed" liveness explicit
We did merge "known" and "assumed" liveness information into a single
set which caused various kinds of problems, especially because we did
not properly record when something was actually known. With this patch
we properly track the "known" bit and distinguish dead ends we know from
the ones we still need to explore in future updates.
2019-11-02 00:49:29 -05:00
Johannes Doerfert
ba26cda1ee [Attributor] willreturn + noreturn = UB
We gave up on `noreturn` if `willreturn` was known for a while but we
now again try to always derive `noreturn`. This is useful because a
function that is `noreturn` + `willreturn` is basically dead as
executing it would lead to undefined behavior (UB).

This came up in the IPConstantProp cases where a function only contained
a unreachable but was not marked `noreturn` which caused missed
opportunities down the line.
2019-11-02 00:35:22 -05:00
Johannes Doerfert
775db365a9 [Attributor][FIX] Make AAValueSimplifyArgument aware of thread-dependent constants
As in IPConstantProp, thread-dependent constants need not be propagated
over callbacks. Took the comment and test from there, see also D56447.
2019-11-02 00:32:39 -05:00
Johannes Doerfert
9b10b5c5ae [Attributor][FIX] Handle the default case of a switch
In D69605 only the "cases" of a switch were handled but if none matched
we did not make the default case life. This is fixed now and properly
tested (with code from IPConstantProp/user-with-multiple-uses.ll).
2019-11-02 00:30:31 -05:00
Johannes Doerfert
976bf57a0d [Attributor][FIX] Make value simplification aware of "complicated" attributes
We cannot simply replace arguments that carry attributes like `nest`,
`inalloca`, `sret`, and `byval`. Except for the last one, which we can
replace if it is not written, we bail for now.
2019-11-02 00:29:17 -05:00
Johannes Doerfert
bbcb73bcef [Attributor][NFCI] Avoid unnecessary work except for testing
Trying to deduce information for declarations and calls sites of
declarations is not useful in practice but only for testing. Add a flag
that disables this by default but also enable it in the tests.

The misc.ll test will verify the flag "works" as expected.
2019-11-02 00:28:24 -05:00
Johannes Doerfert
e77fad8914 [Attributor][FIX] NoCapture is not a subsuming property
We cannot look at the subsuming positions and take their nocapture bit
as shown with the two tests for which we derived nocapture on the call
site argument and readonly on the argument of the second before.
2019-11-02 00:26:15 -05:00
Johannes Doerfert
55375bb384 [Attributor][NFCI] Remove obsolete code
The code in question does not add anything as the class is a subclass of
AACallSiteReturnedFromReturnedAndMustBeExecutedContext already.
2019-11-02 00:25:46 -05:00
Pengfei Wang
300b0aafe9 [X86] Model MXCSR for MMX FP instructions
Summary:
This patch models MXCSR and adds flag "mayRaiseFPException" for MMX FP
instructions.

Reviewers: craig.topper, andrew.w.kaylor, RKSimon, cameron.mcinally

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits, LiuChen3

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69702
2019-11-01 21:21:46 -07:00
Pengfei Wang
9292c401ac [X86] add mayRaiseFPException flag and FPCW registers for X87 instructions
Summary:
This patch adds flag "mayRaiseFPException"  , FPCW and FPSW for X87 instructions which could raise
float exception.

Reviewers: pengfei, RKSimon, andrew.w.kaylor, uweigand, kpn, spatel, cameron.mcinally, craig.topper

Reviewed By: craig.topper

Subscribers: thakis, hiraditya, llvm-commits

Patch by LiuChen.

Differential Revision: https://reviews.llvm.org/D68854
2019-11-01 21:12:43 -07:00
Francis Visoiu Mistrih
36bb137e01 [dsymutil] Second attempt to fix dsymutil tests on non-darwin platforms 2019-11-01 21:07:40 -07:00
Francis Visoiu Mistrih
02958491e9 [dsymutil] Require darwin in fat binary test
dsymutil uses lipo(1) to build the fat binary, which it invokes as a
process. For that, we need to only run this test on darwin systems.

Should fix: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/181/steps/test-check-all/logs/stdio
2019-11-01 16:16:30 -07:00
Francis Visoiu Mistrih
4b719abef0 [dsymutil] Add support for linking remarks
This adds support to dsymutil for linking remark files and placing them
in the final .dSYM bundle.

The result will be placed in:

* a.out.dSYM/Contents/Resources/Remarks/a.out
or
* a.out.dSYM/Contents/Resources/Remarks/a.out-<arch> for universal binaries

When multi-threaded, this runs a third thread which loops over all the
object files and parses remarks as it finds __remarks sections.

Testing this involves running dsymutil on pre-built binaries and object
files, then running llvm-bcanalyzer on the final result to check for
remarks.

Differential Revision: https://reviews.llvm.org/D69142
2019-11-01 15:38:49 -07:00
Guozhi Wei
2b7f226656 [NewPM] Add an SROA pass after loop unroll
If there is a small local array accessed in a loop, SROA can't handle memory
accesses with variant offset inside a loop, after the loop is fully unrolled,
all memory accesses to the array are with fixed offset, so now they can be
processed by SROA. But there is no more SROA passes after loop unroll. This
patch add an SROA pass after loop unroll to handle this pattern.

Differential Revision: https://reviews.llvm.org/D68593
2019-11-01 14:59:08 -07:00
David Blaikie
3beeab3b31 DebugInfo: Streamline debug_ranges/rnglists/rnglists.dwo emission code
More code reuse, better basis for modelling
debug_loc/loclists/loclists.dwo emission support.
2019-11-01 14:56:43 -07:00
Craig Topper
e0c631ef76 [TargetLowering] Move the setBooleanContents check on (xor (setcc), (setcc)) == / != 1 -> (setcc) != / == (setcc) to the right place
We need to be checking the value types for the inner setccs not
the outer setcc. We need to ensure those setccs produce a 0/1
value or that the xor is on the i1 type. I think at the time
this code was originally written, getBooleanContents didn't
take any arguments so this was probably correct. But now we can
have a different boolean contents for integer and floating point.

Not sure why the other combines below the xor were also checking
the boolean contents. None of them involve any setccs other than
the outer one and they only produce a new setcc.

Differential Revision: https://reviews.llvm.org/D69480
2019-11-01 14:43:17 -07:00
Craig Topper
f570fb1b2e [MachineBasicBlock] Skip over debug instructions in computeRegisterLiveness before checking for begin
If there are debug instructions before the stopping point,
we need to skip over them before checking for begin in order
to avoid having the debug instructions effect behavior.

Fixes PR43758.

Differential Revision: https://reviews.llvm.org/D69606
2019-11-01 14:43:17 -07:00
Nikita Popov
ca2dea6aec [JT][CVP] Regenerate test checks, again
The changes to update_test_checks format have been disabled again,
so regenerate these tests. Also regenerate select.ll.
2019-11-01 22:27:48 +01:00