Fangrui Song [Wed, 5 May 2021 07:20:41 +0000 (00:20 -0700)]
[llvm-objdump] Add -M {att,intel} & deprecate --x86-asm-syntax={att,intel}
The internal `cl::opt` option --x86-asm-syntax sets the AsmParser and AsmWriter
dialect. The option is used by llc and llvm-mc tests to set the AsmWriter dialect.
This patch adds -M {att,intel} as GNU objdump compatible aliases (PR43413).
Note: the dialect is initialized when the MCAsmInfo is constructed.
`MCInstPrinter::applyTargetSpecificCLOption` is called too late and its MCAsmInfo
reference is const, so changing the `cl::opt` in
`MCInstPrinter::applyTargetSpecificCLOption` is not an option, at least without
large amount of refactoring.
Reviewed By: hoy, jhenderson, thakis
Differential Revision: https://reviews.llvm.org/D101695
Yang Fan [Wed, 5 May 2021 06:44:48 +0000 (14:44 +0800)]
[clang][TargetCXXABI] Fix -Wreturn-type warning (NFC)
GCC warning:
```
In file included from /llvm-project/clang/include/clang/Basic/LangOptions.h:22,
from /llvm-project/clang/include/clang/Frontend/CompilerInvocation.h:16,
from /llvm-project/clang/lib/Frontend/CompilerInvocation.cpp:9:
/llvm-project/clang/include/clang/Basic/TargetCXXABI.h: In static member function ‘static bool clang::TargetCXXABI::isSupportedCXXABI(const llvm::Triple&, clang::TargetCXXABI::Kind)’:
/llvm-project/clang/include/clang/Basic/TargetCXXABI.h:114:3: warning: control reaches end of non-void function [-Wreturn-type]
114 | };
| ^
```
Med Ismail Bennani [Wed, 5 May 2021 06:01:50 +0000 (06:01 +0000)]
[lldb/Test] Disable testBreakpointByLineAndColumnNearestCode on Windows
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Jianzhou Zhao [Wed, 5 May 2021 05:30:53 +0000 (05:30 +0000)]
[dfsan] Turn off all dfsan test cases on non x86_64 OSs
https://reviews.llvm.org/D101666 enables sanitizer allocator.
This broke all test cases on non x86-64.
Med Ismail Bennani [Wed, 5 May 2021 04:28:28 +0000 (04:28 +0000)]
[lldb/Symbol] Fix column breakpoint `move_to_nearest_code` match
This patch fixes the column symbol resolution when creating a breakpoint
with the `move_to_nearest_code` flag set.
In order to achieve this, the patch adds column information handling in
the `LineTable`'s `LineEntry` finder. After experimenting a little, it
turns out the most natural approach in case of an inaccurate column match,
is to move backward and match the previous `LineEntry` rather than going
forward like we do with simple line breakpoints.
The patch also reflows the function to reduce code duplication.
Finally, it updates the `BreakpointResolver` heuristic to align it with
the `LineTable` method.
rdar://
73218201
Differential Revision: https://reviews.llvm.org/D101221
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
LLVM GN Syncbot [Wed, 5 May 2021 04:57:55 +0000 (04:57 +0000)]
[gn build] Port
600686d75f55
Brad Smith [Wed, 5 May 2021 04:55:36 +0000 (00:55 -0400)]
Fix typo, arvm7 -> armv7
zoecarver [Fri, 23 Apr 2021 18:23:22 +0000 (11:23 -0700)]
[libcxx][ranges] Add ranges::ssize CPO.
Based on D101079.
Differential Revision: https://reviews.llvm.org/D101189
zoecarver [Thu, 22 Apr 2021 16:29:02 +0000 (09:29 -0700)]
[libcxx][ranges] Add ranges::size CPO.
The begining of [range.prim].
Differential Revision: https://reviews.llvm.org/D101079
Juneyoung Lee [Tue, 4 May 2021 01:16:21 +0000 (10:16 +0900)]
[InstCombine] Fold more select of selects using isImpliedCondition
This is a simple folding that does these:
```
select x_inv, true, (select y, x, false)
=>
select x_inv, true, y
```
https://alive2.llvm.org/ce/z/-STJ2d
```
select (select y, x, false), true, x_inv
=>
select y, true, x_inv
```
https://alive2.llvm.org/ce/z/6ruYt6
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D101807
Juneyoung Lee [Tue, 4 May 2021 01:14:02 +0000 (10:14 +0900)]
[InstCombine] Precommit tests for D101807 (NFC)
zoecarver [Sat, 24 Apr 2021 00:11:44 +0000 (17:11 -0700)]
[libcxx][ranges] Add `random_access_{iterator,range}`.
Differential Revision: https://reviews.llvm.org/D101316
William S. Moses [Mon, 3 May 2021 23:20:10 +0000 (19:20 -0400)]
[MLIR][SCF] Combine adjacent scf.if with same condition
Differential Revision: https://reviews.llvm.org/D101798
Serguei Katkov [Tue, 4 May 2021 03:56:00 +0000 (10:56 +0700)]
[GreedyRA] Add support for invoke statepoint with tied-defs.
statepoint instruction uses tied-def registers to represent live gc value which
is use and def at the same time on a call.
At the same time invoke statepoint instruction is a last split point which can throw and
jump to landing pad.
As a result we have instructon which is last split point with tied-defs registers and
we need to teach Greedy RA to work with it.
The option -use-registers-for-gc-values-in-landing-pad controls whether statepoint lowering
will generate tied-defs for invoke statepoint and is off by default now.
To resolve all issues the following changes has been done.
1) Last Split point for invoke statepoint should be statepoint itself
If statepoint has a def it is a relocated gc pointer and it should be available in landing pad.
So we cannot split interval after statepoint at end of basic block.
2) Do not split interval on tied-def
If end of interval for overlap utility is a use which has tied-def we
should not split interval on this instruction due to in this case use
and def may have different registers and it breaks tied-def property.
3) Take into account Last Split Point for enterIntvAtEnd
If the use after Last Split Point is a def so it should be tied-def and
we can take the def of the tied-use as ParentVNI and thus
tied-use and tied-def will be live in resulting interval.
4) Handle the case when def is after LIP in InlineSpiller
If def of LI is after last insertion point of basic block we cannot hoist in this BB.
The example of such instruction is invoke statepoint where def represents the
relocated live gc pointer. Invoke is a last insertion point and its def is located after it.
In this case there is no place to insert spill and we bail out.
5) Fix removeBackCopies to account empty copies
RegAssignMap cannot hold empty interval, so do not set stop
to kill value if it produces empty interval.
This can happen if we remove back-copy and right before that we have another
back-copy.
For example, for parent %0 we can get
%1 = COPY %0
%2 = COPY %0
while we removing %2 we cannot set kill for %1 due to its empty.
6) Do not hoist copy to BB if its def is after LSP
If the parent def is a LastSplitPoint or later we cannot hoist copy to this basic block
because inserted copy (or re-materialization) will be located before the def.
All parts have been reviewed separately as follows:
https://reviews.llvm.org/D100747
https://reviews.llvm.org/D100748
https://reviews.llvm.org/D100750
https://reviews.llvm.org/D100927
https://reviews.llvm.org/D100945
https://reviews.llvm.org/D101028
Reviewers: reames, rnk, void, MatzeB, wmi, qcolombet
Reviewed By: reames, qcolombet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D101150
LLVM GN Syncbot [Wed, 5 May 2021 03:54:38 +0000 (03:54 +0000)]
[gn build] Port
f2018d6c16d1
Lang Hames [Wed, 28 Apr 2021 18:21:59 +0000 (11:21 -0700)]
[ORC] Reintroduce the ORC C API test.
This test was removed in
51495fd285 due to broken bots. Its reintroduction is
expected to trigger failures on some builders. The test has been modified to
print error messages in full, which should aid in tracking these down.
Walter Erquinigo [Mon, 3 May 2021 14:55:35 +0000 (07:55 -0700)]
[trace] Dedup different source lines when dumping instructions + refactor
When dumping the traced instructions in a for loop, like this one
4: for (int a = 0; a < n; a++)
5: do something;
there might be multiple LineEntry objects for line 4, but with different address ranges. This was causing the dump command to dump something like this:
```
a.out`main + 11 at main.cpp:4
[1] 0x0000000000400518 movl $0x0, -0x8(%rbp)
[2] 0x000000000040051f jmp 0x400529 ; <+28> at main.cpp:4
a.out`main + 28 at main.cpp:4
[3] 0x0000000000400529 cmpl $0x3, -0x8(%rbp)
[4] 0x000000000040052d jle 0x400521 ; <+20> at main.cpp:5
```
which is confusing, as main.cpp:4 appears twice consecutively.
This diff fixes that issue by making the line entry comparison strictly about the line, column and file name. Before it was also comparing the address ranges, which we don't need because our output is strictly about what the user sees in the source.
Besides, I've noticed that the logic that traverses instructions and calculates symbols and disassemblies had too much coupling, and made my changes harder to implement, so I decided to decouple it. Now there are two methods for iterating over the instruction of a trace. The existing one does it on raw load addresses, but the one provides a SymbolContext and an InstructionSP, and does the calculations efficiently (not as efficient as possible for now though), so the caller doesn't need to care about these details. I think I'll be using that iterator to reconstruct the call stacks.
I was able to fix a test with this change.
Differential Revision: https://reviews.llvm.org/D100740
Jianzhou Zhao [Wed, 5 May 2021 00:57:34 +0000 (00:57 +0000)]
Revert "[sanitizer_common] Recycle StackDepot memory"
This reverts commit
78804e6b20943f218f4b4a1867f600cf4744ffbd.
Jianzhou Zhao [Fri, 30 Apr 2021 21:19:45 +0000 (21:19 +0000)]
[dfsan] Add a DFSan allocator
This is a part of https://reviews.llvm.org/D101204
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D101666
Jianzhou Zhao [Sat, 6 Feb 2021 10:01:17 +0000 (10:01 +0000)]
[sanitizer_common] Recycle StackDepot memory
This relates to https://reviews.llvm.org/D95835.
In DFSan origin tracking we use StackDepot to record
stack traces and origin traces (like MSan origin tracking).
For at least two reasons, we wanted to control StackDepot's memory cost
1) We may use DFSan origin tracking to monitor programs that run for
many days. This may eventually use too much memory for StackDepot.
2) DFSan supports flush shadow memory to reduce overhead. After flush,
all existing IDs in StackDepot are not valid because no one will
refer to them.
Med Ismail Bennani [Wed, 5 May 2021 00:38:41 +0000 (00:38 +0000)]
[lldb/Symbol] Fix typo in SymbolFilePDBTests (NFC)
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Wed, 5 May 2021 00:34:19 +0000 (00:34 +0000)]
[lldb/Symbol] Update SymbolFilePDB unitest with SourceLocationSpec
This patch should fix the windows test failure following `
3e2ed7440569`.
It makes use of a `SourceLocationSpec` object when resolving a symbol
context from `SymbolFilePDB` file.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Fangrui Song [Wed, 5 May 2021 00:30:57 +0000 (17:30 -0700)]
[llvm-objcopy] --dump-section: error if '=' is missing or filename is empty
Fix PR45416: the diagnostic when '=' is missing is misleading.
`FileOutputBuffer::create` returns successfully when the filename is empty
(the temporary file is `.tmp%%%%%%%`), but `FileOutputBuffer::commit` will error when
renaming `.tmp%%%%%%%` to the empty name).
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D101697
Giorgis Georgakoudis [Wed, 5 May 2021 00:12:32 +0000 (17:12 -0700)]
Revert "[OpenMP][NFC] Refactor Clang OpenMP tests using update_cc_test_checks"
This reverts commit
956cae2f09b21429dbcb02066c99e35a239aa4bf.
Aart Bik [Tue, 4 May 2021 03:55:12 +0000 (20:55 -0700)]
[mlir][sparse] Introduce proper sparsification passes
This revision migrates more code from Linalg into the new permanent home of
SparseTensor. It replaces the test passes with proper compiler passes.
NOTE: the actual removal of the last glue and clutter in Linalg will follow
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D101811
Han Zhu [Tue, 9 Feb 2021 01:24:25 +0000 (17:24 -0800)]
[loop-idiom] Hoist loop memcpys to loop preheader
For a simple loop like:
```
struct S {
int x;
int y;
char b;
};
unsigned foo(S* __restrict__ a, S* b, int n) {
for (int i = 0; i < n; i++)
a[i] = b[i];
return sizeof(a[0]);
}
```
We could eliminate the loop and convert it to a large memcpy of 12*n bytes. Currently this is not handled. Output of `opt -loop-idiom -S < memcpy_before.ll`
```
%struct.S = type { i32, i32, i8 }
define dso_local i32 @_Z3fooP1SS0_i(%struct.S* noalias nocapture %a, %struct.S* nocapture readonly %b, i32 %n) local_unnamed_addr {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
ret i32 12
for.body: ; preds = %for.body, %for.body.preheader
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
%idxprom = zext i32 %i.08 to i64
%arrayidx = getelementptr inbounds %struct.S, %struct.S* %b, i64 %idxprom
%arrayidx2 = getelementptr inbounds %struct.S, %struct.S* %a, i64 %idxprom
%0 = bitcast %struct.S* %arrayidx2 to i8*
%1 = bitcast %struct.S* %arrayidx to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(12) %0, i8* nonnull align 4 dereferenceable(12) %1, i64 12, i1 false)
%inc = add nuw nsw i32 %i.08, 1
%cmp = icmp slt i32 %inc, %n
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0
attributes #0 = { argmemonly nofree nosync nounwind willreturn }
```
The loop idiom pass currently only handles load and store instructions. Since struct S is too big to fit in a register, the loop body contains a memcpy intrinsic.
With this change, re-run `opt -loop-idiom -S < memcpy_before.ll`. The loop memcpy is promoted to loop preheader. For this trivial case, the loop is dead and will be removed by another pass.
```
%struct.S = type { i32, i32, i8 }
define dso_local i32 @_Z3fooP1SS0_i(%struct.S* noalias nocapture %a, %struct.S* nocapture readonly %b, i32 %n) local_unnamed_addr {
entry:
%a1 = bitcast %struct.S* %a to i8*
%b2 = bitcast %struct.S* %b to i8*
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = zext i32 %n to i64
%1 = mul nuw nsw i64 %0, 12
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %a1, i8* align 4 %b2, i64 %1, i1 false)
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
ret i32 12
for.body: ; preds = %for.body, %for.body.preheader
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ]
%idxprom = zext i32 %i.08 to i64
%arrayidx = getelementptr inbounds %struct.S, %struct.S* %b, i64 %idxprom
%arrayidx2 = getelementptr inbounds %struct.S, %struct.S* %a, i64 %idxprom
%2 = bitcast %struct.S* %arrayidx2 to i8*
%3 = bitcast %struct.S* %arrayidx to i8*
%inc = add nuw nsw i32 %i.08, 1
%cmp = icmp slt i32 %inc, %n
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit
}
; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #0
attributes #0 = { argmemonly nofree nosync nounwind willreturn }
```
Reviewed By: zino
Differential Revision: https://reviews.llvm.org/D97667
Giorgis Georgakoudis [Tue, 4 May 2021 19:17:42 +0000 (12:17 -0700)]
[OpenMP][NFC] Refactor Clang OpenMP tests using update_cc_test_checks
This patch refactors a subset of Clang OpenMP tests, generating checklines using the update_cc_test_checks script. This refactoring facilitates updating the Clang OpenMP code generation codebase by automating test generation.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D101849
Thomas Lively [Tue, 4 May 2021 23:11:00 +0000 (16:11 -0700)]
[WebAssembly] Add codegen test for wasm_simd128.h
We previously did not have tests demonstrating that the intrinsics in
wasm_simd128.h lower to reasonable LLVM IR. This commit adds such a test.
Differential Revision: https://reviews.llvm.org/D101805
Med Ismail Bennani [Tue, 4 May 2021 23:03:10 +0000 (23:03 +0000)]
[lldb] Refactor argument group by SourceLocationSpec (NFCI)
This patch refactors a good part of the code base turning the usual
FileSpec, Line, Column, CheckInlines, ExactMatch arguments into a
SourceLocationSpec object.
This change is required for a following patch that will add handling of the
column line information when doing symbol resolution.
Differential Revision: https://reviews.llvm.org/D100965
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Jianzhou Zhao [Tue, 4 May 2021 21:19:00 +0000 (21:19 +0000)]
[dfsan] move dfsan_flags.h to cc files
D101666 needs this change.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D101857
Leonard Chan [Tue, 4 May 2021 22:52:17 +0000 (15:52 -0700)]
[clang][test] Update -fc++-abi tests
This attempts to move driver tests out of Frontend and to Driver, separates
RUNs that should fail from RUNs that should succeed, and prevent creating
output files or dumping output.
Differential Revision: https://reviews.llvm.org/D101867
Louis Dionne [Tue, 4 May 2021 22:48:16 +0000 (18:48 -0400)]
[libc++] Revert the std::to_address change to avoid relying on element_type.
This reverts commit
da456167, which broke the Clang build. I'm able to
reproduce it but I want to give myself a bit more time to investigate.
Differential Revision: https://reviews.llvm.org/D101638
Baptiste Saleil [Tue, 4 May 2021 22:27:02 +0000 (18:27 -0400)]
[AMDGPU] Add rm line to lit test to cleanup bots
River Riddle [Tue, 4 May 2021 21:50:08 +0000 (14:50 -0700)]
[mlir] Fix region successor bug in forward dataflow analysis
We weren't properly visiting region successors when the terminator wasn't return like, which could create incorrect results in the analysis. This revision ensures that we properly visit region successors, to avoid optimistically assuming a value is constant when it isn't.
Differential Revision: https://reviews.llvm.org/D101783
Florian Hahn [Tue, 4 May 2021 21:15:00 +0000 (22:15 +0100)]
[VPlan] Properly handle sinking of replicate regions.
This patch updates the code that sinks recipes required for first-order
recurrences to properly handle replicate-regions. At the moment, the
code would just move the replicate recipe out of its replicate-region,
producing an invalid VPlan.
When sinking a recipe in a replicate-region, we have to sink the whole
region. To do that, we first need to split the block at the target
recipe and move the region in between.
This patch also adds a splitAt helper to VPBasicBlock to split a
VPBasicBlock at a given iterator.
Fixes PR50009.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D100751
Rob Suderman [Tue, 4 May 2021 21:21:51 +0000 (14:21 -0700)]
[mlir][tosa] Fix tosa.concat by inserting linalg.fill after linalg.init
All linalg.init operations must be fed into a linalg operation before
subtensor. The inserted linalg.fill guarantees it executes correctly.
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D101848
Baptiste Saleil [Tue, 4 May 2021 21:24:39 +0000 (17:24 -0400)]
Fangrui Song [Tue, 4 May 2021 21:13:19 +0000 (14:13 -0700)]
[MC] Add MCAsmParser::parseComma to improve diagnostics
llvm-mc will error "expected comma" instead of "unexpected token".
Dávid Bolvanský [Tue, 4 May 2021 21:04:05 +0000 (23:04 +0200)]
Revert "[InstSimplify] Added tests for PR50173, NFC"
This reverts commit
4e7a4c73dab6605f4fcc7bf09c2ee85e7925f6d7. Not needed, pattern is handled by instcombine already.
Arthur O'Dwyer [Tue, 4 May 2021 19:50:28 +0000 (15:50 -0400)]
[libc++] Make sure std::to_address doesn't depend on P::element_type.
Differential Revision: https://reviews.llvm.org/D101638
Baptiste Saleil [Tue, 4 May 2021 20:30:56 +0000 (16:30 -0400)]
[AMDGPU] Disable the scalar IR, SDWA and load store vectorizer passes at -O1
This patch disables some of the passes at -O1. These passes have a significant
impact on compilation time, so we only want them to be enabled starting from -O2.
Differential Revision: https://reviews.llvm.org/D101414
Louis Dionne [Mon, 3 May 2021 16:21:13 +0000 (12:21 -0400)]
[libc++] Fix QoI bug with construction of std::tuple involving std::any
In std::tuple, we should try to avoid calling std::is_copy_constructible
whenever we can to avoid surprising interactions with (I believe) compiler
builtins. This bug was reported in https://reviews.llvm.org/D96523#2730953.
The issue was that when tuple<_Up...> was the same as tuple<_Tp...>, we
would short-circuit the _Or (because sizeof...(_Tp) != 1) and go evaluate
the following `is_constructible<_Tp, const _Up&>...`. That shouldn't
actually be a problem, but see the analysis in https://reviews.llvm.org/D101770#2736470
for why it is with Clang and GCC.
Instead, after this patch, we check whether the constructed-from tuple
is the same as the current tuple regardless of the number of elements,
since we should always prefer the normal copy constructor in that case
anyway.
Differential Revision: https://reviews.llvm.org/D101770
Fangrui Song [Tue, 4 May 2021 20:40:26 +0000 (13:40 -0700)]
[MC] Don't capitalize a floating point diagnostic
Matt Arsenault [Sat, 24 Apr 2021 15:42:12 +0000 (11:42 -0400)]
GlobalISel: Fix missing newline in debug printing
Matt Arsenault [Sat, 17 Apr 2021 13:30:59 +0000 (09:30 -0400)]
X86/GlobalISel: Rely on default assignValueToReg
The resulting output is semantically closer to what the DAG emits and
is more compatible with the existing CCAssignFns.
The returns of f32 in f80 are clearly broken, but they were broken
before when using G_ANYEXT to go from f32 to f80.
Fangrui Song [Tue, 4 May 2021 20:30:29 +0000 (13:30 -0700)]
[MC] Remove unneeded "in '.xxx' directive" from diagnostics
The directive name is not useful because the next line replicates the error line
which includes the directive.
Thomas Lively [Tue, 4 May 2021 20:25:31 +0000 (13:25 -0700)]
[WebAssembly] Mark abs of v2i64 as legal
We previously had an ISel pattern for i64x2.abs, but because the ISDNode was not
marked legal for v2i64, the instruction was not being selected.
Differential Revision: https://reviews.llvm.org/D101803
Alina Sbirlea [Tue, 4 May 2021 19:40:49 +0000 (12:40 -0700)]
Add cal entry for MemorySSA syncs.
Xun Li [Tue, 4 May 2021 18:11:43 +0000 (11:11 -0700)]
[Coroutines] Do not add alloca to the frame if the size is 0
This patch is to address https://bugs.llvm.org/show_bug.cgi?id=49916.
When the size of an alloca is 0, it will trigger an assertion in OptimizedStructLayout when being added to the frame.
Fix it by not adding it at all. We return index 0 (beginning of the frame) for all 0-sized allocas.
Differential Revision: https://reviews.llvm.org/D101841
Adrian Prantl [Tue, 4 May 2021 19:52:52 +0000 (12:52 -0700)]
Mark Basic/TargetCXXABI.def as textual in the module map.
Martin Storsjö [Mon, 12 Apr 2021 11:13:32 +0000 (14:13 +0300)]
[llvm-readobj] [ARMWinEH] Try to resolve label symbols into regular ones
Unwind info generated by MSVC tends to have relocations pointing at
static "label" symbols like "$LN4" instead of regular ones based on
the actual function's name. Try to resolve such symbols to a non-label
symbol if possible (ideally to an external symbol), to improve
the readability.
Differential Revision: https://reviews.llvm.org/D101567
Martin Storsjö [Fri, 30 Apr 2021 12:15:13 +0000 (15:15 +0300)]
[LLD] [COFF] Actually include the exported comdat symbols
This is a followup to
2b01a417d7ccb001ccc1185ef5fdc967c9fac8d7;
previously the RVAs of the exported symbols from comdats were left
zero.
Thanks to Kleis Auke Wolthuizen for the fix suggestion and pointing
out the omission.
Differential Revision: https://reviews.llvm.org/D101615
Martin Storsjö [Mon, 3 May 2021 19:14:00 +0000 (22:14 +0300)]
[libcxx] Update docs regarding the need for bash/posix tools for tests on Windows. NFC.
After
39bbfb77264a4a7a216921c2b70a30ba0f27eb56, bash is no longer
a hard requirement.
Differential Revision: https://reviews.llvm.org/D101779
Giorgis Georgakoudis [Sat, 1 May 2021 04:48:32 +0000 (21:48 -0700)]
[Utils] Run non-filecheck runlines in-order in update_cc_test_checks
The script update_cc_test_checks runs all non-filechecked runlines before the filechecked ones. This creates problems since outputs of those non-filechecked runlines may conflict and that will fail the execution of update_cc_test_checks. This patch executes non-filechecked in the order specified in the test file to avoid this issue.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D101683
Giorgis Georgakoudis [Mon, 3 May 2021 23:30:59 +0000 (16:30 -0700)]
[OpenMP] Fix non-determinism in clang task codegen (lastprivates)
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D101800
Leonard Chan [Tue, 4 May 2021 18:43:26 +0000 (11:43 -0700)]
Fix for test failure caused by
84c475437267e7fffedc40029ce274b099d8f8f3.
Reduces the number of targets/triples for this test since not all cmake
invocations will build for those targets.
Dan Liew [Sat, 1 May 2021 02:10:18 +0000 (19:10 -0700)]
[Driver] Fix `ToolChain::getCompilerRTPath()` to return the correct path on Apple platforms.
When the target triple was an Apple platform `ToolChain::getOSLibName()`
(called by `getCompilerRTPath()`) would return the full OS name
including the version number (e.g. `darwin20.3.0`). This is not correct
because the library directory for all Apple platforms is `darwin`.
This in turn caused
* `-print-runtime-dir` to return a non-existant path.
* `-print-file-name=<any compiler-rt library>` to return the filename
instead of the full path to the library.
Two regression tests are included.
rdar://
77417317
Differential Revision: https://reviews.llvm.org/D101682
Alina Sbirlea [Tue, 4 May 2021 18:23:12 +0000 (11:23 -0700)]
Add monthly MemorySSA sync.
Fangrui Song [Tue, 4 May 2021 18:05:11 +0000 (11:05 -0700)]
[llvm-objdump] Delete temporary Hexagon workaround options
Nathan James [Tue, 4 May 2021 18:04:11 +0000 (19:04 +0100)]
[Format] Don't sort includes if DisableFormat is true
Fixes https://llvm.org/PR35099.
I'm not sure if this decision was intentional but its definitely confusing for users.
Reviewed By: MyDeveloperDay, HazardyKnusperkeks, curdeius
Differential Revision: https://reviews.llvm.org/D101628
Fangrui Song [Tue, 4 May 2021 18:00:01 +0000 (11:00 -0700)]
[Hexagon][test] Migrate llvm-objdump --mv6[0567]t?/--mhvx to --mcpu=hexagonv*/--mattr=+hvx
Leonard Chan [Wed, 21 Apr 2021 22:09:12 +0000 (15:09 -0700)]
[clang] Add -fc++-abi= flag for specifying which C++ ABI to use
This implements the flag proposed in RFC
http://lists.llvm.org/pipermail/cfe-dev/2020-August/066437.html.
The goal is to add a way to override the default target C++ ABI through a
compiler flag. This makes it easier to test and transition between different
C++ ABIs through compile flags rather than build flags.
In this patch:
- Store -fc++-abi= in a LangOpt. This isn't stored in a CodeGenOpt because
there are instances outside of codegen where Clang needs to know what the
ABI is (particularly through ASTContext::createCXXABI), and we should be
able to override the target default if the flag is provided at that point.
- Expose the existing ABIs in TargetCXXABI as values that can be passed
through this flag.
- Create a .def file for these ABIs to make it easier to check flag values.
- Add an error for diagnosing bad ABI flag values.
Differential Revision: https://reviews.llvm.org/D85802
Matt Morehouse [Tue, 4 May 2021 17:50:29 +0000 (10:50 -0700)]
[libFuzzer] Disable non-exec-time test again.
It was previously disabled for the past 6+ months. I tried to re-enable
it after some deflaking, but it still fails occasionally.
Nikita Popov [Tue, 4 May 2021 17:11:37 +0000 (19:11 +0200)]
[SimplifyCFG] Create logical or in SimplifyCondBranchToCondBranch()
We need to use a logical or instead of a bitwise or to preserve
poison behavior. Poison from the second condition should not
propagate if the first condition is true.
We were already handling this correctly in FoldBranchToCommonDest(),
but not in this fold. (There are still other folds with this issue.)
Nikita Popov [Tue, 4 May 2021 17:15:05 +0000 (19:15 +0200)]
[SimplifyCFG] Regenerate test checks (NFC)
Regenerate the branch weight test using --check-globals.
Nikita Popov [Tue, 4 May 2021 17:06:46 +0000 (19:06 +0200)]
[SimplifyCFG] Extract helper for creating logical op (NFC)
Matt Morehouse [Tue, 4 May 2021 17:46:11 +0000 (10:46 -0700)]
[libFuzzer] Further deflake exec-time test.
Increase runs to 200,000 since we currently get a random failure about
once per day on the buildbot.
Fangrui Song [Tue, 4 May 2021 17:41:40 +0000 (10:41 -0700)]
[llvm-objdump] Delete temporary workaround option --riscv-no-aliases
Use the user-facing `-M no-aliases` instead.
Fangrui Song [Tue, 4 May 2021 17:38:33 +0000 (10:38 -0700)]
[RISCV][test] Migrate llvm-objdump --riscv-no-aliases to -M no-aliases
--riscv-no-aliases is an internal cl::opt option not intended to be exported.
Use the user-facing -M no-aliases instead.
Dávid Bolvanský [Tue, 4 May 2021 15:27:31 +0000 (17:27 +0200)]
[InstSimplify] Added tests for PR50173, NFC
Andrew Savonichev [Tue, 13 Apr 2021 13:28:32 +0000 (16:28 +0300)]
[Clang][AArch64] Disable rounding of return values for AArch64
If a return value is explicitly rounded to 64 bits, an additional zext
instruction is emitted, and in some cases it prevents tail call
optimization.
As discussed in D100225, this rounding is not necessary and can be
disabled.
Differential Revision: https://reviews.llvm.org/D100591
Arthur Eubanks [Tue, 4 May 2021 17:21:38 +0000 (10:21 -0700)]
[docs] Fix some wording
Nathan James [Tue, 4 May 2021 17:17:55 +0000 (18:17 +0100)]
[clang-tidy][NFC] Update tests and Default options to use boolean value
Change instances where options which are boolean are assigned the value 1|0 to use true|false instead.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D101721
Fangrui Song [Tue, 4 May 2021 17:17:36 +0000 (10:17 -0700)]
[llvm-objdump] Fix -a after D100433
-a is alias for --archive-headers, not --all-headers
Fraser Cormack [Tue, 4 May 2021 14:17:44 +0000 (15:17 +0100)]
[ValueTypes] Add MVTs for v256i16 and v256f16
This patch adds the two MVTs to fix a legalizer crash when using vector
shuffles of <256 x i16> and <128 x i16> on RISC-V. The legalizer can't
promote the operand of `v256i32 = any_extend_vector_inreg v128i16`.
Reviewed By: craig.topper, RKSimon
Differential Revision: https://reviews.llvm.org/D101769
Ahsan Saghir [Fri, 23 Apr 2021 13:26:45 +0000 (08:26 -0500)]
[PowerPC] Prevent argument promotion of types with size greater than 128 bits
This patch prevents argument promotion of types having
type size greater than 128 bits.
Fixes Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=49952
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D101188
Bjorn Pettersson [Tue, 4 May 2021 17:07:05 +0000 (19:07 +0200)]
Revert "Make dependency between certain analysis passes transitive"
This reverts commit
3655f0757f2b4b61419446b326410118658826ba.
It caused assertion failures related to setLastUser in polly builds.
Louis Dionne [Tue, 4 May 2021 17:06:51 +0000 (13:06 -0400)]
[libc++] NFC: Fix typo in Ranges Status
Wei Mi [Tue, 4 May 2021 05:55:53 +0000 (22:55 -0700)]
[SampleFDO] Fix a bug when appending function symbol into the Callees set of
Root node in ProfiledCallGraph.
In ProfiledCallGraph::addProfiledFunction, to add a function symbol into the
ProfiledCallGraph, currently an uninitialized ProfiledCallGraphNode node is
created by ProfiledFunctions[Name] and inserted into Callees set of Root node
before the node is initialized. The Callees set use
ProfiledCallGraphNodeComparer as its comparator so the uninitialized
ProfiledCallGraphNode may fail to be inserted into Callees set if it happens
to contain a name in memory which has been inserted into the Callees set
before. The problem will prevent some function symbols from being annotated
with profiles and cause performance regression. The patch fixes the problem.
Differential Revision: https://reviews.llvm.org/D101815
Fangrui Song [Tue, 4 May 2021 16:56:06 +0000 (09:56 -0700)]
[llvm-objdump] Improve newline consistency between different pieces of information
When dumping multiple pieces of information (e.g. --all-headers),
there is sometimes no separator between two pieces.
This patch uses the "\nheader:\n" style, which generally improves
compatibility with GNU objdump.
Note: objdump -t/-T does not add a newline before "SYMBOL TABLE:" and "DYNAMIC SYMBOL TABLE:".
We add a newline to be consistent with other information.
`objdump -d` prints two empty lines before the first 'Disassembly of section'.
We print just one with this patch.
Differential Revision: https://reviews.llvm.org/D101796
gbreynoo [Tue, 4 May 2021 16:42:20 +0000 (17:42 +0100)]
[llvm-objdump] Remove Generic Options group from help text output
Reapply 7368624 after revert and fix
Looking at other tools using tablegen for help output, general options
like --help are not separated from other options. This change removes
the "Generic Options" option group so the options are listed together.
the macho specific option group is left unaffected.
The test help.test was modified to reflect this change.
Differential Revision: https://reviews.llvm.org/D101652
Med Ismail Bennani [Fri, 30 Apr 2021 22:44:54 +0000 (22:44 +0000)]
[lldb/Core] Add SourceLocationSpec class (NFC)
A source location specifier class that holds a Declaration object containing
a FileSpec with line and column information. The column line is optional.
It also holds search flags that can be fetched by resolvers to look inlined
declarations and/or exact matches.
It describes a specific location in a source file and allows the user
to perform checks and comparaisons between multiple instances of that class.
Differential Revision: https://reviews.llvm.org/D100962
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Fri, 30 Apr 2021 03:35:59 +0000 (03:35 +0000)]
[lldb] Move and clean-up the Declaration class (NFC)
This patch moves the Declaration class from the Symbol library to the
Core library. This will allow to use it in a more generic fashion and
aims to lower the dependency cycles when it comes to the linking.
The patch also does some cleaning up by making column information
permanent and removing the LLDB_ENABLE_DECLARATION_COLUMNS directives.
Differential revision: https://reviews.llvm.org/D101556
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Med Ismail Bennani [Wed, 21 Apr 2021 05:37:43 +0000 (05:37 +0000)]
[lldb/Utility] Update path in FileSpec documentation (NFC)
Update FileSpec doxygen path to reflect its actual location in the
source-tree.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Dimitry Andric [Tue, 4 May 2021 16:28:31 +0000 (18:28 +0200)]
Revert "[llvm-objdump] Remove Generic Options group from help text output"
This reverts commit
73686247ac3e60c91fa5943c98956093df5e49ff, as there
were git stash conflict markers left unresolved.
Christudasan Devadasan [Fri, 30 Apr 2021 03:50:26 +0000 (09:20 +0530)]
DAG: Cleanup assertion in EmitFuncArgumentDbgValue
Removing an assertion introduced with D68945. The
patch was later reverted with
6531a78ac4b5, but failed
to remove this assertion. It causes a problem while
trying to split a 64-bit argument into sub registers.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D101594
Dimitry Andric [Tue, 4 May 2021 14:58:54 +0000 (16:58 +0200)]
Reland "[MC][ELF] Work around R_MIPS_LO16 relocation handling problem"
This fixes PR49821, and avoids "ld.lld: error: test.o:(.rodata.str1.1):
offset is outside the section" errors when linking MIPS objects with
negative R_MIPS_LO16 implicit addends.
ld.lld handles R_MIPS_HI16/R_MIPS_LO16 separately, not as a whole, so it
doesn't know that an R_MIPS_HI16 with implicit addend 1 and an
R_MIPS_LO16 with implicit addend -32768 represents 32768, which is in
range of a MergeInputSection. We could introduce a new RelExpr member
(like R_RISCV_PC_INDIRECT for R_RISCV_PCREL_HI20 / R_RISCV_PCREL_LO12)
but the complexity is unnecessary given that GNU as keeps the original
symbol for this case as well.
Adds a new test case for PR49821, and also updates two other test cases
that are affected by this change.
Reviewed By: atanasyan, MaskRay
Differential Revision: https://reviews.llvm.org/D101773
Jennifer Yu [Mon, 3 May 2021 18:19:59 +0000 (11:19 -0700)]
Fix assert on the variable which is used in omp clause is not marked
as used.
The problem only happens with constexpr variable, for constexpr variable,
variable is not marked during parser variable. This is because compiler
might find some var's associate expressions may not actully an odr-used
later, the variables get kept in MaybeODRUseExprs, in normal case, at
end of process fullExpr, the variable will be marked during the call to
CleanupVarDeclMarking(). Since we are processing expression of OpenMP
clauses, and the ActOnFinishFullExpr is not getting called that casue
variable is not get marked.
One way to fix this is to call CleanupVarDeclMarking() in EndOpenMPClause
for each omp directive.
This to fix https://bugs.llvm.org/show_bug.cgi?id=50206
Differential Revision: https://reviews.llvm.org/D101781
Fabian Meumertzheim [Tue, 4 May 2021 15:52:17 +0000 (08:52 -0700)]
[libFuzzer] Preserve position hint in auto dictionary
Currently, the position hint of an entry in the persistent auto
dictionary is fixed to 1. As a consequence, with a 50% chance, the entry
is applied right after the first byte of the input. As the position 1
does not appear to have any particular significance, this is likely a
bug that may have been caused by confusing the constructor parameter
with a success count.
This commit resolves the issue by preserving any existing position hint
or disabling the hint if the original entry didn't have one.
Reviewed By: morehouse
Differential Revision: https://reviews.llvm.org/D101686
Sanjay Patel [Tue, 4 May 2021 15:43:01 +0000 (11:43 -0400)]
[InstCombine] avoid infinite loops with select/icmp transforms
This fixes https://llvm.org/PR48900 , but as seen in the
regression tests prevents some optimizations.
There are a few options to restore those (switch to min/max
intrinsics, add larger pattern matching for select with
dominating condition, improve CVP), but we need to prevent
the bug 1st.
gbreynoo [Tue, 4 May 2021 15:48:03 +0000 (16:48 +0100)]
[llvm-objdump] Remove Generic Options group from help text output
Looking at other tools using tablegen for help output, general options
like --help are not separated from other options. This change removes
the "Generic Options" option group so the options are listed together.
the macho specific option group is left unaffected.
The test help.test was modified to reflect this change.
Differential Revision: https://reviews.llvm.org/D101652
Amy Kwan [Fri, 30 Apr 2021 15:52:50 +0000 (10:52 -0500)]
[PowerPC][NFC] Update atomic patterns to use the refactored load/store implementation
This patch updates the scalar atomic patterns to use the refactored load/store
implementation introduced in D93370.
All existing test cases pass with when the refactored patterns are utilized.
Differential Revision: https://reviews.llvm.org/D94498
William S. Moses [Tue, 4 May 2021 15:42:10 +0000 (11:42 -0400)]
[MLIR] Add not icmp canonicalization documentation
See: https://reviews.llvm.org/D101710
gbreynoo [Tue, 4 May 2021 15:40:30 +0000 (16:40 +0100)]
[llvm-objdump] Remove --cfg option from command guide
The llvm-objdump command guide has the option --cfg which was removed
from the tool by
888320e9fa5eb33194c066f68d50f1e73c5fff5e in 2014. This
change updates the command guide to reflect this.
Differential Revision: https://reviews.llvm.org/D101648
William S. Moses [Tue, 4 May 2021 03:40:44 +0000 (23:40 -0400)]
[MLIR][SCF] Assume uses of condition in the body of scf.while is true
Differential Revision: https://reviews.llvm.org/D101801
Florian Hahn [Tue, 4 May 2021 15:18:53 +0000 (16:18 +0100)]
[VPlan] Representing backedge def-use feeding reduction phis.
This patch updates the code handling reduction recipes to also keep
track of the incoming value from the latch in the recipe. This is needed
to model the def-use chains completely in VPlan, so that it is possible
to replace the incoming value with an arbitrary VPValue.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D99294
William S. Moses [Sun, 2 May 2021 04:16:41 +0000 (00:16 -0400)]
[MLIR] Replace a not of a comparison with appropriate comparison
Differential Revision: https://reviews.llvm.org/D101710
Zachary Henkel [Tue, 4 May 2021 15:19:54 +0000 (11:19 -0400)]
Rename a template parameter that conflicted with a common macro; NFC
The CALLBACK macro is used extensively in the Windows SDK.
Louis Dionne [Tue, 4 May 2021 15:10:04 +0000 (11:10 -0400)]
[libc++] Move the Debug iterators check to CI stage 3
It's not a default configuration, so it belongs to stage 3.
LLVM GN Syncbot [Tue, 4 May 2021 15:06:28 +0000 (15:06 +0000)]
[gn build] Port
2021d272ad6c