Commit Graph

358694 Commits

Author SHA1 Message Date
Simon Pilgrim df813dc09e Error.h - GenericBinaryError - pass Twine arg by reference not value.
This allows us to reduce the Twine.h include to a forward declaration.
2020-06-27 10:12:20 +01:00
Simon Pilgrim e92a620f6e CompileOnDemandLayer.h - remove unused Twine.h include. NFC. 2020-06-27 10:03:34 +01:00
Simon Pilgrim f605ad013e IndirectionUtils.h - reduce Twine.h include to forward declaration. NFC. 2020-06-27 10:03:34 +01:00
Simon Pilgrim 23cdbdb20b MCSectionWasm.h - reduce includes to forward declarations. NFC. 2020-06-27 10:03:34 +01:00
Simon Pilgrim f02f3470de AsmPrinter.h - reduce includes to forward declarations. NFC. 2020-06-27 10:03:33 +01:00
Nikita Popov 9a334a4d20 [IR] Store attributes that are available "somewhere" (NFC)
I noticed that for some benchmarks we spend quite a bit of time
inside AttributeList::hasAttrSomewhere(), mainly when checking
for the "returned" attribute. Most of the time the attribute will
not be present, in which case this function has to walk through
the whole attribute list and check for the attribute at each index.

This patch adds a cache of all "available somewhere" attributes
inside AttributeListImpl. This makes the structure 12 bytes larger,
but I don't think that's problematic, as attribute lists are uniqued.
Compile-time in terms of instructions retired improves by 0.4% on
average, but >1% for sqlite.

Differential Revision: https://reviews.llvm.org/D81867
2020-06-27 10:44:59 +02:00
Simon Pilgrim ba2ac689e6 AsmWriter - printConstVCalls/printNonConstVCalls - avoid std::vector pass by value. NFCI. 2020-06-27 09:38:37 +01:00
Roman Lebedev 141e845da5
[SCEV] Make SCEVAddExpr actually always return pointer type if there is pointer operand (PR46457)
Summary:
The added assertion fails on the added test without the fix.

Reduced from test-suite/MultiSource/Benchmarks/MiBench/office-ispell/correct.c
In IR, getelementptr, obviously, takes pointer as it's base,
and returns a pointer.

When creating an SCEV expression, SCEV operands are sorted in hope
that it increases folding potential, and at the same time SCEVAddExpr's
type is the type of the last(!) operand.

Which means, in some exceedingly rare cases, pointer operand may happen to
end up not being the last operand, and as a result SCEV for GEP
will suddenly have a non-pointer return type.
We should ensure that does not happen.

In the end, actually storing the `Type *`, at the cost of increasing
memory footprint of `SCEVAddExpr`, appears to be the solution.
We can't just store a 'is a pointer' bit and create pointer type
on the fly since we don't have data layout in getType().

Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=46457 | PR46457 ]]

Reviewers: efriedma, mkazantsev, reames, nikic

Reviewed By: efriedma

Subscribers: hiraditya, javed.absar, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82633
2020-06-27 11:37:17 +03:00
Roman Lebedev f9f52c88ca
[NFCI][SCEV] getPointerBase(): de-recursify
Summary:
This is boringly straight-forward, each iteration we see if
V is some expression that we can look into, and if it has
a single pointer operand, then set V to that operand
and repeat.

Reviewers: efriedma, mkazantsev, reames, nikic

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82632
2020-06-27 11:37:17 +03:00
Melanie Blower f4aaed3bf1 Reland D81869 "Modify FPFeatures to use delta not absolute settings"
This reverts commit defd43a5b3.
with correction to solve msan report

To solve https://bugs.llvm.org/show_bug.cgi?id=46166 where the
floating point settings in PCH files aren't compatible, rewrite
FPFeatures to use a delta in the settings rather than absolute settings.
With this patch, these floating point options can be benign.

Reviewers: rjmccall

Differential Revision: https://reviews.llvm.org/D81869
2020-06-27 01:34:57 -07:00
Fady Ghanim 89812eeee9 [OpenMP][OMPBuilder] Remove unused variable in Unittest
Relating to buildbot errors to commit 82b8236cf2
2020-06-27 02:49:43 -04:00
Gui Andrade eae84b41fe [MSAN] Handle x86 {round,min,max}sd intrinsics
These need special handling over the simple vector intrinsics as they
behave more like a shuffle operation: taking the top half of the vector
from one input, and the bottom half separately. Previously, these were
being handled as though all bits of all operands were combined.

