Commit Graph

330958 Commits

Author SHA1 Message Date
Simon Pilgrim 2b2adef03d Stop static analyzer warnings about using bitwise operators on booleans. NFCI.
Call each of the rebase_if() calls separately.
2019-11-02 22:40:04 +00:00
Simon Pilgrim d801f79419 TargetParserTest - testARMArch - stop bitwise operators on boolean warnings. NFCI.
Ensure the test still runs all target checks but stop the static analyzer warnings.
2019-11-02 22:40:04 +00:00
Fangrui Song 46abbe77d6 CodeGen/DIE.h: prefer the default member initializer to the member initializers in the constructor. NFC 2019-11-02 14:57:50 -07:00
Simon Atanasyan aa67e51195 [mips] Remove trailing spaces. NFC 2019-11-03 00:50:52 +03:00
Simon Atanasyan 0bd82a96cc [mips] Split long lines in the code. NFC 2019-11-03 00:50:52 +03:00
Simon Pilgrim d397e29273 A15SDOptimizer::getPrefSPRLane - fix null dereference warning. NFCI 2019-11-02 21:49:12 +00:00
Simon Pilgrim 9a9c07d711 isConditionalBranch/isUnconditionalBranch - use boolean operators. NFCI.
Stop static analyzer warnings about using bitwise operators on booleans.
2019-11-02 21:38:46 +00:00
Florian Hahn f0c2a5af76 [LV] Generalize conditions for sinking instrs for first order recurrences.
If the recurrence PHI node has a single user, we can sink any
instruction without side effects, given that all users are dominated by
the instruction computing the incoming value of the next iteration
('Previous'). We can sink instructions that may cause traps, because
that only causes the trap to occur later, but not on any new paths.

With the relaxed check, we also have to make sure that we do not have a
direct cycle (meaning PHI user == 'Previous), which indicates a
reduction relation, which potentially gets missed by
ReductionDescriptor.

As follow-ups, we can also sink stores, iff they do not alias with
other instructions we move them across and we could also support sinking
chains of instructions and multiple users of the PHI.

Fixes PR43398.

Reviewers: hsaito, dcaballe, Ayal, rengolin

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D69228
2019-11-02 22:08:27 +01:00
Simon Pilgrim 505c4dabe2 isImmPCRel/isImmSigned - both functions should return bool not unsigned. NFCI. 2019-11-02 21:04:07 +00:00
Simon Pilgrim 43fe9afa4f 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 77a6b358b5 [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 680f638027 [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 99094b9f6e Fix -Wreorder warnings. NFCI. 2019-11-02 20:12:59 +00:00
Simon Pilgrim c0e83fa5ac 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 004eb2c862 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ý 5ccad89f50 [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
Saleem Abdulrasol 5ce2c6d2db build: avoid custom handling for C++ standard
Use the builtin CMake support for specifying the proper flags for the targets to
build at a certain C++ standard.  This avoids unnecessary checks in CMake,
speeding up the configure phase as well as simplifies the logic overall.
2019-11-02 15:07:54 -04:00
Simon Pilgrim f722071a9e 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 2cbb9653d8 X86Operand::print - fix SymName shadow variable warning. NFCI. 2019-11-02 18:46:53 +00:00
Stefan Stipanovic f35740d6e9 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 095d2a4ced FastISel - fix uninitialized variable warnings in constructor. NFCI. 2019-11-02 18:03:22 +00:00
Simon Pilgrim 72670a7975 llvm.coverage.FunctionRecord - fix uninitialized variable warning. NFCI. 2019-11-02 18:03:22 +00:00
Simon Pilgrim 79818f8c70 X86AsmPrinter - fix uninitialized variable warnings. NFCI. 2019-11-02 18:03:21 +00:00
Simon Pilgrim 0918967739 DIEAbbrev - fix uninitialized variable warning. NFCI. 2019-11-02 18:03:21 +00:00
Simon Pilgrim d0f3c82216 Fix uninitialized variable warnings. NFCI. 2019-11-02 18:03:21 +00:00
Simon Pilgrim 08e593895d Fix uninitialized variable warning. NFCI. 2019-11-02 18:03:21 +00:00
Dávid Bolvanský fe1a1d5aae Revert "[Codegen] Both sides of '&&' are same; fixed"
This reverts commit edb42dccfa. Buildbot timeouts.
2019-11-02 19:02:33 +01:00
Luboš Luňák 4f2104c5ad make -ftime-trace also trace time spent creating debug info
Differential Revision: https://reviews.llvm.org/D69750
2019-11-02 18:12:51 +01:00
Stefan Stipanovic 5fb1782918 Revert "NoFree argument attribute."
This reverts commit c12efa2ed0.
2019-11-02 17:31:02 +01:00
Simon Pilgrim 579a56bec3 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 575655f374 CustomTypeNode/SpecialTableSymbolNode - fix uninitialized variable warnings. NFCI. 2019-11-02 16:04:20 +00:00
Dávid Bolvanský edb42dccfa [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 c12efa2ed0 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 97725707f4 Fix uninitialized variable warning. NFCI. 2019-11-02 14:42:38 +00:00
Simon Pilgrim 254b8461ac [X86] Move computeZeroableShuffleElements before getTargetShuffleAndZeroables. NFCI.
Prep work toward merging some of the functionality.
2019-11-02 13:38:35 +00:00
Roman Lebedev c4b757be02
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
Luboš Luňák 79d8996d73 python path should be platform-dependent
Because one of the installed files is the _lldb.so symlink.

Differential Revision: https://reviews.llvm.org/D68910
2019-11-02 10:22:47 +01:00
Craig Topper 462a67fadd [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 d5fc36bbda [X86][NFC] Fix buildbot failure on clang-x64-windows-msvc after commit
02728f49da

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 2d77b0cad0 [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 4c56086f8b [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 83503ad119 [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 07d16424f2 [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 c7ab19dbb0 [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 3cbe3314b4 [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 1b6041a9e8 [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 e360ee6265 [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 ed47a9cde4 [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 15cd90a2c4 [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 c36e2ebf9f [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