QingShan Zhang [Tue, 5 Jan 2021 03:22:45 +0000 (03:22 +0000)]
[NFC] Add the getSizeInBytes() interface for MachineConstantPoolValue
Current implementation assumes that, each MachineConstantPoolValue takes
up sizeof(MachineConstantPoolValue::Ty) bytes. For PowerPC, we want to
lump all the constants with the same type as one MachineConstantPoolValue
to save the cost that calculate the TOC entry for each const. So, we need
to extend the MachineConstantPoolValue that break this assumption.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D89108
Evandro Menezes [Thu, 31 Dec 2020 09:55:19 +0000 (03:55 -0600)]
[RISCV] Rename RVV intrinsics class (NFC)
Rename the class `RISCVUnaryAAMask` to `RISCVBinaryAAAMask`, since it has two input arguments.
Qiu Chaofan [Tue, 5 Jan 2021 02:21:31 +0000 (10:21 +0800)]
[UpdateTestChecks] Fix PowerPC RE to support AIX assembly
Current update_llc_test_checks.py cannot generate checks for AIX
(powerpc64-ibm-aix-xcoff) properly. Assembly generated is little bit
different from Linux. So I use begin function comment here to capture
function name.
Reviewed By: MaskRay, steven.zhang
Differential Revision: https://reviews.llvm.org/D93676
Juneyoung Lee [Tue, 5 Jan 2021 01:58:49 +0000 (10:58 +0900)]
[InstSimplify] gep with poison operand is poison
This is a tiny update to fold gep poison into poison. :)
Alive2 proofs:
https://alive2.llvm.org/ce/z/7Nwdri
https://alive2.llvm.org/ce/z/sDP4sC
Juneyoung Lee [Tue, 5 Jan 2021 02:03:11 +0000 (11:03 +0900)]
[InstSimplify] add a test for gep with poison operand (NFC)
Heejin Ahn [Thu, 3 Dec 2020 03:55:14 +0000 (19:55 -0800)]
[WebAssembly] Remove old SDT_WebAssemblyCalls (NFC)
These are not used anymore.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D94036
Arthur Eubanks [Mon, 4 Jan 2021 21:04:09 +0000 (13:04 -0800)]
[JumpThreading][NewPM] Skip when target has divergent CF
Matches the legacy pass.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D94028
Roman Lebedev [Mon, 4 Jan 2021 21:59:45 +0000 (00:59 +0300)]
[SimplifyCFG] SimplifyCondBranchToTwoReturns(): switch to non-permissive DomTree updates
... which requires not deleting an edge that just got deleted,
because we could be dealing with a block that didn't go through
ConstantFoldTerminator() yet, and thus has a degenerate cond br
with matching true/false destinations.
Roman Lebedev [Mon, 4 Jan 2021 21:06:38 +0000 (00:06 +0300)]
[SimplifyCFG] SimplifyEqualityComparisonWithOnlyPredecessor(): switch to non-permissive DomTree updates
... which requires not deleting an edge that just got deleted.
Roman Lebedev [Mon, 4 Jan 2021 20:13:07 +0000 (23:13 +0300)]
[SimplifyCFG] simplifyIndirectBr(): switch to non-permissive DomTree updates
... which requires not deleting an edge that just got deleted.
Roman Lebedev [Mon, 4 Jan 2021 18:38:03 +0000 (21:38 +0300)]
[SimplifyCFGPass] mergeEmptyReturnBlocks(): switch to non-permissive DomTree updates
... which requires not inserting an edge that already exists.
Roman Lebedev [Mon, 4 Jan 2021 13:59:45 +0000 (16:59 +0300)]
[NFCI] SimplifyCFG: switch to non-permissive DomTree updates, where possible
Notably, this doesn't switch *every* case, remaining cases
don't actually pass sanity checks in non-permissve mode,
and therefore require further analysis.
Note that SimplifyCFG still defaults to not preserving DomTree by default,
so this is effectively a NFC change.
Roman Lebedev [Mon, 4 Jan 2021 13:42:13 +0000 (16:42 +0300)]
[NFCI] DwarfEHPrepare: update DomTree in non-permissive mode, when present
Being stricter will catch issues that would be just papered over
in permissive mode, and is likely faster.
Petr Hosek [Mon, 4 Jan 2021 22:24:46 +0000 (14:24 -0800)]
[clang] - Also look for devtoolset-10
devtoolset-10 has just been released so look for it as well.
Patch By: stephan.dollberg
Differential Revision: https://reviews.llvm.org/D92792
Thorsten Schütt [Mon, 4 Jan 2021 22:17:45 +0000 (23:17 +0100)]
Revert "[NFC, Refactor] Modernize StorageClass from Specifiers.h to a scoped enum (II)"
This reverts commit
efc82c4ad2bcb256a4f4c20238d08cd3afba4d2d.
Sanjay Patel [Mon, 4 Jan 2021 21:51:36 +0000 (16:51 -0500)]
[LoopUtils] remove redundant opcode parameter; NFC
While here, rename the inaccurate getRecurrenceBinOp()
because that was also used to get CmpInst opcodes.
The recurrence/reduction kind should always refer to the
expected opcode for a reduction. SLP appears to be the
only direct caller of createSimpleTargetReduction(), and
that calling code ideally should not be carrying around
both an opcode and a reduction kind.
This should allow us to generalize reduction matching to
use intrinsics instead of only binops.
Thorsten Schütt [Wed, 23 Dec 2020 15:56:00 +0000 (16:56 +0100)]
[NFC, Refactor] Modernize StorageClass from Specifiers.h to a scoped enum (II)
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D93765
Juneyoung Lee [Mon, 4 Jan 2021 21:49:19 +0000 (06:49 +0900)]
[ValueTracking] isGuaranteedNotToBePoison should return true on undef
This is a one-line fix to isGuaranteedNotToBePoison to return true if
undef is given.
Arthur Eubanks [Mon, 4 Jan 2021 21:47:07 +0000 (13:47 -0800)]
[NewPM][AMDGPU] Pass TargetMachine to AMDGPUSimplifyLibCallsPass
Missed in https://reviews.llvm.org/D93863.
Arthur Eubanks [Mon, 4 Jan 2021 21:08:32 +0000 (13:08 -0800)]
[test] Pin backedge-id-bug-xfail.ll to legacy PM
The new PM doesn't have region passes, so this doesn't really make sense in a NPM context.
Sanjay Patel [Mon, 4 Jan 2021 20:24:36 +0000 (15:24 -0500)]
[LoopUtils] reduce code for creatng reduction; NFC
We can return from each case instead creating a temporary
variable just to have a common return.
Sanjay Patel [Mon, 4 Jan 2021 20:10:03 +0000 (15:10 -0500)]
[LoopUtils] reorder logic for creating reduction; NFC
If we are using a shuffle reduction, we don't need to
go through the switch on opcode - return early.
Cameron McInally [Mon, 4 Jan 2021 20:13:14 +0000 (14:13 -0600)]
[FPEnv][AMDGPU] Disable FSUB(-0,X)->FNEG(X) DAGCombine when subnormals are flushed
This patch disables the FSUB(-0,X)->FNEG(X) DAG combine when we're flushing subnormals. It requires updating the existing AMDGPU tests to use the fneg IR instruction, in place of the old fsub(-0,X) canonical form, since AMDGPU is the only backend currently checking the DenormalMode flags.
Note that this will require follow-up optimizations to make sure the FSUB(-0,X) form is handled appropriately
Differential Revision: https://reviews.llvm.org/D93243
Whitney Tsang [Mon, 4 Jan 2021 20:41:53 +0000 (20:41 +0000)]
Revert "[LoopNest] Allow empty basic blocks without loops"
This reverts commit
9a17bff4f715a9f3ec89f4eacae8fdea1b74fe79.
Arthur Eubanks [Tue, 29 Dec 2020 20:30:25 +0000 (12:30 -0800)]
[NewPM][AMDGPU] Make amdgpu-aa work with NewPM
An AMDGPUAA class already existed that was supposed to work with the new
PM, but it wasn't tested and was a bit broken.
Fix up the existing classes to have the right keys/parameters.
Wire up AMDGPUAA inside AMDGPUTargetMachine.
Add it to the list of alias analyses for the "default" AAManager since
in adjustPassManager() amdgpu-aa is added into the pipeline at the
beginning.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D93914
Arthur Eubanks [Sun, 3 Jan 2021 05:55:55 +0000 (21:55 -0800)]
[NewPM][AMDGPU] Port amdgpu-always-inline
And add to AMDGPU opt pipeline.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D94025
Arthur Eubanks [Sun, 3 Jan 2021 06:05:23 +0000 (22:05 -0800)]
[NewPM][AMDGPU] Port amdgpu-printf-runtime-binding
And add to AMDGPU opt pipeline.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D94026
Craig Topper [Mon, 4 Jan 2021 20:20:18 +0000 (12:20 -0800)]
[RISCV] Remove unused method RISCVInstPrinter::printSImm5Plus1. NFC
simm5_plus1 is only used by InstAliases so should never be printed.
Valentin Clement [Mon, 4 Jan 2021 20:18:46 +0000 (15:18 -0500)]
[flang][openmp] Make Reduction clause part of OmpClause
After discussion in D93105 we found that the reduction clause was not following
the common OmpClause convention. This patch makes reduction clause part of OmpClause
with a value of OmpReductionClause in a similar way than task_reduction.
The unparse function for OmpReductionClause is adapted since the keyword and parenthesis
are issued by the corresponding unparse function for parser::OmpClause::Reduction.
Reviewed By: sameeranjoshi
Differential Revision: https://reviews.llvm.org/D93482
Hongtao Yu [Mon, 4 Jan 2021 18:15:59 +0000 (10:15 -0800)]
Switching Clang UniqueInternalLinkageNamesPass scheduling to using the LLVM one with newpm.
As a follow-up to D93656, I'm switching the Clang UniqueInternalLinkageNamesPass scheduling to using the LLVM one with newpm.
Test Plan:
Reviewed By: aeubanks, tmsriram
Differential Revision: https://reviews.llvm.org/D94019
Whitney Tsang [Mon, 4 Jan 2021 19:57:44 +0000 (19:57 +0000)]
[LoopNest] Allow empty basic blocks without loops
Allow loop nests with empty basic blocks without loops in different
levels as perfect.
Reviewers: Meinersbur
Differential Revision: https://reviews.llvm.org/D93665
Arthur Eubanks [Sun, 3 Jan 2021 06:05:23 +0000 (22:05 -0800)]
[NewPM][AMDGPU] Port amdgpu-unify-metadata
And add to AMDGPU opt pipeline.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D94023
Arthur Eubanks [Tue, 29 Dec 2020 18:25:26 +0000 (10:25 -0800)]
[NewPM][AMDGPU] Port amdgpu-propagate-attributes-early/late
And add to AMDGPU opt pipeline.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D94022
Kazu Hirata [Mon, 4 Jan 2021 19:42:47 +0000 (11:42 -0800)]
[llvm] Use llvm::any_of (NFC)
Kazu Hirata [Mon, 4 Jan 2021 19:42:45 +0000 (11:42 -0800)]
[DebugInfo] Use llvm::append_range (NFC)
Kazu Hirata [Mon, 4 Jan 2021 19:42:43 +0000 (11:42 -0800)]
[llvm] Construct SmallVector with iterator ranges (NFC)
Arthur Eubanks [Tue, 29 Dec 2020 04:32:58 +0000 (20:32 -0800)]
[NewPM][AMDGPU] Run InternalizePass when -amdgpu-internalize-symbols
The legacy PM doesn't run EP_ModuleOptimizerEarly on -O0, so skip
running it here when given O0.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D93886
Craig Topper [Mon, 4 Jan 2021 18:23:40 +0000 (10:23 -0800)]
[RISCV] Replace i32 with XLenVT in (add AddrFI, simm12) isel patterns.
With the i32 these patterns will only fire on RV32, but they
don't look RV32 specific.
Reviewed By: lenary
Differential Revision: https://reviews.llvm.org/D93843
Sanjay Patel [Mon, 4 Jan 2021 15:57:48 +0000 (10:57 -0500)]
[InstCombine] add tests for ashr+icmp; NFC
Matt Arsenault [Tue, 22 Dec 2020 22:45:34 +0000 (17:45 -0500)]
CodeGen: Use Register
Philip Reames [Mon, 4 Jan 2021 17:50:47 +0000 (09:50 -0800)]
Revert "[LoopDeletion] Break backedge of loops when known not taken"
This reverts commit
dd6bb367d19e3bf18353e40de54d35480999a930.
Multi-stage builders are showing an assertion failure w/LCSSA not being preserved on entry to IndVars. Reason isn't clear, reverting while investigating.
Philip Reames [Mon, 4 Jan 2021 17:19:29 +0000 (09:19 -0800)]
[LoopDeletion] Break backedge of loops when known not taken
The basic idea is that if SCEV can prove the backedge isn't taken, we can go ahead and get rid of the backedge (and thus the loop) while leaving the rest of the control in place. This nicely handles cases with dispatch between multiple exits and internal side effects.
Differential Revision: https://reviews.llvm.org/D93906
Joseph Huber [Fri, 18 Dec 2020 20:14:44 +0000 (15:14 -0500)]
[OpenMP] Add using bit flags to select Libomptarget Information
Summary:
This patch adds more fine-grained support over which information is output from the libomptarget runtime when run with the environment variable LIBOMPTARGET_INFO set. An extensible set of flags can be used to pick and choose which information the user is interested in.
Reviewers: jdoerfert JonChesterfield grokos
Differential Revision: https://reviews.llvm.org/D93727
Simon Pilgrim [Mon, 4 Jan 2021 16:39:07 +0000 (16:39 +0000)]
[ProfileData] GCOVFile::readGCNO - silence undefined pointer warning. NFCI.
Silence clang static analyzer warning that 'fn' could still be in an undefined state - this shouldn't happen depending on the likely tag order, but the analyzer can't know that.
Jon Chesterfield [Mon, 4 Jan 2021 16:48:46 +0000 (16:48 +0000)]
[libomptarget][amdgpu] Call into deviceRTL instead of ockl
[libomptarget][amdgpu] Call into deviceRTL instead of ockl
Amdgpu codegen presently emits a call into ockl. The same functionality
is already present in the deviceRTL. Adds an amdgpu specific entry point
to avoid the dependency. This lets simple openmp code (specifically, that
which doesn't use libm) run without rocm device libraries installed.
Reviewed By: ronlieb
Differential Revision: https://reviews.llvm.org/D93356
Krzysztof Parzyszek [Mon, 4 Jan 2021 16:34:17 +0000 (10:34 -0600)]
[Hexagon] Fix bad SDNodeXForm
Fixes https://llvm.org/PR48651
Florian Hahn [Mon, 4 Jan 2021 16:26:58 +0000 (16:26 +0000)]
[SimplifyCFG] Enabled hoisting late in LTO pipeline.
bb7d3af1139c disabled hoisting in SimplifyCFG by default, but enabled it
late in the pipeline. But it appears as if the LTO pipelines got missed.
This patch adjusts the LTO pipelines to also enable hoisting in the
later stages.
Unfortunately there's no easy way to add a test for the change I think.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D93684
Michael Munday [Mon, 4 Jan 2021 16:00:38 +0000 (16:00 +0000)]
[RISCV][NFC] Add additional cmov tests
One or more cmov instructions could be generated for these functions
when the Zbt extension is present.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D93768
Florian Hahn [Mon, 4 Jan 2021 15:49:47 +0000 (15:49 +0000)]
[InterleavedAccess] Return correct 'modified' status.
Both tryReplaceExtracts and replaceBinOpShuffles may modify the IR, even
if no interleaved loads are generated, but currently the pass pretends
no changes were made.
This patch updates the pass to return true if either of the functions
made any changes. In case of tryReplaceExtracts, changes are made if
there are any Extracts and true is returned.
`replaceBinOpShuffles` always makes changes if BinOpShuffles is not empty.
It also always returned true, so I went ahead and change it to just
`replaceBinOpShuffles`.
Fixes PR48208.
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D93997
Simon Pilgrim [Mon, 4 Jan 2021 15:30:15 +0000 (15:30 +0000)]
[IR] CallBase::getBundleOpInfoForOperand - ensure Current iterator is defined. NFCI.
Fix clang static analyzer undefined pointer warning in the case Begin == End.
Simon Pilgrim [Mon, 4 Jan 2021 15:12:55 +0000 (15:12 +0000)]
DeclCXX - Fix getAs<> null-dereference static analyzer warnings. NFCI.
getAs<> can return null if the cast is invalid, which can lead to null pointer deferences. Use castAs<> instead which will assert that the cast is valid.
Hansang Bae [Fri, 18 Dec 2020 00:43:36 +0000 (18:43 -0600)]
[OpenMP] Add definition/interface for target memory routines
The change includes new routines introduced in 5.1 and Fortran
interface.
Differential Revision: https://reviews.llvm.org/D93505
Simon Pilgrim [Mon, 4 Jan 2021 14:08:09 +0000 (14:08 +0000)]
[Sparc] SparcMCExpr::printVariantKind - fix Wcovered-switch-default gcc warning. NFCI.
Caroline Concatto [Thu, 17 Dec 2020 16:15:28 +0000 (16:15 +0000)]
[AArch64][SVE]Add cost model for masked gather and scatter for scalable vector.
A new TTI interface has been added 'Optional <unsigned>getMaxVScale' that
returns the maximum vscale for a given target.
When known getMaxVScale is used to compute the cost of masked gather scatter
for scalable vector.
Depends on D92094
Differential Revision: https://reviews.llvm.org/D93030
Florian Hahn [Mon, 4 Jan 2021 13:28:44 +0000 (13:28 +0000)]
[AArch64] Add patterns for FMCLA*_indexed.
This patch adds patterns for the indexed variants of FCMLA. Mostly based
on a patch by Tim Northover.
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D92947
Simon Pilgrim [Mon, 4 Jan 2021 12:18:59 +0000 (12:18 +0000)]
[Support] Add KnownBits::icmp helpers.
Check if all possible values for a pair of knownbits give the same icmp result - these are based off the checks performed in InstCombineCompares.cpp and D86578.
Add exhaustive unit test coverage - a followup will update InstCombineCompares.cpp to use this.
David Green [Mon, 4 Jan 2021 12:44:43 +0000 (12:44 +0000)]
[ARM] Extend lowering for i64 reductions
The lowering of a <4 x i16> or <4 x i8> vecreduce.add into an i64 would
previously be expanded, due to the i64 not being legal. This patch
adjusts our reduction matchers, making it produce a VADDLV(sext A to
v4i32) instead.
Differential Revision: https://reviews.llvm.org/D93622
LemonBoy [Mon, 4 Jan 2021 08:41:58 +0000 (09:41 +0100)]
[Sparc] Fixes for the internal assembler
* Prevent the generation of invalid shift instructions by constraining
the immediate field. I've limited the shift field to constant values
only, adding the `R_SPARC_5`/`R_SPARC_6` relocations is trivial if
needed (but I can't really think of a use case for those).
* Fix the generation of PC-relative `call`
* Fix the transformation of `jmp sym` into `jmpl`
* Emit fixups for simm13 operands
I moved the choice of the correct relocation into the code emitter as I've
seen the other backends do, it can be definitely cleaner but the aim was
to reduce the scope of the patch as much as possible.
Fixes the problems raised by joerg in L254199
Reviewed By: dcederman
Differential Revision: https://reviews.llvm.org/D78193
Chih-Ping Chen [Fri, 18 Dec 2020 21:12:57 +0000 (16:12 -0500)]
[docs] Release notes for IsDecl in DIModule.
Please see https://reviews.llvm.org/D93462 for the actual code change.
Differential Revision: https://reviews.llvm.org/D93558
David Green [Mon, 4 Jan 2021 11:29:18 +0000 (11:29 +0000)]
[AArch64] Attempt to fix Mac tests with a more specific triple. NFC
Kazushi (Jam) Marukawa [Sun, 27 Dec 2020 14:28:20 +0000 (23:28 +0900)]
[VE] Change default CPU name to "generic"
Change default CPU name of SX-Aurora VE from "ve" to "generic" similar
to other architectures.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D93836
Usman Nadeem [Mon, 4 Jan 2021 10:58:43 +0000 (10:58 +0000)]
[AARCH64] Improve accumulator forwarding for Cortex-A57 model
The old CPU model only had MLA->MLA forwarding. I added some missing
MUL->MLA read advances and a missing absolute diff accumulator read
advance according to the Cortex A57 Software Optimization Guide.
The patch improves performance in EEMBC rgbyiqv2 by about 6%-7% and
spec2006/milc by 8% (repeated runs on multiple devices), causes no
significant regressions (none in SPEC).
Differential Revision: https://reviews.llvm.org/D92296
Florian Hahn [Mon, 4 Jan 2021 09:51:20 +0000 (09:51 +0000)]
[ArgPromotion] Delay dead GEP removal until doPromotion.
Currently ArgPromotion removes dead GEPs as part of the legality check
in isSafeToPromoteArgument. If no promotion happens, this means the pass
claims no modifications happened, even though GEPs were removed.
This patch fixes the issue by delaying removal of dead GEPs until
doPromotion: isSafeToPromoteArgument can simply skips dead GEPs and
the code in doPromotion dealing with GEPs is updated to account for
dead GEPs. Once we committed to promotion, it should be safe to
remove dead GEPs.
Alternatively isSafeToPromoteArgument could return an additional boolean
to indicate whether it made changes, but this is quite cumbersome and
there should be no real benefit of weeding out some dead GEPs here if we
do not perform promotion.
I added a test for the case where dead GEPs need to be removed when
promotion happens in
578c5a0c6e71.
Fixes PR47477.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D93991
Yang Fan [Mon, 4 Jan 2021 09:21:19 +0000 (17:21 +0800)]
Revert "[Sema] Fix deleted function problem in implicitly movable test"
This reverts commit
89b0972a
Kazushi (Jam) Marukawa [Mon, 28 Dec 2020 02:17:16 +0000 (11:17 +0900)]
[VE] Remove VA.needsCustom checks
Remove VA.needsCustom checks which are copied from Sparc implementation
at the very beginning of VE implementation. Add assert to sanity-check
VA.needsCustom flag, also.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D93847
David Sherwood [Fri, 18 Dec 2020 13:06:16 +0000 (13:06 +0000)]
[SVE] Fix inline assembly parsing crash
This patch fixes a crash encountered when compiling this code:
...
float16_t a;
__asm__("fminv %h[a], %[b], %[c].h"
: [a] "=r" (a)
: [b] "Upl" (b), [c] "w" (c))
The issue here is when using the 'h' modifier for a register
constraint 'r'.
Differential Revision: https://reviews.llvm.org/D93537
Craig Topper [Mon, 4 Jan 2021 08:14:35 +0000 (00:14 -0800)]
[RISCV] Remove unused method isUImm5NonZero() from RISCVAsmParser.cpp. NFC
The operand predicate that used this has been gone for a while.
AnZhong Huang [Mon, 4 Jan 2021 08:00:19 +0000 (11:00 +0300)]
[benchmark] Fixed a build error when using CMake 3.15.1 + NDK-R20
std::decay_t used by llvm/utils/benchmark/include/benchmark/benchmark.h is a c++14 feature, but the CMakelist uses c++11, it's the root-cause of build error.
There are two options to fix the error.
1) change the CMakelist to support c++14.
2) change std::decay_t to std::decay, it's what the patch done.
This bug can only be reproduced by CMake 3.15, we didn't observer the bug with CMake 3.16. But based on the code's logic, it's an obvious bug of LLVM.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D93794
Kai Luo [Tue, 29 Dec 2020 13:23:17 +0000 (13:23 +0000)]
[PowerPC] Do not fold `cmp(d|w)` and `subf` instruction to `subf.` if `nsw` is not present
In `PPCInstrInfo::optimizeCompareInstr` we seek opportunities to fold `cmp(d|w)` and `subf` as an `subf.`. However, if `subf.` gets overflow, `cr0` can't reflect the correct order, violating the semantics of `cmp(d|w)`.
Fixed https://bugs.llvm.org/show_bug.cgi?id=47830.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D90156
Andrew Litteken [Mon, 4 Jan 2021 05:44:20 +0000 (23:44 -0600)]
[IROutliner] Refactoring errors in the cost model from past patches.
There were was the reuse of a variable that should not have been
occurred due to confusion during committing patches.
Andrew Litteken [Mon, 4 Jan 2021 04:51:15 +0000 (22:51 -0600)]
[IROutliner] Removing a duplicate addition, causing overestimates in IROutliner.
There was an extra addition left over from a previous commit for the
cost model, this removes it.
sameeran joshi [Mon, 4 Jan 2021 03:17:02 +0000 (08:47 +0530)]
[Flang][openmp][5.0] Add task_reduction clause.
See OMP-5.0 2.19.5.5 task_reduction Clause.
To add a positive test case we need `taskgroup` directive which is not added hence skipping the test.
This is a dependency for `taskgroup` construct.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D93105
Co-authored-by: Valentin Clement <clementval@gmail.com>
Jan Kratochvil [Mon, 4 Jan 2021 02:21:04 +0000 (03:21 +0100)]
[compiler-rt] [Sanitizers] Extend ThreadDescriptorSize() for glibc-2.32-2.fc33.x86_64+i686
before:
$ echo 'int main(){}'|clang -g -fsanitize=leak -x c++ -;./a.out
Tracer caught signal 11: addr=0x7f4f73da5f40 pc=0x4222c8 sp=0x7f4f72cffd40
==1164171==LeakSanitizer has encountered a fatal error.
==1164171==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==1164171==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
$ _
after:
$ echo 'int main(){}'|clang -g -fsanitize=leak -x c++ -;./a.out)
$ _
I haven't verified the size cannot be affected by Fedora patches of
upstream glibc-2.32 - but I do not expect upstream glibc-2.32 would have
the last sizes `(1216, 2304)` from 2013 around glibc-2.12.
Differential Revision: https://reviews.llvm.org/D93386
Nathan James [Mon, 4 Jan 2021 00:39:33 +0000 (00:39 +0000)]
[clang-tidy] Fix windows tests
Attempt to fix the 2 failing tests identifier in 48646.
Appears that python3 doesn't like nested double quotes in single quoted strings, hopefully nested single quotes in double quoted strings is a-ok.
Reviewed By: thakis
Differential Revision: https://reviews.llvm.org/D93979
Roman Lebedev [Sun, 3 Jan 2021 18:53:11 +0000 (21:53 +0300)]
[NFC][SimplifyCFG] Hoist 'original' DomTree verification from simplifyOnce() into run()
This is NFC since SimplifyCFG still currently defaults to not preserving DomTree.
SimplifyCFGOpt::simplifyOnce() is only be called from SimplifyCFGOpt::run(),
and can not be called externally, since SimplifyCFGOpt is defined in .cpp
This avoids some needless verifications, and is thus a bit faster
without sacrificing precision.
Roman Lebedev [Sun, 3 Jan 2021 18:17:11 +0000 (21:17 +0300)]
[SimplifyCFG] SimplifyTerminatorOnSelect(): fix/tune DomTree updates
We only need to remove non-TrueBB/non-FalseBB successors,
and we only need to do that once. We don't need to insert
any new edges, because no new successors will be added.
Roman Lebedev [Sun, 3 Jan 2021 18:14:41 +0000 (21:14 +0300)]
[NFC][SimplifyCFG] SimplifyTerminatorOnSelect(): pull out OldTerm->getParent() into a variable
Roman Lebedev [Sun, 3 Jan 2021 17:29:24 +0000 (20:29 +0300)]
[NFC][SimplifyCFG] Add a test where we fail to preserve DomTree validity
Nikita Popov [Sun, 3 Jan 2021 21:03:53 +0000 (22:03 +0100)]
[InstSimplify] Fold nnan/ninf violation to poison
As the comment already indicates, performing an operation with
nnan/ninf flags on a nan/inf or undef results in poison. Now that
we have a proper poison value, we no longer need to relax it to
undef.
Florian Hahn [Sun, 3 Jan 2021 20:27:17 +0000 (20:27 +0000)]
[LoopUnswitch] Precommit initial partial unswitching test cases.
Nikita Popov [Sun, 3 Jan 2021 17:19:37 +0000 (18:19 +0100)]
[InstSimplify] Fold division by zero to poison
Div/rem by zero is immediate undefined behavior and anything goes.
Currently we fold it to undef, this patch changes it to fold to
poison instead, which is slightly stronger.
Differential Revision: https://reviews.llvm.org/D93995
Kazu Hirata [Sun, 3 Jan 2021 17:57:47 +0000 (09:57 -0800)]
[llvm] Call *(Set|Map)::erase directly (NFC)
We can erase an item in a set or map without checking its membership
first.
Kazu Hirata [Sun, 3 Jan 2021 17:57:45 +0000 (09:57 -0800)]
[Target] Construct SmallVector with iterator ranges (NFC)
Kazu Hirata [Sun, 3 Jan 2021 17:57:43 +0000 (09:57 -0800)]
[Target] Use llvm::append_range (NFC)
Nikita Popov [Sun, 3 Jan 2021 17:51:49 +0000 (18:51 +0100)]
[InstSimplify] Fix addo/subo with undef (PR43188)
We can't fold the first result to undef, because not all values
may be reachable under the constraint that no overflow occurred.
Use the same folds we do for saturated math instead.
Proofs:
uaddo: https://alive2.llvm.org/ce/z/zf55N_
saddo: https://alive2.llvm.org/ce/z/a_xPgS
usubo: https://alive2.llvm.org/ce/z/DmRqwt
ssubo: https://alive2.llvm.org/ce/z/8ag7U-
Nikita Popov [Sun, 3 Jan 2021 17:05:33 +0000 (18:05 +0100)]
[InstSimplify] Return poison for out of bounds extractelement
This is the same change as D93990, but for extractelement rather
than insertelement.
> If idx exceeds the length of val for a fixed-length vector, the
> result is a poison value. For a scalable vector, if the value of
> idx exceeds the runtime length of the vector, the result is a
> poison value.
Juneyoung Lee [Sun, 3 Jan 2021 16:09:48 +0000 (01:09 +0900)]
[X86] Make deinterleave8bitStride3 use unary CreateShuffleVector
This patch makes X86InterleavedAccessGroup::deinterleave8bitStride3 use the unary CreateShuffleVector.
This is a continuation of D93923. There were a few missing replacements.
IIUC, this patch does not cause change in the generated programs' semantics because the
function inserts shufflevectors that only choose elements from the first vector.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D93993
Nikita Popov [Sun, 3 Jan 2021 17:09:58 +0000 (18:09 +0100)]
[InstSimplify] Regenerate test checks (NFC)
Juneyoung Lee [Sun, 3 Jan 2021 15:05:08 +0000 (00:05 +0900)]
[InstSimplify] Return poison if insertelement touches out of bounds
This is a simple patch that updates InstSimplify to return poison if the index is/can be out-of-bounds
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D93990
Florian Hahn [Sun, 3 Jan 2021 15:22:46 +0000 (15:22 +0000)]
[ArgPromotion] Add test with dead GEP when promoting.
This adds test coverage for the case where we do argument promotion and
there's a dead GEP that should be removed/ignored.
Juneyoung Lee [Sun, 3 Jan 2021 14:08:01 +0000 (23:08 +0900)]
[Scalarizer] Use poison as insertelement's placeholder
This patch makes Scalarizer to use poison as insertelement's placeholder.
It contains two changes in Scalarizer.cpp, and the both changes does not change the semantics of the optimized program.
It is because the placeholder value (poison) is already completely hidden by following insertelement instructions.
The first change at visitBitCastInst() creates poison vector of MidTy and consecutively inserts FanIn times,
which is # of elems of MidTy.
The second change at ScalarizerVisitor::finish() creates poison with Op->getType(), and it is filled with
Count insertelements.
The test diffs show that the poison value is never exposed after insertelements.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D93989
Juneyoung Lee [Sun, 3 Jan 2021 13:40:04 +0000 (22:40 +0900)]
Update *-inseltpoison.ll tests at Transforms/InstCombine/X86 by replacing undef with poison (NFC)
Gil Rapaport [Wed, 30 Dec 2020 21:11:20 +0000 (23:11 +0200)]
[SCEV] Simplify trunc to zero based on known bits
Let getTruncateExpr() short-circuit to zero when the value being truncated is
known to have at least as many trailing zeros as the target type.
Differential Revision: https://reviews.llvm.org/D93973
Alexey Lapshin [Wed, 16 Dec 2020 13:34:12 +0000 (16:34 +0300)]
[dsymutil][DWARFLinker][NFC] Refactor usages of UniquingStringPool.
That refactoring is helpful since it reduces data inter-dependencies.
Which is good for current implementation and even more good for
fully multi-thread implementation. The idea of the refactoring
is to delete UniquingStringPool from the global DWARFLinker level.
It is used to unique type names while ODR deduplication is done.
Thus we move UniquingStringPool into the DeclContextTree which
matched to UniquingStringPool usage scope.
golden-dsymutil/dsymutil
23787992
clang MD5:
7d9873ff94f0246b6ab1ec3e8d0f3f06
build-Release/bin/dsymutil
23921272
clang MD5:
7d9873ff94f0246b6ab1ec3e8d0f3f06
Differential Revision: https://reviews.llvm.org/D93460
Nico Weber [Sat, 2 Jan 2021 23:54:37 +0000 (18:54 -0500)]
Revert "[sanitizer] Define SANITIZER_GLIBC to refine SANITIZER_LINUX feature detection and support musl"
...and follow-ups. It still doesn't build on Android, see https://reviews.llvm.org/D93848#2476310
This reverts commit
a92d01534f1c4fb79210975573e774d0393f2533.
This reverts commit
52d7e183bf25ea38e1149e39e19d21e6212e701f.
This reverts commit
34489da81b39972b40d2ff5581fe48911339406e.
Lang Hames [Thu, 31 Dec 2020 03:20:53 +0000 (14:20 +1100)]
[RuntimeDyld] Fix dangling reference in RuntimeDyldELF.
Patch by Moritz Sichert. Thanks Moritz!
Differential Revision: https://reviews.llvm.org/D89373
LLVM GN Syncbot [Sat, 2 Jan 2021 22:46:43 +0000 (22:46 +0000)]
[gn build] Port
5799fc79c3f
Roman Lebedev [Sat, 2 Jan 2021 22:26:42 +0000 (01:26 +0300)]
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): fine-tune/fix DomTree preservation, take 2
Roman Lebedev [Sat, 2 Jan 2021 21:45:53 +0000 (00:45 +0300)]
[NFC][SimplifyCFG] Add another test for switch creation where we fail to maintain DomTree
Roman Lebedev [Sat, 2 Jan 2021 18:27:19 +0000 (21:27 +0300)]
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): fine-tune/fix DomTree preservation