Raphael Isemann [Mon, 4 Nov 2019 08:25:01 +0000 (09:25 +0100)]
[lldb][NFC] Make test/python_api/module_section test smaller
Summary:
I don't see why this test needs to compile this rather complicated file for just testing module sections. This just removes all this code with a simple
"Hello world!" program which should be faster to compile
Reviewers: labath, davide, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: jfb, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69705
Raphael Isemann [Mon, 4 Nov 2019 08:23:37 +0000 (09:23 +0100)]
[lldb] Also disable de-registration of EHFrames in IRExecutionUnit
Summary:
We disabled registration by providing an empty `registerEHFrames`, so we should also provide an empty `deregisterEHFrames`
in case that function relies on `registerEHFrames` being called before. Currently `deregisterEHFrames` is a no-op anyway
as it just iterates over the (empty( list of registered EHFrames and then clear the empty list.
Reviewers: davide, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: JDevlieghere, lldb-commits
Tags: #upstreaming_lldb_s_downstream_patches, #lldb
Differential Revision: https://reviews.llvm.org/D69713
Raphael Isemann [Mon, 4 Nov 2019 08:05:24 +0000 (09:05 +0100)]
[lldb] Provide a getter for m_materializer_up in LLVMUserExpression instead of relying on it being accessible.
Summary:
Motivated by Swift using the materializer in a few places which requires us to add this getter ourselves.
We also need a setter, but let's keep this minimal to unblock the downstream reverts in Swift.
Reviewers: davide
Reviewed By: davide
Subscribers: abidh, JDevlieghere, lldb-commits
Tags: #upstreaming_lldb_s_downstream_patches, #lldb
Differential Revision: https://reviews.llvm.org/D69714
Raphael Isemann [Mon, 4 Nov 2019 07:35:56 +0000 (08:35 +0100)]
[lldb] Add trailing dots to comments in Value.cpp
Reviewers: JDevlieghere
Reviewed By: JDevlieghere
Subscribers: JDevlieghere, lldb-commits
Tags: #upstreaming_lldb_s_downstream_patches, #lldb
Differential Revision: https://reviews.llvm.org/D69717
Pengfei Wang [Mon, 4 Nov 2019 07:13:51 +0000 (23:13 -0800)]
Set the floating point status register as reserved
Summary:
This patch sets the FPSW (X87 floating-point status register) as a reserved
physical register and fix the test failure caused by [[ https://reviews.llvm.org/D68854| D68854 ]].
Before this patch, some tests will fail because it implicit uses FPSW without
define it. Setting the FPSW as a reserved physical register will skip liveness
analysis because it is always live.
Reviewers: pengfei, craig.topper
Reviewed By: craig.topper
Subscribers: craig.topper, hiraditya, llvm-commits
Patch by LiuChen.
Differential Revision: https://reviews.llvm.org/D69784
Duncan P. N. Exon Smith [Mon, 4 Nov 2019 03:29:29 +0000 (19:29 -0800)]
clang/Modules: Sink CompilerInstance::KnownModules into ModuleMap
Avoid use-after-frees when FrontendAction::BeginSourceFile is called
twice on the same CompilerInstance by sinking
CompilerInstance::KnownModules into ModuleMap. On the way, rename the
map to CachedModuleLoads. I considered (but rejected) merging this with
ModuleMap::Modules, since that only has top-level modules and this map
includes submodules.
This is an alternative to https://reviews.llvm.org/D58497. Thanks to
nemanjai for the detailed analysis of the problem!
Kamil Rytarowski [Mon, 4 Nov 2019 00:10:59 +0000 (01:10 +0100)]
[compiler-rt] [msan] Correct the __libc_thr_keycreate prototype
Fixes build with GCC8.
Kamil Rytarowski [Mon, 4 Nov 2019 00:08:53 +0000 (01:08 +0100)]
[compiler-rt] [msan] Support POSIX iconv(3) on NetBSD 9.99.17+
Fixes build of test.
Simon Atanasyan [Sun, 3 Nov 2019 18:46:57 +0000 (21:46 +0300)]
[mips] Move test case for Octeon instructions to cnmips sub-folder. NFC
Simon Atanasyan [Sun, 3 Nov 2019 16:12:19 +0000 (19:12 +0300)]
[mips] Add disassembler tests for `octeon` CPU. NFC
Simon Atanasyan [Sun, 3 Nov 2019 15:22:32 +0000 (18:22 +0300)]
[mips] Add disassembler tests for `sigrie` instruction. NFC
Simon Pilgrim [Sun, 3 Nov 2019 21:10:22 +0000 (21:10 +0000)]
[X86][SSE] combineX86ShufflesRecursively - at Depth==0, only resolve KnownZero if it removes an input.
This stops infinite loops where KnownUndef elements are converted to Zeroable, resulting in KnownZero elements which are then simplified (via SimplifyDemandedElts etc.) back to KnownUndef elements........
Prep fix for PR43024 which will allow rL368307 to be re-applied.
Dávid Bolvanský [Sun, 3 Nov 2019 19:40:53 +0000 (20:40 +0100)]
[SIMachineScheduler] Fixed ''then' statement is equivalent to the 'else' statement.' warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:38:29 +0000 (20:38 +0100)]
[SILoadStoreOptimizer] Fixed typo. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:34:54 +0000 (20:34 +0100)]
Reland '[InstructionCombining] Fixed null check after dereferencing warning. NFCI.'
Dávid Bolvanský [Sun, 3 Nov 2019 19:31:05 +0000 (20:31 +0100)]
Revert "[InstructionCombining] Fixed null check after dereferencing warning. NFCI."
This reverts commit
8308187fd9bfa08ffad0a636d4dd1d25e7de5a76. This exposed a bug.
Dávid Bolvanský [Sun, 3 Nov 2019 19:28:45 +0000 (20:28 +0100)]
[SCEV] Fixed 'Uninitialized variable 'ContainsAddRec' used.' warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:27:40 +0000 (20:27 +0100)]
[MemorySSA] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:24:01 +0000 (20:24 +0100)]
Revert "[InstructionCompares] Fixed null check after dereferencing warning. NFCI."
This reverts commit
b8685cf3042f6a2e129061922bd6b18e3c42258e.
Dávid Bolvanský [Sun, 3 Nov 2019 19:13:45 +0000 (20:13 +0100)]
[InstructionCompares] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:10:46 +0000 (20:10 +0100)]
[InstructionCombining] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:06:38 +0000 (20:06 +0100)]
[CHR] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:03:54 +0000 (20:03 +0100)]
[LoopUnrollRuntime] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 19:02:54 +0000 (20:02 +0100)]
[LoopUnrollAndJam] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 18:45:25 +0000 (19:45 +0100)]
[BitcodeReader] Fixed use after move warnings. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 18:42:11 +0000 (19:42 +0100)]
[BitcodeReader] Fixed null check after dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 18:40:26 +0000 (19:40 +0100)]
[BitcodeReader] Fixed null pointer dereferencing warning. NFCI.
Dávid Bolvanský [Sun, 3 Nov 2019 18:34:03 +0000 (19:34 +0100)]
[SelectionDAG] Fixed null check after dereferencing warning. NFCI.
Craig Topper [Sun, 3 Nov 2019 17:30:08 +0000 (09:30 -0800)]
[opaque pointer types] Add element type argument to IRBuilder CreatePreserveStructAccessIndex and CreatePreserveArrayAccessIndex
Summary:
These were the only remaining users of the GetElementPtrInst::getGEPReturnType
method that gets the element type from the pointer type.
Remove that method since its now dead.
Reviewers: jyknight, t.p.northover, arsenm
Reviewed By: arsenm
Subscribers: wdng, arsenm, arphaman, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D69756
Nico Weber [Sun, 3 Nov 2019 17:52:12 +0000 (12:52 -0500)]
gn build: (manually) merge
3a399c09 /
add76dd3c
Simon Pilgrim [Sun, 3 Nov 2019 17:45:32 +0000 (17:45 +0000)]
[X86][SSE] combineX86ShufflesRecursively - don't bother merging shuffles with empty roots. NFCI.
This doesn't affect actual codegen, but is a minor refactor toward fixing PR43024 where we need to avoid excess changes (folding zeroables etc.) to the shuffle mask at Depth == 0.
Simon Pilgrim [Sun, 3 Nov 2019 17:27:51 +0000 (17:27 +0000)]
[X86] Convert PICStyles::Style to scoped enum class. NFCI.
Fixes MSVC static analyzer warnings about enum safety, this enum performs no integer math so it'd be better to fix its scope.
Bjorn Pettersson [Sun, 3 Nov 2019 16:37:34 +0000 (17:37 +0100)]
[DebugInfo] Fix for DW_OP_LLVM_fragment in DIExpression::isImplicit()
DIExpression::isImplicit() did not handle DW_OP_LLVM_fragment
correctly. It was scanning the elements in the expression by
iterating from the end. But we do not know the position of
ops unless we iterate from the beginning of the expression,
since DW_OP:s and their operands are stored flat in the expression
list. The old code also assumed that a DW_OP_LLVM_fragment
only occupied one element in the expression list, but it actually
occupies three elements.
Yonghong Song [Sun, 3 Nov 2019 14:54:39 +0000 (06:54 -0800)]
[BPF] fix a bug in __builtin_preserve_field_info() with FIELD_BYTE_SIZE
During deriving proper bitfield access FIELD_BYTE_SIZE,
function Member->getStorageOffsetInBits() is used to
get llvm IR type storage offset in bits so that
the byte size can permit aligned loads/stores with previously
derived FIELD_BYTE_OFFSET.
The function should only be used with bitfield members and it will
assert if ASSERT is turned on during cmake build.
Constant *getStorageOffsetInBits() const {
assert(getTag() == dwarf::DW_TAG_member && isBitField());
if (auto *C = cast_or_null<ConstantAsMetadata>(getExtraData()))
return C->getValue();
return nullptr;
}
This patch fixed the issue by using Member->isBitField()
directly and a test case is added to cover this missing case.
This issue is discovered when running Andrii's linux kernel CO-RE
tests.
Differential Revision: https://reviews.llvm.org/D69761
Kamil Rytarowski [Sun, 3 Nov 2019 15:47:03 +0000 (16:47 +0100)]
[compiler-rt] Harmonize __sanitizer_addrinfo with the NetBSD headers
Add missing pad for sparc, alpha and a variation of i386.
Kamil Rytarowski [Sun, 3 Nov 2019 15:17:26 +0000 (16:17 +0100)]
[compiler-rt] Sync NetBSD syscall hooks with 9.99.17
Document the minimal version supported as 9.0 and add compat code for
renamed syscalls after 9.0.
Aaron Puchert [Sun, 3 Nov 2019 13:29:59 +0000 (14:29 +0100)]
Drop spurious self-include [NFC]
This was introduced in D61357, probably by accident.
Simon Pilgrim [Sun, 3 Nov 2019 11:33:57 +0000 (11:33 +0000)]
ModuleMap::findHeader - fix null dereference warning. NFCI.
We were checking M for a null value after we'd already dereferenced it multiple times.
Simon Pilgrim [Sun, 3 Nov 2019 11:27:57 +0000 (11:27 +0000)]
SymbolRecord - fix more uninitialized variable warnings. NFCI.
Simon Pilgrim [Sun, 3 Nov 2019 11:23:53 +0000 (11:23 +0000)]
Fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sun, 3 Nov 2019 11:20:12 +0000 (11:20 +0000)]
Fix line_iterator uninitialized variable warnings. NFCI.
Allows us to auto define the default constructor as well.
Simon Pilgrim [Sun, 3 Nov 2019 11:17:05 +0000 (11:17 +0000)]
Ensure VPlanPrinter::Depth is initialized to fix static analyzer warning. NFCI.
Simon Pilgrim [Sun, 3 Nov 2019 11:15:55 +0000 (11:15 +0000)]
Fix uninitialized variable warning. NFCI.
shkzhang [Sun, 3 Nov 2019 03:59:12 +0000 (23:59 -0400)]
[CodeGen] [ExpandReduction] Fix the bug for ExpandReduction() when vector size isn't power of 2
Summary:
For below test case, we will get assert error except for AArch64 and ARM:
declare i8 @llvm.experimental.vector.reduce.and.i8.v3i8(<3 x i8> %a)
define i8 @test_v3i8(<3 x i8> %a) nounwind {
%b = call i8 @llvm.experimental.vector.reduce.and.i8.v3i8(<3 x i8> %a)
ret i8 %b
}
In the function getShuffleReduction (), we can see it needs the vector size must be power of 2.
This patch is fix below error when the number of element is not power of 2 for those llvm.experimental.vector.reduce.* function.
Reviewed By: jsji
Differential Revision: https://reviews.llvm.org/D68625
Fangrui Song [Sat, 2 Nov 2019 22:57:10 +0000 (15:57 -0700)]
[CodeGenCXX][test] Use -fno-experimental-new-pass-manager for CodeGenCXX/union-tbaa2.cpp after D68593/llvmorg-10-init-8907-gcecc0d27ad5
It fails with -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=0 builds. Temporarily use -fno-experimental-new-pass-manager while we are investigating the root cause.
Simon Pilgrim [Sat, 2 Nov 2019 22:38:07 +0000 (22:38 +0000)]
Stop static analyzer warnings about using bitwise operators on booleans. NFCI.
Call each of the rebase_if() calls separately.
Simon Pilgrim [Sat, 2 Nov 2019 22:26:00 +0000 (22:26 +0000)]
TargetParserTest - testARMArch - stop bitwise operators on boolean warnings. NFCI.
Ensure the test still runs all target checks but stop the static analyzer warnings.
Fangrui Song [Sat, 2 Nov 2019 21:54:59 +0000 (14:54 -0700)]
CodeGen/DIE.h: prefer the default member initializer to the member initializers in the constructor. NFC
Simon Atanasyan [Sat, 2 Nov 2019 13:35:52 +0000 (16:35 +0300)]
[mips] Remove trailing spaces. NFC
Simon Atanasyan [Sat, 2 Nov 2019 13:33:10 +0000 (16:33 +0300)]
[mips] Split long lines in the code. NFC
Simon Pilgrim [Sat, 2 Nov 2019 21:49:12 +0000 (21:49 +0000)]
A15SDOptimizer::getPrefSPRLane - fix null dereference warning. NFCI
Simon Pilgrim [Sat, 2 Nov 2019 21:28:37 +0000 (21:28 +0000)]
isConditionalBranch/isUnconditionalBranch - use boolean operators. NFCI.
Stop static analyzer warnings about using bitwise operators on booleans.
Florian Hahn [Sat, 2 Nov 2019 17:45:33 +0000 (18:45 +0100)]
[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
Simon Pilgrim [Sat, 2 Nov 2019 21:03:36 +0000 (21:03 +0000)]
isImmPCRel/isImmSigned - both functions should return bool not unsigned. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 21:01:45 +0000 (21:01 +0000)]
MatchTableRecord::emit - fix boolean operator precedence warnings from PVS Studio. NFCI.
Make it clear that (Flags & MTRF_????) should resolve to a boolean.
Johannes Doerfert [Sat, 2 Nov 2019 19:47:45 +0000 (14:47 -0500)]
[Attributor][NFCI] Do not track unnecessary dependences
If we do not look at assumed information there is no need to track
dependences.
Johannes Doerfert [Sat, 2 Nov 2019 07:48:05 +0000 (02:48 -0500)]
[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.
Simon Pilgrim [Sat, 2 Nov 2019 20:12:35 +0000 (20:12 +0000)]
Fix -Wreorder warnings. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 20:11:29 +0000 (20:11 +0000)]
ARMAttributeParser - fix shadow variable name warnings from decodeULEB128 calls. NFCI.
Consistently rename the Length attribute to DecodeLength in decodeULEB128 calls.
Simon Pilgrim [Sat, 2 Nov 2019 19:24:03 +0000 (19:24 +0000)]
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.
Dávid Bolvanský [Sat, 2 Nov 2019 19:14:29 +0000 (20:14 +0100)]
[LegacyPassManager] Fixed "null check after derefencing" warning
The 'RequiredPass' pointer was utilized before it was verified against nullptr. Check lines: 1626, 1629.
Saleem Abdulrasol [Sat, 2 Nov 2019 19:06:17 +0000 (15:06 -0400)]
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.
Simon Pilgrim [Sat, 2 Nov 2019 18:45:31 +0000 (18:45 +0000)]
X86_MC::createX86MCSubtargetInfo - X86_MC::ParseX86Triple never returns an empty string. NFCI.
PVS Studio was complaining that the expression '!ArchFS.empty()' is always true.
Simon Pilgrim [Sat, 2 Nov 2019 18:37:58 +0000 (18:37 +0000)]
X86Operand::print - fix SymName shadow variable warning. NFCI.
Stefan Stipanovic [Sat, 2 Nov 2019 15:35:38 +0000 (16:35 +0100)]
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
Simon Pilgrim [Sat, 2 Nov 2019 17:40:52 +0000 (17:40 +0000)]
FastISel - fix uninitialized variable warnings in constructor. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 17:38:04 +0000 (17:38 +0000)]
llvm.coverage.FunctionRecord - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 17:36:14 +0000 (17:36 +0000)]
X86AsmPrinter - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 17:28:08 +0000 (17:28 +0000)]
DIEAbbrev - fix uninitialized variable warning. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 17:27:18 +0000 (17:27 +0000)]
Fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 16:45:06 +0000 (16:45 +0000)]
Fix uninitialized variable warning. NFCI.
Dávid Bolvanský [Sat, 2 Nov 2019 18:02:33 +0000 (19:02 +0100)]
Revert "[Codegen] Both sides of '&&' are same; fixed"
This reverts commit
edb42dccfafb2c0d25d19175c49d016a7c2e0b13. Buildbot timeouts.
Luboš Luňák [Sat, 2 Nov 2019 15:39:59 +0000 (16:39 +0100)]
make -ftime-trace also trace time spent creating debug info
Differential Revision: https://reviews.llvm.org/D69750
Stefan Stipanovic [Sat, 2 Nov 2019 16:31:02 +0000 (17:31 +0100)]
Revert "NoFree argument attribute."
This reverts commit
c12efa2ed0547f7f9f8fba0ad7a76a4cb08bf53a.
Simon Pilgrim [Sat, 2 Nov 2019 16:11:01 +0000 (16:11 +0000)]
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.
Simon Pilgrim [Sat, 2 Nov 2019 16:00:21 +0000 (16:00 +0000)]
CustomTypeNode/SpecialTableSymbolNode - fix uninitialized variable warnings. NFCI.
Dávid Bolvanský [Fri, 1 Nov 2019 23:38:09 +0000 (00:38 +0100)]
[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
Stefan Stipanovic [Sat, 2 Nov 2019 15:35:38 +0000 (16:35 +0100)]
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
Simon Pilgrim [Sat, 2 Nov 2019 14:42:38 +0000 (14:42 +0000)]
Fix uninitialized variable warning. NFCI.
Simon Pilgrim [Sat, 2 Nov 2019 13:38:35 +0000 (13:38 +0000)]
[X86] Move computeZeroableShuffleElements before getTargetShuffleAndZeroables. NFCI.
Prep work toward merging some of the functionality.
Roman Lebedev [Sat, 2 Nov 2019 09:39:02 +0000 (12:39 +0300)]
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.
Luboš Luňák [Tue, 15 Oct 2019 19:24:37 +0000 (21:24 +0200)]
python path should be platform-dependent
Because one of the installed files is the _lldb.so symlink.
Differential Revision: https://reviews.llvm.org/D68910
Craig Topper [Sat, 2 Nov 2019 07:11:48 +0000 (00:11 -0700)]
[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.
Pengfei Wang [Sat, 2 Nov 2019 08:18:24 +0000 (01:18 -0700)]
[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.
Johannes Doerfert [Sat, 2 Nov 2019 03:35:18 +0000 (22:35 -0500)]
[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.
Johannes Doerfert [Sat, 2 Nov 2019 04:32:17 +0000 (23:32 -0500)]
[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.
Craig Topper [Sat, 2 Nov 2019 06:17:23 +0000 (23:17 -0700)]
[X86] Remove FeatureSSE3 from the implies list of HasFastHorizontalOps.
HasFastHorizontalOps is a tuning flag. It shouldn't imply an ISA flag.
Johannes Doerfert [Sat, 2 Nov 2019 04:03:35 +0000 (23:03 -0500)]
[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.
Johannes Doerfert [Sat, 2 Nov 2019 02:59:32 +0000 (21:59 -0500)]
[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.
Johannes Doerfert [Sat, 2 Nov 2019 02:04:54 +0000 (21:04 -0500)]
[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.
Johannes Doerfert [Sat, 2 Nov 2019 01:17:48 +0000 (20:17 -0500)]
[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.
Johannes Doerfert [Fri, 1 Nov 2019 23:45:25 +0000 (18:45 -0500)]
[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.
Johannes Doerfert [Fri, 1 Nov 2019 18:57:49 +0000 (13:57 -0500)]
[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).
Johannes Doerfert [Fri, 1 Nov 2019 18:42:54 +0000 (13:42 -0500)]
[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.
Johannes Doerfert [Fri, 1 Nov 2019 01:15:02 +0000 (20:15 -0500)]
[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.
Johannes Doerfert [Fri, 1 Nov 2019 01:03:13 +0000 (20:03 -0500)]
[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.
Johannes Doerfert [Fri, 1 Nov 2019 00:45:06 +0000 (19:45 -0500)]
[Attributor][NFCI] Remove obsolete code
The code in question does not add anything as the class is a subclass of
AACallSiteReturnedFromReturnedAndMustBeExecutedContext already.
Pengfei Wang [Sat, 2 Nov 2019 04:18:09 +0000 (21:18 -0700)]
[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
Pengfei Wang [Fri, 1 Nov 2019 06:17:07 +0000 (23:17 -0700)]
[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
Francis Visoiu Mistrih [Sat, 2 Nov 2019 04:07:40 +0000 (21:07 -0700)]
[dsymutil] Second attempt to fix dsymutil tests on non-darwin platforms