Differential Revision: https://reviews.llvm.org/D82398
2020-06-27 06:46:04 +00:00
Gui Andrade 9aa9855a9c [Docs] BitCodeFormat.rst: List missing attribute codes 2020-06-27 06:34:36 +00:00
Craig Topper 9e8b5a20e9 [X86] Add MOVBE and RDRND features to BDVER4.
Only 6 years behind gcc. https://gcc.gnu.org/legacy-ml/gcc-patches/2014-08/msg00231.html

Found while working on improving how we define CPU features for
clang and auditing for correctness.
2020-06-26 23:32:17 -07:00
Fady Ghanim 82b8236cf2 [OpenMP][OMPBuilder] Adding privatization related `createXXXX` to OMPBuilder 2020-06-27 01:54:41 -04:00
lh123 c19e82c6b3 [Docs] Fix typo and test git commit access. NFC. 2020-06-27 13:35:59 +08:00
Fangrui Song 4cd19a6e15 [BasicAA] Rename -disable-basicaa to -disable-basic-aa to be consistent with the canonical name "basic-aa" 2020-06-26 20:55:44 -07:00
Fangrui Song f31811f2dc [BasicAA] Rename deprecated -basicaa to -basic-aa
Follow-up to D82607
Revert an accidental change (empty.ll) of D82683
2020-06-26 20:41:37 -07:00
Fangrui Song d94526bb5f [ELF] --warn-backrefs: check that D79300 fixed an issue due to `mb = {}`
D79300 forgot to change `getBuffer().empty()` in LazyObjFile::parse to
`fetched`. This caused incorrect iterating after the current LazyObjFile was
fetched. This issue is benign and can just cause loss of "undefined symbols"
and "backward reference" diagnostics.

Before D79300 `mb = {}` caused --warn-backrefs-exclude to be useless for
a fetched LazyObjFile.

Add two test cases.
2020-06-26 20:31:47 -07:00
Arthur Eubanks 059994f219 [NewPM][BasicAA] basicaa -> basic-aa in Transforms/{New,}GVN
Summary: Following https://reviews.llvm.org/D82607.

Reviewers: ychen

Subscribers: asbirlea, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82688
2020-06-26 20:28:18 -07:00
Arthur Eubanks 339eed5d0b [NewPM][BasicAA] basicaa -> basic-aa in Transforms/DeadStoreElimination
Summary: Following https://reviews.llvm.org/D82607.

Reviewers: ychen

Subscribers: george.burgess.iv, asbirlea, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82689
2020-06-26 20:13:37 -07:00
Nico Weber 28ef93cb14 Revert "Disable a JSONTest.Integers test with all MSVCs, PR46470"
This reverts commit 63bcf89125.
Turns out the more targeted disablement in the previous change
was good enough.
2020-06-26 22:30:24 -04:00
Alexander Shaposhnikov b925ca37a8 [llvm-install-name-tool] Add support for -rpath option
This diff implements -rpath option for llvm-install-name-tool
which replaces the rpath value in the specified Mach-O binary.

Patch by Sameer Arora!

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D82051
2020-06-26 17:23:03 -07:00
Vedant Kumar 9649c2095f [InstCombine] Drop debug loc in TryToSinkInstruction (reland)
Summary:
The advice in HowToUpdateDebugInfo.rst is to "... preserve the debug
location of an instruction if the instruction either remains in its
basic block, or if its basic block is folded into a predecessor that
branches unconditionally".

TryToSinkInstruction doesn't seem to satisfy the criteria as it's
sinking an instruction to some successor block. Preserving the debug loc
can make single-stepping appear to go backwards, or make a breakpoint
hit on that location happen "too late" (since single-stepping from that
breakpoint can cause the function to return unexpectedly).

So, drop the debug location.

This was reverted in ee3620643d because it removed source locations
from inlinable calls, breaking a verifier rule. I've added an exception
for calls because the alternative (setting a line 0 location) is not
better. I tested the updated patch by completing a stage2 RelWithDebInfo
build.

Reviewers: aprantl, davide

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82487
2020-06-26 17:18:15 -07:00
Alex Lorenz 2b00cacb28 [darwin][driver] NFC, split addStartObjectFileArgs into multiple functions 2020-06-26 17:15:37 -07:00
Alex Lorenz 253988f0f4 [darwin][driver] Do not link with libarclite when building for Apple Silicon macOS 2020-06-26 17:15:37 -07:00
peter klausler 5fb5f7b5ab [flang] Fix line continuation after bare labels (fm200.f)
Fixed-form line continuation was not working when the
preceding line was a bare label.

