Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW48) #2813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 568 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
568 commits
Select commit Hold shift + click to select a range
096bd9b
[sanitizer] Fix typo in log messages
shpark Nov 18, 2020
680931a
[Matrix] Adjust matrix pointer type for inline asm arguments.
fhahn Nov 18, 2020
4dbe12e
[SLP] Use the minimum alignment of the load bundle when forming a mas…
d0k Nov 18, 2020
8cdc538
Add sysroot/lib to library search path of baremetal toolchain.
abidh Nov 18, 2020
bcaa198
Remove unportable test
steveire Nov 18, 2020
871fe71
Fix typo for hasAnyOverloadedOperatorName; NFC
keishi Nov 18, 2020
da2e472
[ARM][LowOverheadLoops] Merge VCMP and VPST across VPT blocks
SamTebbs33 Nov 6, 2020
ccd9091
[lldb][NFC] Don't let Process inherit from UserID
Teemperor Nov 18, 2020
45b8e37
[SystemZ] Use ISD::ABS opcode during isel.
JonPsson Nov 18, 2020
aad3ea8
[clangd] Remove the trailing "." in add-using message.
hokein Nov 18, 2020
a8a79c9
[ConstraintElimination] Refactor constraint extraction (NFC).
fhahn Nov 17, 2020
9f69c1b
[AMDGPU] Rename pseudo S_WAITCNT_IDLE to S_WAIT_IDLE. NFC.
jayfoad Nov 18, 2020
f45c052
Fix unused variables in release build
metaflow Nov 18, 2020
8270f8c
[X86] Add broadcast merge test case for PR48215
RKSimon Nov 18, 2020
bd4662c
[AST] Enhance the const expression evaluator to support error-depende…
hokein Nov 18, 2020
1a34281
[NFC][Reassociate] Add patterns where `or` is part of load reduction …
LebedevRI Nov 18, 2020
34ff90a
[Reassociate] Don't convert add-like-or's into add's if they appear t…
LebedevRI Nov 18, 2020
7ecf196
[AMDGPU] Fix and extend vccz workarounds
jayfoad Nov 17, 2020
ad0e764
[libc][obvious] Fix fdim[f|l] signatures in stdc spec.
Nov 18, 2020
5ba324c
[OPENMP]Fix PR48174: compile-time crash with target enter data on a …
alexey-bataev Nov 17, 2020
7a8b2f6
[DAGCombiner] Precommit Sext Tests for D91589
RKSimon Nov 18, 2020
b3b9be4
SpeculativeExecution: Allow speculating more instruction types
piotrAMD Nov 18, 2020
4324320
[clangd] Implement textDocument/implementation (Xref layer)
usx95 Nov 18, 2020
06fcc4f
[NFC] Use [MC]Register for Hexagon target
jaingaurav Nov 5, 2020
8c1e3cb
[llvm] fix global_downgraded_to_static test
metaflow Nov 18, 2020
27e7381
lld: Make tests depend on llvm-symbolizer after bc98034040
nico Nov 18, 2020
7046be1
[OpenMP] [DOCS] Update OMP5.1 feature status table [NFC]
dreachem Nov 18, 2020
057e6bb
[SystemZ][NFC] Group SystemZ tests in SystemZ folder
abhina-sree Nov 18, 2020
0415cf4
Fix unused variable warning. NFCI.
RKSimon Nov 18, 2020
480ad4a
HazardRecognizer - Fix definition/declaration argument name mismatche…
RKSimon Nov 18, 2020
0016ab6
Revert "[clangd] Implement textDocument/implementation (Xref layer)"
usx95 Nov 18, 2020
3abaf6c
[libc++] Implements multiline regex support.
mordante Nov 18, 2020
72ccec1
[AMDGPU] Fix v3f16 interaction with image store workaround
Flakebi Nov 5, 2020
c519bc7
lld/MachO: Move MachOOptTable to DriverUtils.cpp, remove DriverUtils.h
nico Nov 18, 2020
9b99927
[VP] Non-signalling llvm.vp.* intrinsics are speculatable
Nov 18, 2020
130da80
Revert "Revert "[clangd] Implement textDocument/implementation (Xref …
usx95 Nov 18, 2020
8b9e6dc
[NFC][LoopIdiom] Left-shift-until-bittest: revisit test coverage
LebedevRI Nov 18, 2020
733f7b5
Revert "[build] normalize components dependencies"
Nov 18, 2020
068da2c
[clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rul…
ymand Nov 16, 2020
adf9f64
[MLIR][SPIRV] Rename `spv._reference_of` to `spv.mlir.referenceof`
ergawy Nov 18, 2020
7810d83
[GWP-ASan] Respect GWP_ASAN_DEFAULT_ENABLED compile-time macro
frobtech Nov 18, 2020
85ccdca
[BasicAA] Remove assert in AA evaluator
nikic Nov 18, 2020
d4ba28b
Expand existing loopsink testing to also test loopsinking using new p…
jamieschmeiser Nov 18, 2020
d1b921e
[libc][NFC][Obvious] Remove few unnecessary pieces from ilogb tests.
Nov 18, 2020
b51c290
[Inline] Add test for PR48209 (NFC)
nikic Nov 18, 2020
23aeadb
[Inline] Fix incorrect noalias metadata application (PR48209)
nikic Nov 18, 2020
c6c8d4a
[modules] Fix crash in call to `FunctionDecl::setPure()`
andrewjcg Nov 18, 2020
87369c6
Revert "[tsan] Add pthread_cond_clockwait interceptor"
Nov 18, 2020
562addb
Revert "Expand existing loopsink testing to also test loopsinking usi…
jamieschmeiser Nov 18, 2020
0dca0b7
[Inline] Expand test to show dropped metadata (NFC)
nikic Nov 18, 2020
f4a3969
[Inline] Fix incorrectly dropped noalias metadata
nikic Nov 18, 2020
97e55cf
[OpenMP] Add Passing in Original Declaration Names To Mapper API
jhuber6 Nov 13, 2020
2fead1a
[ConstraintElimination] Decompose add nuw/sub nuw.
fhahn Nov 18, 2020
e292929
Revert "Revert "Expand existing loopsink testing to also test loopsin…
jamieschmeiser Nov 18, 2020
b056030
[test] Fix remaining GVN tests under NPM
aeubanks Nov 18, 2020
ca76e9f
[test] Fix eliminate-callsite-inline.ll under NPM
aeubanks Nov 18, 2020
cd3c22c
[BasicAA] Generalize base offset modulus handling
nikic Nov 8, 2020
0fe4b8e
[NFC][AMDGPU] Remove some generic pointers in memory-legalizer tests
slinder1 Nov 18, 2020
7bf89c2
[NFC][Reassociate] Delay checking isLoadCombineCandidate() until afte…
LebedevRI Nov 18, 2020
18db29e
[PowerPC] Add peephole to remove redundant accumulator prime/unprime …
Nov 18, 2020
5378c6a
[OpenMP] Add Support for Mapping Names in Libomptarget RTL
jhuber6 Nov 18, 2020
cff479b
Revert "Revert "Revert "Expand existing loopsink testing to also test…
jamieschmeiser Nov 18, 2020
f0785c1
[libcxx] Port to NuttX (https://nuttx.apache.org) RTOS
xiaoxiang781216 Nov 18, 2020
5556616
[GWP-ASan] Port tests to Fuchsia
Nov 16, 2020
e597116
[NPM] Add implicit basic-aa before other AA
aeubanks Nov 18, 2020
96d40df
MCExpr::evaluateAsRelocatableImpl : allow evaluation of non-VK_None M…
MaskRay Nov 18, 2020
ea4973f
[flang] Improve error message on bad LOGICAL compare operations
psteinfeld Nov 18, 2020
5349f99
[flang] Correct handling of null pointer initializers
klausler Nov 17, 2020
be00e88
[libc++] Clarify how we pick the typeinfo comparison
ldionne Nov 16, 2020
44cd03a
[RISCV] Use register class VR for V instruction operands directly.
Hsiangkai Nov 18, 2020
5f2c554
Fix assert on valid due to incorrect assumption that a field name must
zygoloid Nov 18, 2020
c1ba9c4
[mlir][Affine] Refactor affine fusion code in pass to utilities
dcaballe Nov 18, 2020
5824a57
[gn build] (manually) merge f0785c1f7ac
nico Nov 18, 2020
0e2585c
[tsan] Add pthread_cond_clockwait interceptor
vitalybuka Nov 18, 2020
f3aa9e3
[MachO] Update embedded part of ObjectFileMachO for Mangled API change
JDevlieghere Nov 18, 2020
132d6d7
[VE] Add vmv intrinsic instructions
kaz7 Nov 14, 2020
544cb64
[YAMLIO] Add a generic YAML fuzzer harness
slinder1 Nov 16, 2020
2980933
[YAMLIO] Support non-null-terminated inputs
slinder1 Nov 16, 2020
67f16e9
[NPM] Remove -enable-npm-optnone flag
aeubanks Nov 18, 2020
523cc09
[hwasan] Fix Thread reuse (try 2).
eugenis Nov 12, 2020
5747380
Added GDB pretty printer for StringMap
MoritzS Nov 18, 2020
803af31
[WebAssembly] Support fp reg class in r constraint
devsnek Nov 18, 2020
9ad62f6
[mlir][sparse] remove a few rewriting failures
aartbik Nov 18, 2020
5abf76f
ADT: Add assertions to SmallVector::insert, etc., for reference inval…
dexonsmith Nov 13, 2020
90966da
Support: Avoid SmallVector::assign with a range from to-be-replaced v…
dexonsmith Nov 19, 2020
25f5406
[clang-tidy] Extend bugprone-string-constructor-check to std::string_…
ckennelly Nov 7, 2020
fb19f11
[trace][intel-pt] Scaffold the 'thread trace start | stop' commands
walter-erquinigo Oct 27, 2020
5f0ae23
[X86][AArch64][RISCV] Pre-commit negated abs test case. NFC.
Nov 19, 2020
c0958b7
[mlir] Add support for referencing a SymbolRefAttr in a SideEffectIns…
River707 Nov 19, 2020
bd106d7
[mlir][Pass] Only enable/disable CrashRecovery once
River707 Nov 19, 2020
6b0fc1f
[RISCV] Add MemOperand to the instruction created by storeRegToStackS…
topperc Nov 19, 2020
b51e844
[NFC][TFUtils] Extract out the output spec loader
mtrofin Nov 19, 2020
43c0e4f
[Transforms] Use llvm::is_contained (NFC)
kazutakahirata Nov 19, 2020
8ab2353
[NFC][TFUtils] also include output specs lookup logic in loadOutputSpecs
mtrofin Nov 19, 2020
4d8dede
[libc] Fix the overflow check condition of ldexp.
Nov 18, 2020
6b1341e
[PowerPC] [Clang] Fix alignment of 128-bit float types
ecnelises Nov 19, 2020
7c2990b
[clangd] Fix data race in GoToInclude.All test
kadircet Nov 19, 2020
ea7ab5a
[IndVarSimplify] Notify top most loop to drop cached exit counts
wweiandrew Nov 19, 2020
1827005
[WebAssembly] Add support for named globals in the object format.
sbc100 Nov 19, 2020
ffe6c97
[VE] VEC_BROADCAST, lowering and isel
Nov 19, 2020
58ce4a8
[mlir][TableGen] Support intrinsics with multiple returns and overloa…
Nov 19, 2020
47518d6
[clang-tidy] Improving bugprone-sizeof-expr check.
balazske Nov 19, 2020
7c601d0
[NFC] Move code earlier as preparation for further changes
xortator Nov 19, 2020
515105f
[NFC] Remove comment (commited ahead of time by mistake)
xortator Nov 19, 2020
1983acc
[SelDAGBuilder] Do not require simple VTs for constraints.
fhahn Nov 19, 2020
2d1f471
[Mach0] Fix unused-variable warnings
Nov 19, 2020
a1de391
[LV][NFC-ish] Allow vector widths over 256 elements
Nov 19, 2020
1e2da38
[AArch64][SVE] Allow C-style casts between fixed-size and scalable ve…
Nov 17, 2020
14ae02f
[X86][AVX] Only share broadcasts of different widths from the same SD…
RKSimon Nov 19, 2020
d8ff269
[lldb] Add explicit 64-bit fip/fdp registers on x86_64
mgorny Nov 15, 2020
c43abf0
[lldb] Use translated full ftag values
mgorny Nov 15, 2020
1407833
[clangd] Disable SerializationTest.NoCrashOnBadArraySize with ASAN
kirillbobyrev Nov 19, 2020
006b3bd
[ARM] Deliberately prevent inline asm in low overhead loops. NFC
davemgreen Nov 19, 2020
fceaff4
[ValueTracking] computeKnownBitsFromShiftOperator - move shift amount…
RKSimon Nov 19, 2020
9374e7b
[RISCV] Extend 32-bit test coverage of neg-abs tests for D91120
RKSimon Nov 19, 2020
7f4d88a
[ConstraintElimination] Add GEP test case with variable offset.
fhahn Nov 19, 2020
57e0007
Fix Wundef warnings for Support/Compiler.h
svenvh Nov 19, 2020
40267cc
[libc++] ADL-proof <vector> by adding _VSTD:: qualification on calls.
Quuxplusone Nov 18, 2020
9e39a5d
[mlir][linalg] Start a named ops to generic ops pass
antiagainst Nov 19, 2020
17497ec
[AIX][FE] Support constructor/destructor attribute
xling-liao Nov 19, 2020
193a9b3
Revert "[lldb] Use translated full ftag values"
metaflow Nov 19, 2020
a1702a2
[clang][cli] Port Comment option flags to new parsing system
jansvoboda11 Nov 19, 2020
620adac
Revert "[libc++] ADL-proof <vector> by adding _VSTD:: qualification o…
metaflow Nov 19, 2020
7a0ea12
[clang][cli] Port analyzer flags to new option parsing system
jansvoboda11 Nov 18, 2020
734d2f9
[clangd] No crash on "-verify" mode.
hokein Nov 19, 2020
0e4cdfc
[ARM] Add a WLS tail predication test. NFC
davemgreen Nov 19, 2020
9bd50ab
[MLIR][SPIRV] Rename `spv._merge` to `spv.mlir.merge`
ergawy Nov 19, 2020
341f3c1
[MLIR][SPIRV] ModuleCombiner: deduplicate global vars, spec consts, a…
ergawy Nov 19, 2020
ab77fa5
[AIX][XCOFF][Patch2] decode vector information and extent long table …
Nov 19, 2020
f62fe0e
[FileCheck] Disallow unused prefixes in llvm/test/Analysis
mtrofin Nov 11, 2020
a703998
[lldb] Remove legacy casts from TestStackFromStdModule
Teemperor Sep 28, 2020
b7a09de
[lldb][NFC] Add a FIXME for ClangASTSource::FindExternalLexicalDecls'…
Teemperor Nov 19, 2020
892ed1f
[libc] Add differential fuzzers for ldexp and remquo.
Nov 18, 2020
908e26d
[NFC][PhaseOrdering] Add a test showing the need to run IndVars after…
LebedevRI Nov 19, 2020
74170a3
Use rewriter in SCFToSPIRV conversion.
tpopp Nov 19, 2020
da8bec4
[OpenMP] Add Location Fields to Libomptarget Runtime for Debugging
jhuber6 Nov 19, 2020
8ecb015
[ARM][LowOverheadLoops] Convert intermediate vpr use assertion to con…
SamTebbs33 Nov 19, 2020
8f778b2
[sanitizer_common] Add facility to get the full report path
teresajohnson Nov 19, 2020
7036fe8
[libomptarget] Add support for target update non-contiguous
chichunchen Nov 19, 2020
41c9f4c
[LoopVectorize] NFC: Fix unused variable warning for MaxSafeDepDist
sdesmalen-arm Nov 19, 2020
47b7138
[lldb] Fix incorrect error handling in GDBRemoteCommunicationClient:…
Teemperor Nov 19, 2020
8073201
[AArch64] Lower fptrunc/fpext from/to FP128t to/from FP16
zatrazz Nov 18, 2020
1fb91fc
[compiler-rt] [builtins] Support conversion between fp16 and fp128
zatrazz Nov 18, 2020
7a94829
[compiler-rt] [builtins] Use _Float16 on extendhfsf2, truncdfhf2 __tr…
zatrazz Nov 18, 2020
5b7bd89
Revert "Reorder linalg.conv indexing_maps loop order"
antiagainst Nov 19, 2020
1ac9b54
[RISCV] Lower GREVI and GORCI as custom nodes
frasercrmck Nov 11, 2020
617e8e5
[clang-tidy] ElseAfterReturn check wont suggest fixes if preprocessor…
njames93 Nov 19, 2020
a75b2e8
[MemProf] Add interface to dump profile
teresajohnson Nov 19, 2020
c77aefb
[lldb] Fix another Python2/3 string<->bytes type error in patch-crash…
Teemperor Nov 19, 2020
2f3adc5
[MLIR][SPIRV] Rename `spv._module_end` to `spv.mlir.endmodule`
ergawy Nov 19, 2020
a97f628
[llvm][IR] Add dso_local_equivalent Constant
PiJoules Apr 1, 2020
332710e
[mlir] Add a missing dependency to LinalgToLLVM
sstamenova Nov 19, 2020
9a46505
[CUDA] Unbreak CUDA compilation with -std=c++20
Artem-B Nov 19, 2020
5911e6a
[libc++] Mark a few tests as unsupported on older Clangs to fix bots
ldionne Nov 19, 2020
b14ea01
[RISCV] Add test cases for missed grevi/greviw opportunities. NFC
frasercrmck Nov 19, 2020
9cfad5f
[OpenMP] Add support for Intel's umonitor/umwait
AndreyChurbanov Nov 19, 2020
d7747da
[clangd] Also detect corrupt stri table size.
sam-mccall Nov 11, 2020
65fcddf
[mlir][BuiltinDialect] Resolve comments from D91571
River707 Nov 19, 2020
ad5a195
[clangd] Express ASAN interactions of tests more clearly. NFC
sam-mccall Nov 19, 2020
314a0d7
Fix crash after looking up dwo_id=0 in CU index.
slackito Nov 19, 2020
72badbc
[NPM] Move more O0 pass building into PassBuilder
aeubanks Nov 16, 2020
a8d9d0b
[gn build] (manually) merge 1fb91fcf9cfe849
nico Nov 19, 2020
eb995e9
[Polly] Use LocationSize::unknown() (NFC)
nikic Nov 19, 2020
389ef79
[libc++] Add documentation for setting up new CI jobs
ldionne Nov 19, 2020
22ec72f
[Lint] Use MemoryLocation
nikic Nov 19, 2020
beb889c
Make array pointers in the CAPI const
Nov 19, 2020
887c766
[BasicAA] Deoptimize intrinsics don't modify memory
arpilipe Nov 17, 2020
b4ac05d
Replace the equivalent code by UnionTableAddr
stephan-yichao-zhao Nov 19, 2020
b0750e2
Fix rollback of first block erasure in a region.
tpopp Nov 19, 2020
393b9e9
[MemLoc] Require LocationSize argument (NFC)
nikic Nov 19, 2020
d8eb998
[MemLoc] Specify LocationSize in unit test
nikic Nov 19, 2020
7de7c40
[MemLoc] Use hasValue() method (NFC)
nikic Nov 19, 2020
7f2ebde
[mlir] Split BufferUtils.h out of Bufferize.h
silvasean Nov 16, 2020
6c1c308
Remove deadcode from DFSanFunction::get*TLS*()
stephan-yichao-zhao Nov 19, 2020
9bb5bff
[mlir] Add an assertion on creating an Operation with null result types
ftynse Nov 19, 2020
e8dc6e9
[MemLoc] Use hasValue() method more (NFC)
nikic Nov 19, 2020
bcd469a
[NFC][InstCombine] Add test coverage for `and (sext %x), SIGNMASK`-li…
LebedevRI Nov 19, 2020
a91e967
[InstCombine] Fold `and(shl(zext(x), width(SIGNMASK) - width(%x)), SI…
LebedevRI Nov 19, 2020
b156514
Remove unused private fields
GMNGeoffrey Nov 19, 2020
3ded927
[mlir] Add missing const * updates in StandardAttributes
tpopp Nov 19, 2020
7cce621
[test] Fix pr39282.ll under NPM
aeubanks Nov 19, 2020
dfe67f4
[test] Fix globalaa-retained.ll under NPM
aeubanks Nov 19, 2020
7fa14a7
[ConstraintElimination] Decompose GEP with arbitrary offsets.
fhahn Nov 18, 2020
1a7d7f4
[test] Fix split-vfunc.ll under NPM
aeubanks Nov 19, 2020
8adc4d1
[clangd] Add textDocument/ast extension method to dump the AST
sam-mccall Oct 16, 2020
d730e61
[gn build] Port 8adc4d1ec76
llvmgnsyncbot Nov 20, 2020
0fd0433
[LLDB] Fixing lldb/test/Shell/Register/x86-fp-write.test
shafik Nov 20, 2020
f7f0fe6
[lld][WebAssembly] Convert more tests to asm format. NFC.
sbc100 Nov 18, 2020
40e8772
ADT: Weaken SmallVector::resize assertion from 5abf76fbe37380874a88cc…
dexonsmith Nov 20, 2020
91fe3e3
ADT: Use early returns in SmallVector::resize, NFC
dexonsmith Nov 20, 2020
513d165
Port -lower-matrix-intrinsics-minimal to NPM
aeubanks Nov 18, 2020
1fe24a6
ADT: Split out isSafeToReferenceAfterResize helper to use early retur…
dexonsmith Nov 19, 2020
8d5673f
[test] Fix multiply-minimal.ll
aeubanks Nov 20, 2020
b2f6630
[PowerPC] Allow a '%' prefix for registers in CFI directives
isanbard Nov 18, 2020
8b525c9
[mlir][Linalg] Add utility function that return static loop bounds of…
Nov 20, 2020
f8284d2
[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)
Nov 20, 2020
0c59f51
[mlir][Linalg] NFC: Expose some utility functions used for promotion.
Nov 20, 2020
0f9f0a4
Remove unused isZero function
GMNGeoffrey Nov 20, 2020
fbfbfa5
[mlir] Support big-endian systems in DenseElementsAttr (multiple word)
imaihal Nov 20, 2020
2583d8e
[CodeGen] Use llvm::is_contained (NFC)
kazutakahirata Nov 20, 2020
32dd587
Temporarily Revert "[CostModel] remove cost-kind predicate for intrin…
echristo Nov 20, 2020
b774360
[PGO] Make -disable-preinline work with NPM
aeubanks Nov 19, 2020
4cb510d
[NFC] Pre-commit test for flt_rounds on PowerPC
ecnelises Nov 20, 2020
9a99d23
[lib/Object] - Generalize the RelocationResolver API.
Nov 12, 2020
776f92e
[X86] Add support for vex, vex2, vex3, and evex for MASM
MoringLiu Oct 30, 2020
3a23010
Revert "[LLDB] Fixing lldb/test/Shell/Register/x86-fp-write.test"
mgorny Nov 20, 2020
f0e2c51
[lldb] [test/Register] XFAIL x86-fp-write on Darwin
mgorny Nov 20, 2020
0c101c9
[Test] Add tests demonstrating a bug in SCEV, PR48225
xortator Nov 20, 2020
5644f73
Revert "[OpenMP] Add support for Intel's umonitor/umwait"
AndreyChurbanov Nov 20, 2020
aadbe20
[llvm-readobj] - Introduce `forEachRelocationDo` helper.
Nov 12, 2020
da14ae2
[clangd] NFC: Reorder headers in tests accordig to Clang-Tidy
kirillbobyrev Nov 20, 2020
343dceb
[llvm-readelf/obj] - Improve error reporting when dumping group secti…
Nov 19, 2020
2290daa
[Test] Auto-update checks in a test
xortator Nov 20, 2020
1b5921f
[NFC][Test] Update test for IEEE Long Double
Nov 20, 2020
7a18bdb
[AMDGPU] Implement flat scratch init for pal
Flakebi Oct 15, 2020
a86a9b5
[mlir] Automatic reference counting for Async values + runtime suppor…
ezhulenev Nov 20, 2020
3254168
[lldb][AArch64/Linux] Show memory tagged memory regions
DavidSpickett Aug 17, 2020
44c96be
Fix MSVC "not all control paths return a value" warnings. NFCI.
RKSimon Nov 20, 2020
ce6524d
[sanitizer_common][test] Disable FastUnwindTest.* on SPARC
rorth Nov 20, 2020
0f69cbe
[sanitizer_common][test] Disable CombinedAllocator32Compact etc. on S…
rorth Nov 20, 2020
2f1fe9a
[clang][CodeGen] Move riscv specific tests to RISCV subtarget folder
RKSimon Nov 20, 2020
822c5c5
[clang][CodeGen] Move WebAssembly specific tests to WebAssembly subta…
RKSimon Nov 20, 2020
0caa82e
Revert "[mlir][Linalg] Fuse sequence of Linalg operation (on buffers)"
metaflow Nov 20, 2020
cb778c3
[mlir][std] Fold comparisons when the operands are equal
Nov 20, 2020
42389f1
[VE] Change threshold for jump table generation
kaz7 Nov 19, 2020
ffb3fd8
Partially revert '[MachO] Update embedded part of ObjectFileMachO for…
Teemperor Nov 20, 2020
6af81ea
[mlir][std] Fold load(tensor_to_memref) into extract_element
Nov 20, 2020
dfd2858
[InstCombine] add test comments for negative tests; NFC
rotateright Nov 20, 2020
a89e55c
[mlir][std] Canonicalize a dim(memref_reshape) into a load from the s…
Nov 20, 2020
03d593d
[sanitizers][test] Test sanitizer_common and ubsan_minimal on Solaris
rorth Nov 20, 2020
99cf39b
[LoopUnroll] add test for full unroll that is sensitive to cost-model…
rotateright Nov 20, 2020
1285781
[CostModel] add tests for math library calls; NFC
rotateright Nov 13, 2020
4d7df43
[AArch64] Out-of-line atomics (-moutline-atomics) implementation.
ilinpv Nov 19, 2020
f08c37d
[ARM] Disable WLSTP loops
davemgreen Nov 20, 2020
2033fa2
Add documentation illustrating use of IgnoreUnlessSpelledInSource
steveire Nov 17, 2020
2ce6352
Add a call super attribute plugin example
Nov 20, 2020
412237d
[AArch64] Enable post RA scheduler for Cortex-R82
Nov 20, 2020
95ce9fb
[clang] Do not crash on pointer wchar_t pointer assignment.
gislan Nov 17, 2020
621efa6
[NFC intended] Refactor the code for printChanged for reuse and to fa…
jamieschmeiser Nov 20, 2020
e4f9b5d
[clang-tidy] Include std::basic_string_view in readability-redundant-…
ckennelly Nov 7, 2020
7ae3464
[CostModel] avoid crashing while finding scalarization overhead
rotateright Nov 20, 2020
7f6360c
Reland: Expand existing loopsink testing to also test loopsinking usi…
jamieschmeiser Nov 20, 2020
6f1c07b
[SLP][Test] Update pr47269.ll test. NFC
anton-afanasyev Nov 20, 2020
4766a86
[libc] Combine all math differential fuzzers into one target.
Nov 19, 2020
3bc4157
Add a default address space for globals to DataLayout
arichardson Nov 20, 2020
51e09e1
[AMDGPU] Set the default globals address space to 1
arichardson Jul 22, 2020
b8b9c2c
Merge from 'sycl' to 'sycl-web'
Nov 20, 2020
9f8b3e0
Merge from 'master' to 'sycl-web' (#6)
Nov 20, 2020
5192ecb
Merge remote-tracking branch 'otcshare_llvm/sycl-web' into llvmspirv_…
vmaksimo Nov 23, 2020
7b895fd
Align tests with the community change 69cd776
vmaksimo Nov 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ struct StrCatCheckResult {
};

void RemoveCallLeaveArgs(const CallExpr* Call, StrCatCheckResult* CheckResult) {
if (Call->getNumArgs() == 0)
return;
// Remove 'Foo('
CheckResult->Hints.push_back(
FixItHint::CreateRemoval(CharSourceRange::getCharRange(
Expand Down
43 changes: 36 additions & 7 deletions clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ void SizeofExpressionCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
}

void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
// FIXME:
// Some of the checks should not match in template code to avoid false
// positives if sizeof is applied on template argument.

const auto IntegerExpr = ignoringParenImpCasts(integerLiteral());
const auto ConstantExpr = expr(ignoringParenImpCasts(
anyOf(integerLiteral(), unaryOperator(hasUnaryOperand(IntegerExpr)),
Expand Down Expand Up @@ -132,6 +136,7 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
this);

// Detect sizeof(ptr) where ptr points to an aggregate (i.e. sizeof(&S)).
// Do not find it if RHS of a 'sizeof(arr) / sizeof(arr[0])' expression.
const auto ArrayExpr = expr(ignoringParenImpCasts(
expr(hasType(qualType(hasCanonicalType(arrayType()))))));
const auto ArrayCastExpr = expr(anyOf(
Expand All @@ -151,13 +156,31 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
hasType(qualType(hasCanonicalType(PointerToStructType))),
unless(cxxThisExpr()))));

Finder->addMatcher(
expr(anyOf(sizeOfExpr(has(expr(ignoringParenImpCasts(
anyOf(ArrayCastExpr, PointerToArrayExpr, StructAddrOfExpr,
PointerToStructExpr))))),
sizeOfExpr(has(PointerToStructType))))
.bind("sizeof-pointer-to-aggregate"),
this);
const auto ArrayOfPointersExpr = expr(ignoringParenImpCasts(expr(hasType(
qualType(hasCanonicalType(arrayType(hasElementType(pointerType()))
.bind("type-of-array-of-pointers")))))));
const auto ArrayOfSamePointersExpr =
expr(ignoringParenImpCasts(expr(hasType(qualType(hasCanonicalType(
arrayType(equalsBoundNode("type-of-array-of-pointers"))))))));
const auto ZeroLiteral =
expr(ignoringParenImpCasts(integerLiteral(equals(0))));
const auto ArrayOfSamePointersZeroSubscriptExpr =
expr(ignoringParenImpCasts(arraySubscriptExpr(
hasBase(ArrayOfSamePointersExpr), hasIndex(ZeroLiteral))));
const auto ArrayLengthExprDenom =
expr(hasParent(expr(ignoringParenImpCasts(
binaryOperator(hasOperatorName("/"),
hasLHS(expr(ignoringParenImpCasts(expr(
sizeOfExpr(has(ArrayOfPointersExpr)))))))))),
sizeOfExpr(has(ArrayOfSamePointersZeroSubscriptExpr)));

Finder->addMatcher(expr(anyOf(sizeOfExpr(has(expr(ignoringParenImpCasts(anyOf(
ArrayCastExpr, PointerToArrayExpr,
StructAddrOfExpr, PointerToStructExpr))))),
sizeOfExpr(has(PointerToStructType))),
unless(ArrayLengthExprDenom))
.bind("sizeof-pointer-to-aggregate"),
this);

// Detect expression like: sizeof(epxr) <= k for a suspicious constant 'k'.
if (WarnOnSizeOfCompareToConstant) {
Expand All @@ -178,6 +201,12 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
this);

// Detect sizeof(...) /sizeof(...));
// FIXME:
// Re-evaluate what cases to handle by the checker.
// Probably any sizeof(A)/sizeof(B) should be error if
// 'A' is not an array (type) and 'B' the (type of the) first element of it.
// Except if 'A' and 'B' are non-pointers, then use the existing size division
// rule.
const auto ElemType =
arrayType(hasElementType(recordType().bind("elem-type")));
const auto ElemPtrType = pointerType(pointee(type().bind("elem-ptr-type")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

#include "StringConstructorCheck.h"
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Tooling/FixIt.h"
Expand All @@ -21,17 +22,36 @@ namespace {
AST_MATCHER_P(IntegerLiteral, isBiggerThan, unsigned, N) {
return Node.getValue().getZExtValue() > N;
}

const char DefaultStringNames[] =
"::std::basic_string;::std::basic_string_view";

static std::vector<StringRef>
removeNamespaces(const std::vector<std::string> &Names) {
std::vector<StringRef> Result;
Result.reserve(Names.size());
for (StringRef Name : Names) {
std::string::size_type ColonPos = Name.rfind(':');
Result.push_back(
Name.substr(ColonPos == std::string::npos ? 0 : ColonPos + 1));
}
return Result;
}

} // namespace

StringConstructorCheck::StringConstructorCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
WarnOnLargeLength(Options.get("WarnOnLargeLength", true)),
LargeLengthThreshold(Options.get("LargeLengthThreshold", 0x800000)) {}
LargeLengthThreshold(Options.get("LargeLengthThreshold", 0x800000)),
StringNames(utils::options::parseStringList(
Options.get("StringNames", DefaultStringNames))) {}

void StringConstructorCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "WarnOnLargeLength", WarnOnLargeLength);
Options.store(Opts, "LargeLengthThreshold", LargeLengthThreshold);
Options.store(Opts, "StringNames", DefaultStringNames);
}

void StringConstructorCheck::registerMatchers(MatchFinder *Finder) {
Expand Down Expand Up @@ -80,7 +100,8 @@ void StringConstructorCheck::registerMatchers(MatchFinder *Finder) {
// parameters. [i.e. string (const char* s, size_t n);]
Finder->addMatcher(
cxxConstructExpr(
hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
hasDeclaration(cxxConstructorDecl(ofClass(
cxxRecordDecl(hasAnyName(removeNamespaces(StringNames)))))),
hasArgument(0, hasType(CharPtrType)),
hasArgument(1, hasType(isInteger())),
anyOf(
Expand All @@ -100,11 +121,17 @@ void StringConstructorCheck::registerMatchers(MatchFinder *Finder) {
// Check the literal string constructor with char pointer.
// [i.e. string (const char* s);]
Finder->addMatcher(
traverse(TK_AsIs,
cxxConstructExpr(hasDeclaration(cxxMethodDecl(hasName("basic_string"))),
hasArgument(0, expr().bind("from-ptr")),
hasArgument(1, unless(hasType(isInteger()))))
.bind("constructor")),
traverse(TK_AsIs,
cxxConstructExpr(
hasDeclaration(cxxConstructorDecl(ofClass(cxxRecordDecl(
hasAnyName(removeNamespaces(StringNames)))))),
hasArgument(0, expr().bind("from-ptr")),
// do not match std::string(ptr, int)
// match std::string(ptr, alloc)
// match std::string(ptr)
anyOf(hasArgument(1, unless(hasType(isInteger()))),
argumentCountIs(1)))
.bind("constructor")),
this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class StringConstructorCheck : public ClangTidyCheck {
private:
const bool WarnOnLargeLength;
const unsigned int LargeLengthThreshold;
std::vector<std::string> StringNames;
};

} // namespace bugprone
Expand Down
3 changes: 2 additions & 1 deletion clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ static int getPriority(StringRef Filename, bool IsAngled, bool IsMainModule) {
return 2;

// System headers are sorted to the end.
if (IsAngled || Filename.startswith("gtest/"))
if (IsAngled || Filename.startswith("gtest/") ||
Filename.startswith("gmock/"))
return 3;

// Other headers are inserted between the main module header and LLVM headers.
Expand Down
113 changes: 96 additions & 17 deletions clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Tooling/FixIt.h"
#include "llvm/ADT/SmallVector.h"

Expand All @@ -19,10 +20,30 @@ namespace clang {
namespace tidy {
namespace readability {

static const char ReturnStr[] = "return";
static const char ContinueStr[] = "continue";
static const char BreakStr[] = "break";
static const char ThrowStr[] = "throw";
namespace {

class PPConditionalCollector : public PPCallbacks {
public:
PPConditionalCollector(
ElseAfterReturnCheck::ConditionalBranchMap &Collections,
const SourceManager &SM)
: Collections(Collections), SM(SM) {}
void Endif(SourceLocation Loc, SourceLocation IfLoc) override {
if (!SM.isWrittenInSameFile(Loc, IfLoc))
return;
SmallVectorImpl<SourceRange> &Collection = Collections[SM.getFileID(Loc)];
assert(Collection.empty() || Collection.back().getEnd() < Loc);
Collection.emplace_back(IfLoc, Loc);
}

private:
ElseAfterReturnCheck::ConditionalBranchMap &Collections;
const SourceManager &SM;
};

} // namespace

static const char InterruptingStr[] = "interrupting";
static const char WarningMessage[] = "do not use 'else' after '%0'";
static const char WarnOnUnfixableStr[] = "WarnOnUnfixable";
static const char WarnOnConditionVariablesStr[] = "WarnOnConditionVariables";
Expand Down Expand Up @@ -140,11 +161,18 @@ void ElseAfterReturnCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, WarnOnConditionVariablesStr, WarnOnConditionVariables);
}

void ElseAfterReturnCheck::registerPPCallbacks(const SourceManager &SM,
Preprocessor *PP,
Preprocessor *ModuleExpanderPP) {
PP->addPPCallbacks(
std::make_unique<PPConditionalCollector>(this->PPConditionals, SM));
}

void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
const auto InterruptsControlFlow =
stmt(anyOf(returnStmt().bind(ReturnStr), continueStmt().bind(ContinueStr),
breakStmt().bind(BreakStr),
expr(ignoringImplicit(cxxThrowExpr().bind(ThrowStr)))));
const auto InterruptsControlFlow = stmt(anyOf(
returnStmt().bind(InterruptingStr), continueStmt().bind(InterruptingStr),
breakStmt().bind(InterruptingStr),
expr(ignoringImplicit(cxxThrowExpr().bind(InterruptingStr)))));
Finder->addMatcher(
compoundStmt(
forEach(ifStmt(unless(isConstexpr()),
Expand All @@ -157,21 +185,72 @@ void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
this);
}

static bool hasPreprocessorBranchEndBetweenLocations(
const ElseAfterReturnCheck::ConditionalBranchMap &ConditionalBranchMap,
const SourceManager &SM, SourceLocation StartLoc, SourceLocation EndLoc) {

SourceLocation ExpandedStartLoc = SM.getExpansionLoc(StartLoc);
SourceLocation ExpandedEndLoc = SM.getExpansionLoc(EndLoc);
if (!SM.isWrittenInSameFile(ExpandedStartLoc, ExpandedEndLoc))
return false;

// StartLoc and EndLoc expand to the same macro.
if (ExpandedStartLoc == ExpandedEndLoc)
return false;

assert(ExpandedStartLoc < ExpandedEndLoc);

auto Iter = ConditionalBranchMap.find(SM.getFileID(ExpandedEndLoc));

if (Iter == ConditionalBranchMap.end() || Iter->getSecond().empty())
return false;

const SmallVectorImpl<SourceRange> &ConditionalBranches = Iter->getSecond();

assert(llvm::is_sorted(ConditionalBranches,
[](const SourceRange &LHS, const SourceRange &RHS) {
return LHS.getEnd() < RHS.getEnd();
}));

// First conditional block that ends after ExpandedStartLoc.
const auto *Begin =
llvm::lower_bound(ConditionalBranches, ExpandedStartLoc,
[](const SourceRange &LHS, const SourceLocation &RHS) {
return LHS.getEnd() < RHS;
});
const auto *End = ConditionalBranches.end();
for (; Begin != End && Begin->getEnd() < ExpandedEndLoc; ++Begin)
if (Begin->getBegin() < ExpandedStartLoc)
return true;
return false;
}

static StringRef getControlFlowString(const Stmt &Stmt) {
if (isa<ReturnStmt>(Stmt))
return "return";
if (isa<ContinueStmt>(Stmt))
return "continue";
if (isa<BreakStmt>(Stmt))
return "break";
if (isa<CXXThrowExpr>(Stmt))
return "throw";
llvm_unreachable("Unknown control flow interruptor");
}

void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
const auto *If = Result.Nodes.getNodeAs<IfStmt>("if");
const auto *Else = Result.Nodes.getNodeAs<Stmt>("else");
const auto *OuterScope = Result.Nodes.getNodeAs<CompoundStmt>("cs");

bool IsLastInScope = OuterScope->body_back() == If;
const auto *Interrupt = Result.Nodes.getNodeAs<Stmt>(InterruptingStr);
SourceLocation ElseLoc = If->getElseLoc();

auto ControlFlowInterruptor = [&]() -> llvm::StringRef {
for (llvm::StringRef BindingName :
{ReturnStr, ContinueStr, BreakStr, ThrowStr})
if (Result.Nodes.getNodeAs<Stmt>(BindingName))
return BindingName;
return {};
}();
if (hasPreprocessorBranchEndBetweenLocations(
PPConditionals, *Result.SourceManager, Interrupt->getBeginLoc(),
ElseLoc))
return;

bool IsLastInScope = OuterScope->body_back() == If;
StringRef ControlFlowInterruptor = getControlFlowString(*Interrupt);

if (!IsLastInScope && containsDeclInScope(Else)) {
if (WarnOnUnfixable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_ELSEAFTERRETURNCHECK_H

#include "../ClangTidyCheck.h"
#include "llvm/ADT/DenseMap.h"

namespace clang {
namespace tidy {
Expand All @@ -23,12 +24,18 @@ class ElseAfterReturnCheck : public ClangTidyCheck {
ElseAfterReturnCheck(StringRef Name, ClangTidyContext *Context);

void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
Preprocessor *ModuleExpanderPP) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

using ConditionalBranchMap =
llvm::DenseMap<FileID, SmallVector<SourceRange, 1>>;

private:
const bool WarnOnUnfixable;
const bool WarnOnConditionVariables;
ConditionalBranchMap PPConditionals;
};

} // namespace readability
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ namespace clang {
namespace tidy {
namespace readability {

const char DefaultStringNames[] = "::std::basic_string";
const char DefaultStringNames[] =
"::std::basic_string_view;::std::basic_string";

static ast_matchers::internal::Matcher<NamedDecl>
hasAnyNameStdString(std::vector<std::string> Names) {
Expand Down
8 changes: 6 additions & 2 deletions clang-tools-extra/clang-tidy/utils/DeclRefExprUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ constReferenceDeclRefExprs(const VarDecl &VarDecl, const Stmt &Stmt,
extractNodesByIdTo(Matches, "declRef", DeclRefs);
auto ConstReferenceOrValue =
qualType(anyOf(referenceType(pointee(qualType(isConstQualified()))),
unless(anyOf(referenceType(), pointerType()))));
unless(anyOf(referenceType(), pointerType(),
substTemplateTypeParmType()))));
auto ConstReferenceOrValueOrReplaced = qualType(anyOf(
ConstReferenceOrValue,
substTemplateTypeParmType(hasReplacementType(ConstReferenceOrValue))));
auto UsedAsConstRefOrValueArg = forEachArgumentWithParam(
DeclRefToVar, parmVarDecl(hasType(ConstReferenceOrValue)));
DeclRefToVar, parmVarDecl(hasType(ConstReferenceOrValueOrReplaced)));
Matches = match(findAll(callExpr(UsedAsConstRefOrValueArg)), Stmt, Context);
extractNodesByIdTo(Matches, "declRef", DeclRefs);
Matches =
Expand Down
Loading