Commit Graph

201729 Commits

Author SHA1 Message Date
David Stenberg
331775f51f [DebugInfo] Allow GNU macro extension to be read
Allow the GNU .debug_macro extension to be parsed and printed by
llvm-dwarfdump. In an upcoming patch support will be added for emitting
that format also.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82974
2020-08-11 13:30:52 +02:00
David Stenberg
9fb94de7cb [DebugInfo] Introduce GNU macro extension entry encodings
This is a preparatory patch for allowing the GNU .debug_macro extension,
which is a precursor to the DWARF 5 format, to be emitted by LLVM for
earlier DWARF versions.

The entries share the same encoding and behavior as in DWARF5; there are
just more entries in the DWARF 5 format. Therefore, we could have used
those existing DWARF 5 entries, but I think that explicitly referring to
the GNU macro variants makes the code more clear.

The defines that this patch introduces can be found in GCC in the dwarf2.h header:
  https://gcc.gnu.org/git/?p=gcc.git;a=blob;
  f=include/dwarf2.h;
  h=0b6facfd4cf4c02320c7328114231b128ab42d5e;
  hb=dccbf1e2a6e544f71b4a5795f0c79015db019fc3#l425

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82972
2020-08-11 13:30:52 +02:00
David Stenberg
b7e32254c6 [DebugInfo] Refactor .debug_macro checks. NFCI
Move the Dwarf version checks that determine if the .debug_macro section
should be emitted, into a DwarfDebug member. This is a preparatory
refactoring for allowing the GNU .debug_macro extension, which is a
precursor to the DWARF 5 format, to be emitted by LLVM for earlier DWARF
versions.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D82971
2020-08-11 13:30:52 +02:00
Benjamin Kramer
5279174413 [AutoUpgrade] Simplify code
No need to set the name on an instruction that's going away, just move
it from the old instruction to the new one.
2020-08-11 13:22:58 +02:00
Kerry McLaughlin
76e22108d4 [CodeGen] Refactor getMemBasePlusOffset & getObjectPtrOffset to accept a TypeSize
Changes the Offset arguments to both functions from int64_t to TypeSize
& updates all uses of the functions to create the offset using TypeSize::Fixed()

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D85220
2020-08-11 12:17:10 +01:00
Benjamin Kramer
e8a9b5e671 [X86][FPEnv] Fix a use after free
Found by asan!
2020-08-11 13:00:47 +02:00
Kazushi (Jam) Marukawa
9a6359070d [VE] Update bit operations
Change bitreverse/bswap/ctlz/ctpop/cttz regression tests to support i128
and signext/zeroext i32 types.  This patch also change the way to support
i32 types using 64 bits VE instructions.

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D85712
2020-08-11 19:42:12 +09:00
Paul Walker
24ea55d3d7 [SVE] Add ISD nodes for predicated integer extend inreg operations.
These are useful instructions when lowering fixed length vector
extends, so I've broken this patch out as kind of NFC like work.

Differential Revision: https://reviews.llvm.org/D85546
2020-08-11 11:39:26 +01:00
Simon Pilgrim
50301acce9 [X86] Rename combineVectorPackWithShuffle -> combineHorizOpWithShuffle. NFC.
The plan is to use this for (F)HADD/SUB opcodes as well as PACKs - similar to how we use combineShuffleWithHorizOp
2020-08-11 11:38:43 +01:00
Paul Walker
04aa37ecb2 [SVE] Lower fixed length vector integer subtract operations.
Differential Revision: https://reviews.llvm.org/D85665
2020-08-11 11:32:12 +01:00
David Zarzycki
6dee907db3 Add missing -o - to a recent test
Caught with a build-system that remounts the source directory read-only.
2020-08-11 06:00:11 -04:00
Kai Nacke
3dba5d6f3f [NFC] Fix typo in comment.
Twelvth -> Twelfth
2020-08-11 05:27:56 -04:00
Kai Nacke
b0aab57571 [SystemZ/ZOS] Add binary format goff and operating system zos to the triple
Adds the binary format goff and the operating system zos to the triple
class. goff is selected as default binary format if zos is choosen as
operating system. No further functionality is added.

Reviewers: efriedma, tahonermann, hubert.reinterpertcast, MaskRay

Reviewed By: efriedma, tahonermann, hubert.reinterpertcast

Differential Revision: https://reviews.llvm.org/D82081
2020-08-11 05:26:26 -04:00
Dávid Bolvanský
27e916d19d [Docs] Fixed missing closing quote character 2020-08-11 11:21:15 +02:00
Florian Hahn
d866e0aa79 [SLP] Make sure instructions are ordered when computing spill cost.
The entries in VectorizableTree are not necessarily ordered by their
position in basic blocks. Collect them and order them by dominance so
later instructions are guaranteed to be visited first. For instructions
in different basic blocks, we only scan to the beginning of the block,
so their order does not matter, as long as all instructions in a basic
block are grouped together. Using dominance ensures a deterministic order.

