Commit Graph

330948 Commits

Author SHA1 Message Date
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
Johannes Doerfert 0437bfcc83 [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 0c7d4d7f3e [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 02728f49da [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 af3a7de20c [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 cc9e963d65 [dsymutil] Second attempt to fix dsymutil tests on non-darwin platforms 2019-11-01 21:07:40 -07:00
Jim Ingham 81cc5d1c7d Don't assume that __cxa_current_exception_type exists.
Normally you shouldn't be able to have a process with an ItaniumABI plugin
that doesn't have this symbol.  But if the loader crashes before loading
libc++abi.dylib (on MacOS), then the symbol might not be present.  So we
should check before accessing the pointer.

There isn't a good way to write a test for this, but the change is obvious.
2019-11-01 17:20:31 -07:00
Francis Visoiu Mistrih 86cdf74dc8 [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 1ee18f275e [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
David Blaikie 1de2a05701 DebugInfo: Accept -gdwarf even in clang-cl
Fixes regression introduced by llvmorg-10-init-8908-g098d901bd1b
2019-11-01 15:36:15 -07:00
David Blaikie 098d901bd1 DebugInfo: Let -gdwarf use the toolchain default DWARF version, instead of hardcoded/aliased to -gdwarf-4 2019-11-01 15:17:51 -07:00