Reviewed By: tskeith

Differential Revision: https://reviews.llvm.org/D82687
2020-06-26 17:07:38 -07:00
Nico Weber 63bcf89125 Disable a JSONTest.Integers test with all MSVCs, PR46470 2020-06-26 20:02:04 -04:00
Nico Weber fb1aa286c1 Disable a JSONTest.Integers test with newer MSVCs, PR46470 2020-06-26 19:57:52 -04:00
Craig Topper d298acde82 [X86] Don't disable xsave when avx is disabled. Implicitly enable xsave with avx is enabled and xsave wasn't explciitly disabled
CPUs with avx always have xsave, but some CPUs without avx also
have xsave. So we shouldn't disable xsave just because avx is
disabled. This would prevent xsave from being enabled with
-march=native on CPUs with xsave and not avx.

But we also don't want -mavx -mno-avx to leave xsave eanabled.
So only enable xsave if avx is enabled after processing all features.

I thought about just not turning xsave on with avx at all, but
there might be someone out there depending on it.
2020-06-26 16:45:44 -07:00
Puyan Lotfi c918c1a91a [NFCi] Fixing build failures on Windows due to std::tie used w/o proper include.
From https://reviews.llvm.org/D81236 /
55fe7b79bb

std::tie is used without including <tuple>. This patch includes <tuple>
so that some downstream Windows bots succesfully build.
2020-06-26 16:30:25 -07:00
Jonas Devlieghere b4180fe477 [lldb/Test] Disable eh-frame-augment-noop.test on macOS
The test fails on Darwin because a different Asynchronous UnwindPlan is
chosen:

  Asynchronous (not restricted to call-sites) UnwindPlan is 'assembly
  insn profiling'`

instead of what the test expects:

  Asynchronous (not restricted to call-sites) UnwindPlan is 'eh_frame
  CFI'
2020-06-26 15:59:59 -07:00
Arthur Eubanks 0077988a6f Fix full-store-partial-alias.ll
Accidentally renamed -disable-basicaa -> -disable-basic-aa
2020-06-26 15:46:47 -07:00
Matt Arsenault b091c9a3e1 LLParser: Accept align(N) as new syntax for parameter attribute
Every other value parameter attribute uses parentheses, so accept this
as the preferred modern syntax. Updating everything to use the new
syntax is left for a future change.
2020-06-26 18:10:21 -04:00
Matt Arsenault 443556c18f AMDGPU/GlobalISel: Fix some legalization of < dword vector stores
This avoids many instances of failing to legalize a vector truncstore
of <4 x s8> to 2 bytes. We don't perfectly handle every truncstore
yet, largely because the given set of legalization actions can't
actually differentiate between changing the result type and changing
the memory type.
2020-06-26 18:07:39 -04:00
Vedant Kumar ee3620643d Revert "[InstCombine] Drop debug loc in TryToSinkInstruction"
This reverts commit 903cf140d0.

This might be causing verifier failures on the bots, such as: "inlinable
function call in a function with debug info must have a !dbg location"
--

http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/16976/steps/bootstrap%20clang/logs/stdio
2020-06-26 14:59:40 -07:00
Arthur Eubanks 691c086d15 [NewPM][BasicAA] basicaa -> basic-aa in Transforms/SLPVectorizer
Following https://reviews.llvm.org/D82607.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D82681
2020-06-26 14:58:41 -07:00
Arthur Eubanks feeed16a5f [NewPM][BasicAA] basicaa -> basic-aa in Analysis/BasicAA
Following https://reviews.llvm.org/D82607.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D82683
2020-06-26 14:58:01 -07:00
Yuanfang Chen 2b8a09e1ed [MemorySSA] Update comment in PassBuilder
Is teaching the LoopFullUnrollPass to preserve MemorySSA very hard or
just impossible?

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D82618
2020-06-26 14:55:31 -07:00
Vedant Kumar c1cad151b0 [debugify] Demote an error about empty locations to a warning
In https://reviews.llvm.org/D81198, we outlined a number of scenarios
where dropping debug locations is appropriate. Stop issuing an error
when this happens.
2020-06-26 14:55:02 -07:00
Steven Wu 898b01602b [compiler-rt] Fix mismatched #if/#endif comments
Fix a mismatched #if/#endif comments from my previous commit.
2020-06-26 14:54:35 -07:00
Matt Arsenault c2e403c19d GlobalISel: Don't fail translate on weak cmpxchg
The translation of cmpxchg added by
9481399c0f specifically skipped weak
cmpxchg due to not understanding the meaning. Weak cmpxchg was added
in 420a216817. As explained in the
commit message, the weak mode is implicit in how
ATOMIC_CMP_SWAP_WITH_SUCCESS is lowered. If it's expanded to a regular
ATOMIC_CMP_SWAP, it's replaced with a strong cmpxchg.