The modified test case contains an example where we compute a wrong
spill cost (2) without this patch, even though there is no call between
any instruction in the bundle.

This seems to have limited practical impact, .e.g on X86 with a recent
Intel Xeon CPU with -O3 -march=native -flto on MultiSource,SPEC2000,SPEC2006
there are no binary changes.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D82444
2020-08-11 11:18:12 +02:00
Dávid Bolvanský
8612b627f3 [InstCombine] ~(~X + Y) -> X - Y
Proof:
https://alive2.llvm.org/ce/z/4xharr

Solves PR47051

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D85593
2020-08-11 11:05:42 +02:00
Florian Hahn
cd4df5279d [SCEVExpander] Add helper to clean up instrs inserted while expanding.
SCEVExpander already tracks which instructions have been inserted n
InsertedValues/InsertedPostIncValues. This patch adds an additional
vector to collect the instructions in insertion order. This can then be
used to remove exactly the instructions inserted by the expander.

This replaces ExpandedValuesCleaner, which in some cases might remove
values not inserted by the expander (e.g. if a value was dead before
insertion and is then used during expansion).

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D84327
2020-08-11 09:30:31 +01:00
Sam Parker
45c2cd441e [RDA] Fix DBG_VALUE issues
We skip debug instructions in RDA so we cannot attempt to look them
up in our instruction map without causing a crash. But some of the
methods select the last instruction in the block and this
instruction may be a debug instruction... So, use getLastNonDebugInstr
instead of calling back on a MachineBasicBlock.

MachineBasicBlock iterators have also been updated to use
instructionsWithoutDebug so we can avoid the manual checks for debug
instructions.

Differential Revision: https://reviews.llvm.org/D85658
2020-08-11 09:03:09 +01:00
Juneyoung Lee
6e8034136f [LazyValueInfo] Let getEdgeValueLocal look into freeze instructions
This patch makes getEdgeValueLocal more precise when a freeze instruction is
given, by adding support for freeze into constantFoldUser

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D84629
2020-08-11 16:39:34 +09:00
Eric Christopher
80212c2c9a Test requires a debug build to pass. 2020-08-10 23:57:55 -07:00
Shinji Okumura
aa6d7628ea [Attributor][NFC] Connect AAPotentialValues with AAValueSimplify
This patch enables `AAValueSimplify` to use information from `AAPotentialValues`

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D85668
2020-08-11 15:52:02 +09:00
Craig Topper
817af34efe [X86] Custom match X86ISD::VPTERNLOG in X86ISelDAGToDAG in order to reduce isel patterns.
By factoring out the end of tryVPTERNLOG, we can use the same code
to directly match X86ISD::VPTERNLOG. This allows us to remove
around 3-4K worth of X86GenDAGISel.inc.
2020-08-10 23:15:58 -07:00
QingShan Zhang
1cb3ec8219 [CodeGen] Expand float operand for STRICT_FSETCC/STRICT_FSETCCS
This patch is the continue work of https://reviews.llvm.org/D69281
to implement the way that expands STRICT_FSETCC/STRICT_FSETCCS.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D81906
2020-08-11 05:55:00 +00:00
LLVM GN Syncbot
8446fc61f4 [gn build] Port db91320a898 2020-08-11 04:32:01 +00:00
Haowei Wu
f44281335e Revert "Move ELFObjHandler to TextAPI library"
This reverts commit e6f8ba12e6ea97cbf4374b70e78309c2d859ca1c due
to build failures.
2020-08-10 21:31:29 -07:00
LLVM GN Syncbot
4e781c06b8 [gn build] Port e6f8ba12e6e 2020-08-11 04:24:23 +00:00
Haowei Wu
1fa1012fcc Move ELFObjHandler to TextAPI library
This change moves ELFObjHandler to llvm/TextAPI library so it can
be used by different llvm tools.
2020-08-10 21:23:39 -07:00
Xing GUO
f1f4b9f09b [macho2yaml][test] Specify the object file's endianness. NFC.
This patch is intended to fix testing failure on big endian machine.

Failed testing: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/52450
2020-08-11 11:46:50 +08:00
Xing GUO
f991e6ea33 [macho2yaml][test] Specify the object file's endianness. NFC.
This change specifies the endianness of the generated object file to fix
the testing failure.

Testing failure: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/52449
2020-08-11 11:14:54 +08:00
Wang, Pengfei
72838e8fb2 [X86][FPEnv] Teach X86 mask compare intrinsics to respect strict FP semantics.
When we use mask compare intrinsics under strict FP option, the masked
elements shouldn't raise any exception. So, we cann't replace the
intrinsic with a full compare + "and" operation.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D85385
2020-08-11 10:28:41 +08:00
Xing GUO
99ed94570d [macho2yaml] Refactor the DWARF section dumpers.
This patch refactors the DWARF section dumpers. When dumping a DWARF
section, if the DWARF parser fails to parse the section, we will dump it
as a raw content section. This patch also fixes a bug in
DWARFYAML::Data::isEmpty(). Finally, a test case that tests dumping the
__debug_aranges section is added.

Reviewed By: jhenderson, grimar

Differential Revision: https://reviews.llvm.org/D85506
2020-08-11 10:18:34 +08:00
Hubert Tong
da6c633ded Revert "[AIX] Try to not use LLVM tools while building runtimes"
This reverts commit 50dd75c8e0b81815c6da209d5a3dd7bf899d1262.
@phosek reports a build break.
2020-08-10 21:35:49 -04:00
Yuanfang Chen
08ee0eb96e [CodeGen] Make MMI immutable NPM pass 2020-08-10 17:52:42 -07:00
Lang Hames
ce159bf33c [llvm-jitlink] Update llvm-jitlink to use TargetProcessControl. 2020-08-10 17:19:48 -07:00
Johannes Doerfert
d5ca7458b9 [OpenMP][NFC] Reuse OMPIRBuilder struct ident_t handling in Clang
Replace the `ident_t` handling in Clang with the methods offered by the
OMPIRBuilder. This cuts down on the clang code as well as the
differences between the two, making further transitions easier. Tests
have changed but there should not be a real functional change. The most
interesting difference is probably that we stop generating local ident_t
allocations for now and just use globals. Given that this happens only
with debug info, the location part of the `ident_t` is probably bigger
than the test anyway. As the location part is already a global, we can
avoid the allocation, memcpy, and store in favor of a constant global
that is slightly bigger. This can be revisited if there are
complications.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D80735
2020-08-10 17:13:26 -05:00
Arthur Eubanks
e2b96556b2 [InstSimplify][test] Remove unused parameter in vscale.ll
Reviewed By: huihuiz

Differential Revision: https://reviews.llvm.org/D85688
2020-08-10 14:48:32 -07:00
Nikita Popov
c82a20fd22 [InstSimplify] Add test for expand binop undef issue (NFC)
Add test case from https://reviews.llvm.org/D83360#2146539.
2020-08-10 22:39:59 +02:00
David Tenty
b95ef083c5 [AIX] Try to not use LLVM tools while building runtimes
Since 64-bit XCOFF and the big AR format is not yet supported in some of these tools, this patch avoids additional setup of these tools. This patch is not intended to prevent picking up the LLVM tools if they happen to be available otherwise.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D85329
2020-08-10 16:11:33 -04:00
Alexandre Ganea
dd46edfabc Fix "last accessed time" test failing on Windows
Before this patch, the tests in llvm/test/tools/llvm-objcopy/ELF/strip-preserve-atime.test used to fail on my machine, because the "last accessed time" is disabled in the OS by default since Windows XP. One needs to explicitly enable it for the feature to work. Otherwise the last access time is the last write time. Please see: https://superuser.com/questions/251263/the-last-access-date-is-not-changed-even-after-reading-the-file-on-windows-7

    Differential Revision: https://reviews.llvm.org/D85669
2020-08-10 16:03:14 -04:00
jasonliu
a056348a49 [XCOFF][AIX] Use TE storage mapping class when large code model is enabled
Summary:
Use TE SMC instead of TC SMC in large code model mode,
so that large code model TOC entries could get placed after all
the small code model TOC entries, which reduces the chance of TOC overflow.

Reviewed By: Xiangling_L

Differential Revision: https://reviews.llvm.org/D85455
2020-08-10 19:52:10 +00:00
Puyan Lotfi
c4f084e133 [MachineOutliner][AArch64] WA for multiple stack fixup cases in MachineOutliner.
In cases where MachineOutliner candidates either are:

  * noreturn
  * have calls with no available LR or free regs
  * Don't use SP

we can end up hitting stack fixup code for the caller and the callee for
a FrameID of MachineOutlinerDefault. This triggers the assert:

  `assert(OF.FrameConstructionID != MachineOutlinerDefault &&
          "Can only fix up stack references once");`

in AArch64InstrInfo.cpp. This assert exists for now because a lot of the
fixup code is not tested to handle fixing up more than once and needs
some better checks and enhancements to avoid potentially generating
illegal code.