This handling seems weird to me, but this was already following the
DAG behavior. I would expect the strong IR instruction to not have the
boolean output. Failing that, I might expect the IRTranslator to emit
ATOMIC_CMP_SWAP and a constant for the boolean.
2020-06-26 17:52:18 -04:00
Tony 990f8702c9 [AMDGPU] Define DWARF encoding for condition code registers
Summary:
- Define DWARF register numbers for vector and scalar condition codes.
- Document intended purpose of reserved DWARF register numbers.

Reviewers: yaxunl, kzhuravl, arsenm, rampitec, b-sumner

Subscribers: jvesely, wdng, nhaehnle, aprantl, dstuttard, tpr, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82519
2020-06-26 17:53:55 -04:00
JF Bastien b10bd6dfc6 [NFC] Bump ObjCOrBuiltinIDBits to 15
We're now hitting this because we're at the limit for number of builtins:
  clang/lib/Basic/IdentifierTable.cpp:39:1: error: static_assert failed due to requirement '2 * LargestBuiltinID < (2 << (ObjCOrBuiltinIDBits - 1))' "Insufficient ObjCOrBuiltinID Bits"
  static_assert(2 * LargestBuiltinID < (2 << (ObjCOrBuiltinIDBits - 1)),
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bump it to 15 so whoever adds a builtin next (as I am, or as anyone else might) doesn't merge conflict over each other.
2020-06-26 13:48:51 -07:00
Francesco Petrogalli ddbdff3acc [sve][acle] Recommit https://reviews.llvm.org/D82501
The original patch was reverted in
ff5ccf258e
as it was missing the C tests that got accidentally missing.

This patch is a NFC of https://reviews.llvm.org/D82501, together with
the SVE ACLE tests for the C intrinsics of svreinterpret for brain
float types.
2020-06-26 20:45:29 +00:00
Amy Huang 8b59c26bf3 Extend or truncate __ptr32/__ptr64 pointers when dereferenced.
Summary:
A while ago I implemented the functionality to lower Microsoft __ptr32
and __ptr64 pointers, which are stored as 32-bit and 64-bit pointer
and are extended/truncated to the appropriate pointer size when
dereferenced.
This patch adds an addrspacecast to cast from the __ptr32/__ptr64
pointer to a default address space when dereferencing.

Bug: https://bugs.llvm.org/show_bug.cgi?id=42359

Reviewers: hans, arsenm, RKSimon

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81517
2020-06-26 13:33:54 -07:00
Vedant Kumar 903cf140d0 [InstCombine] Drop debug loc in TryToSinkInstruction
Summary:
The advice in HowToUpdateDebugInfo.rst is to "... preserve the debug
location of an instruction if the instruction either remains in its
basic block, or if its basic block is folded into a predecessor that
branches unconditionally".

TryToSinkInstruction doesn't seem to satisfy the criteria as it's
sinking an instruction to some successor block. Preserving the debug loc
can make single-stepping appear to go backwards, or make a breakpoint
hit on that location happen "too late" (since single-stepping from that
breakpoint can cause the function to return unexpectedly).

So, drop the debug location.

Reviewers: aprantl, davide

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D82487
2020-06-26 13:23:24 -07:00
Francesco Petrogalli ff5ccf258e Revert "[sve][acle] Add reinterpret intrinsics for brain float."
This reverts commit a15722c5ce.

The commmit has to be reverted because I accidentally submit
https://reviews.llvm.org/D82501 without the C tests that were added in
an early version of the patch.
2020-06-26 20:19:49 +00:00
Melanie Blower 467ba4c92f More corrections to documented spelling of ffinite-math to ffinite-math-only 2020-06-26 13:17:55 -07:00
Florian Hahn c0cdba727a [VPlan] Add & use VPValue for VPWidenGEPRecipe operands (NFC).
This patch adds VPValue version of the GEP's operands to
VPWidenGEPRecipe and uses them during code-generation.

Reviewers: Ayal, gilr, rengolin

Reviewed By: gilr

Differential Revision: https://reviews.llvm.org/D80220
2020-06-26 20:59:17 +01:00