I've filed a Bugzilla report to track this until these cases are handled
by the AArch64 MachineOutliner: https://bugs.llvm.org/show_bug.cgi?id=46767

This diff detects cases that will cause these multiple stack fixups and
prune the Candidates from `RepeatedSequenceLocs`.

    Differential Revision: https://reviews.llvm.org/D83923
2020-08-10 15:43:30 -04:00
Wei Mi
65d57e74b8 [SampleFDO] Stop letting findCalleeFunctionSamples return unrelated profiles
for invoke instructions.

We see a warning of "No debug information found in function foo: Function
profile not used" in a case. The function foo is called by an invoke
instruction. It has no debug information because it has attribute((nodebug))
in the definition. It shouldn't have profile instance in the sample profile
but compiler thinks it does, that turns out to be a compiler bug in
findCalleeFunctionSamples. The bug is exposed when sample-profile-merge-inlinee
is enabled recently.

Currently in findCalleeFunctionSamples, CalleeName is unset and is empty for
invoke instruction. For empty CalleeName, findFunctionSamplesAt will treat
the call as an indirect call and will return any inline instance profile at
the same location as the instruction. That leads to a wrong profile being
returned to function foo.

The patch set CalleeName when the instruction is an invoke.

Differential Revision: https://reviews.llvm.org/D85664
2020-08-10 12:41:09 -07:00
Thomas Lively
1da4ba1036 [WebAssembly][ConstantFolding] Fold fp-to-int truncation intrinsics
Constant fold both the trapping and saturating versions of the
WebAssembly truncation intrinsics. The tests are adapted from the
WebAssembly spec tests for the corresponding instructions.

Requested in PR46982.

Differential Revision: https://reviews.llvm.org/D85392
2020-08-10 12:40:05 -07:00
Paul Walker
b50a4a5bcf Fix "CHECK-LABEL: @" typos in llvm/test/CodeGen/AArch64/sve-fixed-length-*.ll 2020-08-10 20:07:45 +01:00
Stanislav Mekhanoshin
ff3db7b010 Unbundle KILL bundles in VirtRegRewriter
SplitKit forms invalid COPY subreg bundles without a leading
BUNDLE instruction. That manifests itself in post-RA scheduler
counting instruction and asserting on "Instruction count mismatch".

The bundle shall be undone by VirtRegRewriter::expandCopyBundle(),
but it does not because VirtRegRewriter::handleIdentityCopy() can
turn COPY bundle into a KILL bundle.

Process KILLs as well.

Differential Revision: https://reviews.llvm.org/D85484
2020-08-10 11:58:37 -07:00
Matt Arsenault
34e38f92c7 AMDGPU: Fix assertion in performSHLPtrCombine for 64-bit pointers 2020-08-10 13:46:52 -04:00
Matt Arsenault
ed6f29c1cc AMDGPU: Fix visiting physreg dest users when folding immediate copies
This can fold the immediate into the physical destination, but this
should not look for further users of the register. Fixes regression
introduced by 766cb615a3b96025192707f4670cdf171da84034.
2020-08-10 13:46:51 -04:00
Alexandre Ganea
b12b3875d3 Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record
This patch adds the missing information to the LF_BUILDINFO record, which allows for rebuilding a .CPP without any external dependency but the .OBJ itself (other than the compiler).

Some external tools that we are using (Recode, Live++) are extracting the information to reproduce a build without any knowledge of the build system. The LF_BUILDINFO stores a full path to the compiler, the PWD (CWD at program startup), a relative or absolute path to the TU, and the full CC1 command line. The command line needs to be freestanding (not depend on any environment variables). In the same way, MSVC doesn't store the provided command-line, but an expanded version (somehow their equivalent of CC1) which is also freestanding.

For more information see PR36198 and D43002.

Differential Revision: https://reviews.llvm.org/D80833
2020-08-10 13:36:30 -04:00
Craig Topper
1e510916fc [BreakFalseDeps][X86] Move operand loop out of X86's getUndefRegClearance and put in the pass.
X86 is the only user of this interface in tree. Previously the
X86 pass would loop over operands looking for one undef operand for
the pass to fix. But there could theoretically be multiple operands
to fix. So it makes more sense for the pass to do the looping and
ask the target if an operand needs to be fixed.
2020-08-10 10:32:29 -07:00
Wouter van Oortmerssen
ecdeeefdee [WebAssembly] wasm64: fix memory.init operand types
I had assumed they would all become in i64, but this is not necessary as long as data segments stay 32-bit, see:
https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md

Differential Revision: https://reviews.llvm.org/D85552
2020-08-10 10:15:20 -07:00