Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW18) #3616

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 1,239 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1239 commits
Select commit Hold shift + click to select a range
c4a83c4
Fix TestVSCode_runInTerminal
walter-erquinigo Apr 21, 2021
7735720
[CodeView] Add CodeView support for PGO debug information
MikeHolman Apr 21, 2021
f749550
[libcxx] Stop using use c++ subdirectory for libc++ library
petrhosek Apr 17, 2021
875654f
Fix VSCode/TestOptions.test
walter-erquinigo Apr 21, 2021
775a948
[IR][sanitizer] Set nounwind on module ctor/dtor, additionally set uw…
MaskRay Apr 21, 2021
ac30379
[IR] Add doc about Function::createWithDefaultAttr. NFC
MaskRay Apr 21, 2021
3f1e827
[mlir] Linalg : do not forward memrefs to outputs when do bufferization
ezhulenev Apr 21, 2021
3511022
[HWASan] Untag argument to __hwasan_tag_memory.
morehouse Apr 22, 2021
1a71908
[CSSPGO][llvm-profgen] Always report dangling probes for frames with …
htyu Apr 20, 2021
6cb7599
[AArch64][GlobalISel] Mark some vector G_ABS cases as legal
Apr 21, 2021
3011aa1
[AArch64][GlobalISel] Fix regbankselect for G_FCMP with vector destin…
Apr 20, 2021
77ac823
Delete le32/le64 targets
MaskRay Apr 22, 2021
a2dbfb6
[OpenMP] Simplify offloading parallel call codegen
ggeorgakoudis Apr 21, 2021
987e528
AMDGPU: Fix assert when trying to fold reg_sequence of physreg copies
arsenm Apr 20, 2021
648dfdf
[mlir][tosa] Add tosa.avg_pool2d lowering
rsuderman Apr 19, 2021
39ea3ce
[lldb] Disable TestSimulatorPlatform.py because it's causing a SIGHUP
JDevlieghere Apr 22, 2021
b9e9e2e
Wordsmith the semantics of invariant.load
Apr 22, 2021
77ca2a6
[Coroutine] Collect CoroBegin if all of terminators are dominated by …
ChuanqiXu9 Apr 22, 2021
f6d8cf7
[RISCV] Teach lowerSPLAT_VECTOR_PARTS to detect cases where Hi is sig…
topperc Apr 22, 2021
d40a19c
[mlir][linalg] Add pattern to push reshape after elementwise operation
ThomasRaoux Apr 16, 2021
6e63dfd
[RISCV] Custom lowering of FLT_ROUNDS_
spavloff Nov 5, 2020
26f138e
[Debug-Info] implement -gstrict-dwarf
Apr 20, 2021
e4fa0b3
scudo: Obtain tag from pointer instead of loading it from memory. NFCI.
pcc Apr 22, 2021
8077d0f
[CodeGen] Do not split functions with attr "implicit-section-name".
snehasish Apr 21, 2021
722d4d8
[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed
pdhaliwal-amd Apr 21, 2021
8fe62b7
[GVN] Introduce loop load PRE
xortator Apr 22, 2021
58c5b4c
[RISCV] Use TargetConstant for condition code of RISCVISD::SELECT_CC.
topperc Apr 22, 2021
1dfb52a
[NewPM] Mark some more wrapper passes as ignored
aeubanks Apr 22, 2021
9a930aa
[clang-tidy] Avoid bugprone-macro-parentheses warnings after goto arg…
jubnzv Apr 6, 2021
cfec0a3
[libcxx] [test] Fix testing on windows with c++experimental enabled
mstorsjo Mar 23, 2021
dff8315
[CSSPGO][llvm-profdata] Support trimming cold context when merging pr…
WenleiHe Apr 15, 2021
5a229a6
[LoopVectorize] Don't create unnecessary vscale intrinsic calls
david-arm Apr 19, 2021
740962e
[RISCV] Custom lowering of SET_ROUNDING
spavloff Nov 10, 2020
79cb3ba
[AMDGPU] SIWholeQuadMode: don't add duplicate implicit $exec operands
jayfoad Apr 21, 2021
fbc6f42
clang-format: [JS] do not merge side-effect imports.
mprobst Apr 22, 2021
0e777e4
[mlir][linalg] remove interchange option on linalg to loop lowering.
Apr 22, 2021
398f253
[clang][deps] Include "-cc1" in the arguments
jansvoboda11 Apr 21, 2021
8000e1f
[AArch64] Fix calling windows varargs with floats in fixed args from …
mstorsjo Apr 20, 2021
28b6726
[mlir] Move memref-tests from standard to memref folder.
dfki-thsc Apr 16, 2021
092619c
[PowerPC] Improve codegen for vector fp to int widening conversions
nemanjai Apr 22, 2021
00764c3
[lldb] Add support for evaluating expressions in static member functions
Teemperor Apr 19, 2021
034c73d
[lldb][NFC] Fix unsigned/signed cmp warning in MainLoopTest
Teemperor Apr 22, 2021
21ce124
[AST] Add NestedNameSpecifierLoc accessors to node introspection
steveire Apr 15, 2021
3bcd0ec
[PowerPC] Add vec_roundc as alias for vec_rint in altivec.h
nemanjai Apr 22, 2021
e28ae5e
[X86][AVX] Add PR49971 test case
RKSimon Apr 22, 2021
4393668
MipsSEFrameLowering.h - remove unused headers. NFCI.
RKSimon Apr 22, 2021
be2277f
[Matrix] Support #pragma clang fp
effective-light Apr 22, 2021
e5d844b
[Bitcode] Ensure DIArgList in bitcode has no null or forward metadata…
SLTozer Apr 21, 2021
edc869c
[lldb-vscode] Use a DenseMap to pacify overly aggressive linters
d0k Apr 22, 2021
aee6c86
[AST] De-duplicate empty node introspection
steveire Mar 17, 2021
82d34fe
Fix typo "beneficiates" in comments
jayfoad Apr 22, 2021
d2223c7
[lldb] XFAIL TestStoppedInStaticMemberFunction on Windows
Teemperor Apr 22, 2021
5e50f47
[AST] Add clarification comment
steveire Apr 22, 2021
850e01a
[clang][deps] Check extra args in tests
jansvoboda11 Apr 22, 2021
e3dd82a
[lldb] Don't leak LineSequence in PDB parsers
Teemperor Apr 22, 2021
f0c51cb
[MLIR][Shape] Add canonicalizations for `shape.broadcast`
frgossen Apr 22, 2021
5780dbe
[-Wcalled-once] Do not run analysis on Obj-C++
SavchenkoValeriy Apr 21, 2021
e951b04
[AArch64][SVE] Regression test all ACLE tests with C++
sdesmalen-arm Apr 7, 2021
6ad7e87
clang: libstdc++ LWM is 4.8.3
urnathan Apr 14, 2021
e5984a3
[lldb/elf] Avoid side effects in function calls ParseUnwindSymbols
labath Apr 22, 2021
b13e9d7
[gn build] (manually) port aee6c86c4d
nico Apr 22, 2021
6f48d6a
[AST] Make comment a bit more specific
steveire Apr 22, 2021
46991ad
[gn build] (manually) port aee6c86c4d better
nico Apr 22, 2021
aafb6d8
[X86][AMX][NFC] Remove assert for comparison between different BBs.
phoebewang Apr 22, 2021
0724911
[mlir] Add `tensor.reshape`.
pifon2a Apr 22, 2021
978eb3f
[DAGCombiner] Allow operand of step_vector to be negative.
junparser Apr 19, 2021
57f443c
[SimplifyLibCalls][NFC] Use StringRef::back instead explicit indexing.
yurai007 Apr 22, 2021
d944b1e
[InstCombine][NFC] Use --check-globals flag in tests.
yurai007 Apr 22, 2021
4109161
[LTO] Caching.h - remove unused <string> include. NFCI.
RKSimon Apr 22, 2021
05953cf
[X86] Regenerate atomic-eflags-reuse.ll
RKSimon Apr 22, 2021
4878851
[lld/mac] add a comment pointing to a test that took me a while to find
nico Apr 22, 2021
96dc8d7
[Hexagon] Masked and unmasked load to same base -> load and two selects
jcoplin-quic Apr 22, 2021
71e8038
Update shebang for clang-format-diff script to python3.
PaulkaToast Apr 22, 2021
a9f11cc
Revert "[libcxx][iterator] adds `std::indirectly_readable` and `std::…
davezarzycki Apr 22, 2021
ac1647c
AArch64: expand G_DIVREM operations in GlobalISel
TNorthover Apr 20, 2021
2e72f6b
AArch64: support mixed-size fp <-> int conversions in GlobalISel.
TNorthover Apr 20, 2021
e8d0475
Revert "[Hexagon] Masked and unmasked load to same base -> load and t…
Apr 22, 2021
4138e7b
[OpenCL] Add missing C++ legacy atomics with generic
svenvh Apr 22, 2021
0b10fde
[mlir] Move PyConcreteAttribute to header. NFC.
ftynse Apr 22, 2021
362958a
[C++4OpenCL] Add extra diagnostics for kernel argument types
Apr 22, 2021
f070956
[LoopIdiom] Added testcase for double memset (fixed in LLVM 12); NFC
davidbolvansky Apr 22, 2021
e99b98c
[SLP]Improve cost model for the vectorized extractelements.
alexey-bataev Apr 6, 2021
c1b2a7b
[lld/mac] make a few "named parameter comments" more consistent
nico Apr 22, 2021
da2cdfd
[SLP]Added explicit ref to TargetTransformInfo to try to pacify MSVC
alexey-bataev Apr 22, 2021
d4f5f23
[SLP]Replace more `TTI` with `TTIRef`, NFC.
alexey-bataev Apr 22, 2021
2c551ae
[LoopVectorize] Fix bug where predicated loads/stores were dropped
Mar 31, 2021
ca70512
[OPENMP]Mark test as unsupported to avoid possible unexpected passes,
alexey-bataev Apr 22, 2021
528ee16
[AArch64] Block tryCombineToBSL combines for vectors wider than NEON
Apr 22, 2021
7128146
[lld/mac] tweak comment in a test
nico Apr 22, 2021
f345116
[Hexagon] Unmasked and masked load pair to dame bae -? one load and s…
jcoplin-quic Apr 22, 2021
57ebf3d
[libc++] Re-apply `std::indirectly_readable` and `std::indirectly_wri…
ldionne Apr 22, 2021
3a46667
[PowerPC] Add vec_roundm as alias for vec_floor in altivec.h
nemanjai Apr 22, 2021
51692c6
[PowerPC] Add missing VSX guard for vec_roundm with vector double
nemanjai Apr 22, 2021
1550c47
[PowerPC] Add vec_roundp as alias for vec_ceil
nemanjai Apr 22, 2021
a1d325a
[PowerPC] Add vec_roundz as alias for vec_trunc in altivec.h
nemanjai Apr 22, 2021
a0e6189
[PowerPC] Add vec_xlds to altivec.h
nemanjai Apr 22, 2021
e43963d
[PowerPC] Add vec_load_splats to altivec.h
nemanjai Apr 22, 2021
1cc1d9d
[PowerPC] Add vec_vclz as an alias for vec_cntlz in altivec.h
nemanjai Apr 22, 2021
7a5641d
[PowerPC] Add missing casts for vec_xlds and vec_load_splats
nemanjai Apr 22, 2021
4299ab6
[flang][driver][Revert] Reverts f18 to allow options passed to -W
Apr 22, 2021
e9be1e7
[flang] Fix checking of argument passing for parameterized derived types
psteinfeld Apr 21, 2021
aaf120b
[llvm-profgen] A couple tweaks to the testing harness.
htyu Apr 22, 2021
18c61fc
[SLP]Skip undefs trying to find perfect/shuffled tree entries matching.
alexey-bataev Apr 22, 2021
e697202
[libc++] Fix some typos and remove unused macros. NFCI.
Quuxplusone Apr 19, 2021
b98b6d9
[libc++] Eliminate macro _LIBCPP_UNUSED_VAR. NFCI.
Quuxplusone Apr 19, 2021
1123203
[x86] remove stale comment from test file; NFC
rotateright Apr 22, 2021
123ae42
[flang][openmp] Add General Semantic Checks for Allocate Directive
Apr 22, 2021
5dfbcc5
[libc++] [test] Fix nodiscard_extensions.pass.cpp in _LIBCPP_DEBUG mode.
Quuxplusone Apr 22, 2021
7fdf270
[dfsan] Track origin at loads
stephan-yichao-zhao Apr 21, 2021
803f1e4
[flang] Fix spurious errors from runtime derived type table construction
klausler Apr 21, 2021
ae209aa
Fix memory leak in MicrosoftDemangleNodes's Node::toString
Teemperor Apr 22, 2021
2b6f200
[OpenMP] Add function for setting LIBOMPTARGET_INFO at runtime
jhuber6 Apr 21, 2021
deda60f
[Hexagon] Add HVX intrinsics for conditional vector loads/stores
Apr 22, 2021
77f14c9
[RISCV] Use stack temporary to splat two GPRs into SEW=64 vector on R…
topperc Apr 22, 2021
d616a6b
[lldb] Fix that the expression commands --top-level flag overwrites -…
Teemperor Apr 22, 2021
70254cc
[RISCV] Turn splat shuffles of vector loads into strided load with st…
topperc Apr 22, 2021
149d5a8
[lsan] Temporarily disable new check broken on arm7
vitalybuka Apr 22, 2021
ef5e7f9
Temporarily revert the code part of D100981 "Delete le32/le64 targets"
MaskRay Apr 22, 2021
43831d6
[flang] Update recently added OpenMP tests to use the new driver
banach-space Apr 22, 2021
e250829
[sanitizer] Use COMPILER_RT_EMULATOR with gtests
vitalybuka Apr 20, 2021
d423509
[scudo] Check if MADV_DONTNEED zeroes memory
vitalybuka Apr 22, 2021
37e1458
[NFC] Remove reference to file deleted by D100981.
vitalybuka Apr 22, 2021
9524a05
[RISCV] Support vector type for second operand of vmfge and vmfgt IR …
topperc Apr 22, 2021
d77d56a
[RISCV] Add missing tests for vector type for second operand of vmsgt…
topperc Apr 22, 2021
e01c419
[RISCV] Add IR intrinsics for vmsge(u).vv/vx/vi.
topperc Apr 22, 2021
15e19a2
Revert "[instcombine] Exploit UB implied by nofree attributes"
preames Apr 22, 2021
45340ef
[Driver] Specify -ccc-install-dir for linux-cross test
petrhosek Apr 22, 2021
424d6cb
[SCEV] Compute ranges for lshr recurrences
preames Apr 22, 2021
6863282
Revert "[sanitizer] Use COMPILER_RT_EMULATOR with gtests"
vitalybuka Apr 22, 2021
4e88e58
scudo: Use a table to look up the LSB for computing the odd/even mask…
pcc Apr 22, 2021
47283e1
[flang] (NFC) Document Fortran feature history
klausler Apr 22, 2021
832340c
Fix the triple used in llvm-mca.
redstar Apr 21, 2021
d4ee603
Coverage: Document how to collect a profile without a filesystem
dexonsmith Apr 21, 2021
abf3ca6
[Diagnostics] Restore -Wdeprecated warning when user-declared copy as…
davidbolvansky Apr 22, 2021
d71ee39
Add support of the next Ubuntu (Ubuntu 21.10 - Impish Idri)
sylvestre Apr 22, 2021
a62cbd9
[lldb] Include thread name in crashlog.py output
JDevlieghere Apr 22, 2021
24c1ed3
Revert "[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs instal…
JonChesterfield Apr 22, 2021
2ab6fa3
[M68k][AsmParser][NFC] Remove redundant default cases
mshockwave Apr 22, 2021
007158a
Skip unreliable LLDB tests when running under asan
adrian-prantl Apr 22, 2021
6f4ed8c
[M68k][Disassembler][NFC] Decorate dump methods with LLVM_DUMP_METHOD
mshockwave Apr 22, 2021
c0bf592
[AArch64] Improve vector reverse lowering
davemgreen Apr 22, 2021
16ff1a7
[GlobalOpt] Don't replace alias with aliasee if aliasee is interposable
aeubanks Apr 20, 2021
18a8527
[trace][intel-pt] Fix a crash on unconsumed Expected's Error
jankratochvil Apr 22, 2021
91e90cf
lldb/Instrumentation: NFC-ish use GetFrameCodeAddressForSymbolication()
fredriss Apr 22, 2021
c8102db
Merge from 'main' to 'sycl-web' (#1)
Apr 22, 2021
ab9521a
[Hexagon] Use 'vnot' instead of 'not' in patterns with vectors
Apr 22, 2021
9d1b2bc
[GVN] Regenerate test checks (NFC)
nikic Apr 22, 2021
1d96107
[GVN] Generate LE and BE check lines (NFC)
nikic Apr 22, 2021
e9e2af1
Merge from 'sycl' to 'sycl-web' (#16)
Apr 22, 2021
d5f433d
Revert "Re-land "[Driver] Support default libc++ library location on …
petrhosek Apr 22, 2021
2627f99
[dfsan] Fix Len argument type in call to __dfsan_mem_transfer_callback
Apr 22, 2021
907409a
[AST] Enable AST node introspection on Apple
steveire Apr 22, 2021
06234f7
[Hexagon] Improve lowering of returns of i1
Apr 22, 2021
5185b52
[RISCV] Fix crash with fptosi.sat/fptoui.sat intrinsics on RV64. Add …
topperc Apr 22, 2021
beb5ac8
[flang] (NFC) Break up flang/runtime/reduction.cpp
klausler Apr 22, 2021
2618eaf
[lld-macho][nfc] Clean up some constructor declarations
int3 Apr 22, 2021
aa05439
[lld-macho] Fix min version check
int3 Apr 22, 2021
0b2bc69
[WebAssembly] Put utility functions in Utils directory (NFC)
aheejin Apr 21, 2021
b3e88cc
[WebAssembly] Serialize params/results in MachineFunctionInfo
aheejin Apr 21, 2021
c390621
[WebAssembly] Fix fixEndsAtEndOfFunction for delegate
aheejin Apr 22, 2021
a6500b0
scudo: Optimize getSizeLSBByClassId() by compressing the table into a…
pcc Apr 22, 2021
af91065
Revert "[AST] Enable AST node introspection on Apple"
steveire Apr 22, 2021
86b98c6
llvm-objdump: add --rpaths to macho support
keith Apr 19, 2021
8baba68
[HIP] Support overloaded math functions for hipRTC
yxsamliu Apr 19, 2021
75ecb80
Revert "[lld-macho] Fix min version check"
int3 Apr 22, 2021
484b664
scudo: Only static_assert for compressed LSB format with clang.
pcc Apr 22, 2021
2cdb987
[clang][nfc] Split getOrCheckAMDGPUCodeObjectVersion
JonChesterfield Apr 22, 2021
b49337b
[RISCV] [1/2] Add IR intrinsic for Zbp extension
LevyHsu Apr 22, 2021
8c17a87
[re-land][lld-macho] Fix min version check
int3 Apr 22, 2021
91d3f73
[lldb] Update register state parsing for JSON crashlogs
JDevlieghere Apr 22, 2021
40beb1f
CWG2076: Permit implicit conversions within a single level of braces
zygoloid Apr 22, 2021
15be0c4
Reapply "[AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs inst…
JonChesterfield Apr 23, 2021
879cbac
[libc++][ranges] Add range.cmp: equal_to, not_equal_to, less, etc.
zoecarver Apr 23, 2021
2786e67
[IR][sanitizer] Add module flag "frame-pointer" and set it for cc1 -m…
MaskRay Apr 23, 2021
ed633a1
AMDGPU: Restore atomic fp feature on FP atomic instruction definitions
arsenm Apr 9, 2021
619ecba
[NFC] Fix cpplint warning
vitalybuka Apr 23, 2021
d1bbb85
[gn build] (manually) port 0b2bc69ba29
nico Apr 23, 2021
88b76cb
[lld/mac] slightly improve weak-private-extern.s test
nico Apr 22, 2021
a38ebed
[lld/mac] Implement support for .weak_def_can_be_hidden
nico Apr 22, 2021
914c832
[InlineSpiller] Clean-up isSpillCandBB
Apr 21, 2021
a062140
[NFC] Suppress cpplint warning in test
vitalybuka Apr 23, 2021
14cc1cb
[RISCV] Implement the vneg.v builtin.
Hsiangkai Apr 20, 2021
e8bce83
[X86] Enable compilation of user interrupt handlers.
phoebewang Apr 23, 2021
9011856
[X86][AMX] Try to hoist AMX shapes' def
phoebewang Apr 22, 2021
53673fd
[X86][AMX][NFC] Avoid assert for the same immidiate value
phoebewang Apr 23, 2021
43cd588
[RISCV] Implement the vnot.v builtin.
Hsiangkai Apr 20, 2021
d9a9c99
[LoopReroll] Fix rerolling loop with extra instructions
kawashima-fj Apr 8, 2021
a46bbc1
[cland] Dont emit missing newline warnings when building preamble
kadircet Apr 14, 2021
b1f463d
[AArch64] Fix for BTI landing pad insertion with PAC-RET+bkey.
DanielKristofKiss Apr 23, 2021
63af3c0
[GlobalISel] Remove ConstantFoldingMIRBuilder
jayfoad Apr 22, 2021
027d673
[Debug-Info] change return type to void for attribute adding functions.
Apr 22, 2021
afaf36b
[mlir] Handle strided 1D vector transfer ops in ProgressiveVectorToSCF
matthias-springer Apr 23, 2021
17f6b0c
[MLIR][NFC] Fix warning, trim includes + cleanup in AffineOps.h
bondhugula Apr 22, 2021
f8f3fc1
[lldb][NFC] Delete a checked-in build log in docs/testsuite
Teemperor Apr 23, 2021
ab15417
[mlir] Support dimension permutations in ProgressiveVectorToSCF
matthias-springer Apr 23, 2021
4f5da35
[NewGVN] Track simplification dependencies for phi-of-ops.
fhahn Apr 23, 2021
ab78e09
[mlir][docs] Update `add_mlir_doc` usage
marbre Apr 23, 2021
f6a3e92
[mlir] Use SCF for loops in ProgressiveVectorToSCF
matthias-springer Apr 22, 2021
74854d0
Revert "[NewGVN] Track simplification dependencies for phi-of-ops."
fhahn Apr 23, 2021
a819e73
[mlir] Support broadcast dimensions in ProgressiveVectorToSCF
matthias-springer Apr 23, 2021
c229754
[Clang] Propagate guaranteed alignment for malloc and others
davidbolvansky Apr 23, 2021
545f98e
[mlir] Support masked 1D vector transfer ops in ProgressiveVectorToSCF
matthias-springer Apr 23, 2021
c623945
llvm-objdump: refactor SourcePrinter into separate file. NFC.
TNorthover Feb 15, 2021
64f7fb5
[mlir] Support masked N-D vector transfer ops in ProgressiveVectorToSCF.
matthias-springer Apr 23, 2021
f2bf932
[gn build] Port c623945d707c
llvmgnsyncbot Apr 23, 2021
6914a0e
Revert "[Clang] Propagate guaranteed alignment for malloc and others"
davidbolvansky Apr 23, 2021
151e244
[X86][AMX][NFC] Make comparison operators to be complete
phoebewang Apr 23, 2021
791930d
Re-reapply "[DebugInfo] Use variadic debug values to salvage BinOps a…
SLTozer Apr 22, 2021
2b15262
Recommit "[NewGVN] Track simplification dependencies for phi-of-ops."
fhahn Apr 23, 2021
2fdedf9
[doc] Clarify constrained fcmps behavior
Apr 22, 2021
487ab53
[dexter] Add keyword argument 'on_line' to DexLabel
OCHyams Apr 23, 2021
f3e6f85
[lldb][NFC] Remove a stray unicode character in the LLDB test docs
Teemperor Apr 23, 2021
83b8f8d
[RISCV] Custom lower vector F(MIN|MAX)NUM to vf(min|max)
frasercrmck Apr 22, 2021
ddfbdbf
[clang] Do not crash on template specialization following a fatal error
gislan Apr 15, 2021
5f77e77
[InstCombine] Fixed crash when setting align attr for memalign
davidbolvansky Apr 23, 2021
2cae702
Reland "[Clang] Propagate guaranteed alignment for malloc and others"
davidbolvansky Apr 23, 2021
05c912a
[InstCombine][NFC] add tests for printf("%s", str) --> puts(str)/noop…
yurai007 Apr 23, 2021
8a9fbaa
[InstCombine] Fixed newly added tests; NFC
davidbolvansky Apr 23, 2021
e60d6e9
[llvm][NFC] Fix assert indentation
tbaederr Apr 23, 2021
b583327
AMDGPU: Fix assert on inline asm on gfx90a
arsenm Apr 23, 2021
7b32e8b
[X86] combineSetCCAtomicArith - pull out repeated ops. NFCI.
RKSimon Apr 23, 2021
fd28f71
[lld-macho] Have tests default to targeting macos 10.15
int3 Apr 22, 2021
2912f42
[InstCombine] Added tests for PR50096; NFC
davidbolvansky Apr 23, 2021
fcb45b5
[OpenCL] Fix typo in the test.
Apr 23, 2021
8ad79a5
Merge from 'main' to 'sycl-web' (#299)
Apr 23, 2021
c6981d8
Merge from 'sycl' to 'sycl-web' (#2)
Apr 23, 2021
15ba1c6
Merge from 'main' to 'sycl-web' (#15)
asudarsa Apr 23, 2021
ee5d3a9
Fix build errors after 8a27b4c461357ac45e0d73b9d4ebba081918cb75
Apr 25, 2021
f8b5149
Merge from 'sycl' to 'sycl-web' (#2)
Apr 25, 2021
ced3b7f
Merge from 'main' to 'sycl-web' (#285)
Apr 26, 2021
b265bfc
Merge remote-tracking branch 'otcshare_llvm/sycl-web' into llvmspirv_…
vmaksimo Apr 26, 2021
72f72ae
Translate subprogram debug info before scopes
Nuullll Apr 16, 2021
d8cb9a8
Promote SPV_INTEL_optimization_hints to SPV_KHR_expect_assume
MrSidims Apr 7, 2021
3528b23
Fix macro
MrSidims Apr 7, 2021
1484d3a
Don't remove SPV_INTEL_optimization_hints declaration
MrSidims Apr 12, 2021
07631c8
Fix clang-format
MrSidims Apr 15, 2021
10b44d7
Remove mapping of NoWrite function parameter attribute on qual metadata
MrSidims Apr 6, 2021
76c0776
Add 'willreturn' attribute to OpenCL work-item functions
MrSidims Apr 16, 2021
cf0cb3e
Map NoWrite function parameter attribute on LLVM readonly
MrSidims Apr 7, 2021
23d21d1
Simplify the test
MrSidims Apr 7, 2021
5f46ff3
Add missing lines
MrSidims Apr 9, 2021
b6ee28c
Fix FPGALoopAttr.ll after fd94103
MrSidims Apr 21, 2021
6548c70
Fix -Werror=non-virtual-dtor -Werror=suggest-override errors
wenju-he Apr 26, 2021
a3c8686
Fix trunc-extractelement-spir.ll after fd94103
vmaksimo Apr 26, 2021
290baf6
Revert "Don't remove SPV_INTEL_optimization_hints declaration"
vmaksimo Apr 26, 2021
f7d6423
Revert "Fix macro"
vmaksimo Apr 26, 2021
733c4fc
Revert "Promote SPV_INTEL_optimization_hints to SPV_KHR_expect_assume"
vmaksimo Apr 26, 2021
89c9b6d
Disable test cases which check NewPM pass (OpenMPOpt)
vmaksimo Apr 27, 2021
007575b
[SLP] Fix the cost calculation if non-compatible vectors shuffled
Apr 28, 2021
d4627f2
Change test which checks NewPM module pass (function-attrs)
vmaksimo Apr 29, 2021
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "FoldInitTypeCheck.h"
#include "ForwardDeclarationNamespaceCheck.h"
#include "ForwardingReferenceOverloadCheck.h"
#include "ImplicitWideningOfMultiplicationResultCheck.h"
#include "InaccurateEraseCheck.h"
#include "IncorrectRoundingsCheck.h"
#include "InfiniteLoopCheck.h"
Expand Down Expand Up @@ -60,6 +61,7 @@
#include "TooSmallLoopVariableCheck.h"
#include "UndefinedMemoryManipulationCheck.h"
#include "UndelegatedConstructorCheck.h"
#include "UnhandledExceptionAtNewCheck.h"
#include "UnhandledSelfAssignmentCheck.h"
#include "UnusedRaiiCheck.h"
#include "UnusedReturnValueCheck.h"
Expand Down Expand Up @@ -97,6 +99,8 @@ class BugproneModule : public ClangTidyModule {
"bugprone-forward-declaration-namespace");
CheckFactories.registerCheck<ForwardingReferenceOverloadCheck>(
"bugprone-forwarding-reference-overload");
CheckFactories.registerCheck<ImplicitWideningOfMultiplicationResultCheck>(
"bugprone-implicit-widening-of-multiplication-result");
CheckFactories.registerCheck<InaccurateEraseCheck>(
"bugprone-inaccurate-erase");
CheckFactories.registerCheck<IncorrectRoundingsCheck>(
Expand Down Expand Up @@ -175,6 +179,8 @@ class BugproneModule : public ClangTidyModule {
"bugprone-undelegated-constructor");
CheckFactories.registerCheck<UnhandledSelfAssignmentCheck>(
"bugprone-unhandled-self-assignment");
CheckFactories.registerCheck<UnhandledExceptionAtNewCheck>(
"bugprone-unhandled-exception-at-new");
CheckFactories.registerCheck<UnusedRaiiCheck>(
"bugprone-unused-raii");
CheckFactories.registerCheck<UnusedReturnValueCheck>(
Expand Down
2 changes: 2 additions & 0 deletions clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ add_clang_library(clangTidyBugproneModule
FoldInitTypeCheck.cpp
ForwardDeclarationNamespaceCheck.cpp
ForwardingReferenceOverloadCheck.cpp
ImplicitWideningOfMultiplicationResultCheck.cpp
InaccurateEraseCheck.cpp
IncorrectRoundingsCheck.cpp
InfiniteLoopCheck.cpp
Expand Down Expand Up @@ -55,6 +56,7 @@ add_clang_library(clangTidyBugproneModule
TooSmallLoopVariableCheck.cpp
UndefinedMemoryManipulationCheck.cpp
UndelegatedConstructorCheck.cpp
UnhandledExceptionAtNewCheck.cpp
UnhandledSelfAssignmentCheck.cpp
UnusedRaiiCheck.cpp
UnusedReturnValueCheck.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
//===--- ImplicitWideningOfMultiplicationResultCheck.cpp - clang-tidy -----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "ImplicitWideningOfMultiplicationResultCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"

using namespace clang::ast_matchers;

namespace clang {
namespace {
AST_MATCHER(ImplicitCastExpr, isPartOfExplicitCast) {
return Node.isPartOfExplicitCast();
}
} // namespace
} // namespace clang

namespace clang {
namespace tidy {
namespace bugprone {

static const Expr *getLHSOfMulBinOp(const Expr *E) {
assert(E == E->IgnoreParens() && "Already skipped all parens!");
// Is this: long r = int(x) * int(y); ?
// FIXME: shall we skip brackets/casts/etc?
const auto *BO = dyn_cast<BinaryOperator>(E);
if (!BO || BO->getOpcode() != BO_Mul)
// FIXME: what about: long r = int(x) + (int(y) * int(z)); ?
return nullptr;
return BO->getLHS()->IgnoreParens();
}

ImplicitWideningOfMultiplicationResultCheck::
ImplicitWideningOfMultiplicationResultCheck(StringRef Name,
ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
UseCXXStaticCastsInCppSources(
Options.get("UseCXXStaticCastsInCppSources", true)),
UseCXXHeadersInCppSources(Options.get("UseCXXHeadersInCppSources", true)),
IncludeInserter(Options.getLocalOrGlobal("IncludeStyle",
utils::IncludeSorter::IS_LLVM)) {
}

void ImplicitWideningOfMultiplicationResultCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) {
IncludeInserter.registerPreprocessor(PP);
}

void ImplicitWideningOfMultiplicationResultCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "UseCXXStaticCastsInCppSources",
UseCXXStaticCastsInCppSources);
Options.store(Opts, "UseCXXHeadersInCppSources", UseCXXHeadersInCppSources);
Options.store(Opts, "IncludeStyle", IncludeInserter.getStyle());
}

llvm::Optional<FixItHint>
ImplicitWideningOfMultiplicationResultCheck::includeStddefHeader(
SourceLocation File) {
return IncludeInserter.createIncludeInsertion(
Result->SourceManager->getFileID(File),
ShouldUseCXXHeader ? "<cstddef>" : "<stddef.h>");
}

void ImplicitWideningOfMultiplicationResultCheck::handleImplicitCastExpr(
const ImplicitCastExpr *ICE) {
ASTContext *Context = Result->Context;

const Expr *E = ICE->getSubExpr()->IgnoreParens();
QualType Ty = ICE->getType();
QualType ETy = E->getType();

assert(!ETy->isDependentType() && !Ty->isDependentType() &&
"Don't expect to ever get here in template Context.");

// This must be a widening cast. Else we do not care.
unsigned SrcWidth = Context->getIntWidth(ETy);
unsigned TgtWidth = Context->getIntWidth(Ty);
if (TgtWidth <= SrcWidth)
return;

// Does the index expression look like it might be unintentionally computed
// in a narrower-than-wanted type?
const Expr *LHS = getLHSOfMulBinOp(E);
if (!LHS)
return;

// Ok, looks like we should diagnose this.
diag(E->getBeginLoc(), "performing an implicit widening conversion to type "
"%0 of a multiplication performed in type %1")
<< Ty << E->getType();

{
auto Diag = diag(E->getBeginLoc(),
"make conversion explicit to silence this warning",
DiagnosticIDs::Note)
<< E->getSourceRange();

if (ShouldUseCXXStaticCast)
Diag << FixItHint::CreateInsertion(
E->getBeginLoc(), "static_cast<" + Ty.getAsString() + ">(")
<< FixItHint::CreateInsertion(E->getEndLoc(), ")");
else
Diag << FixItHint::CreateInsertion(E->getBeginLoc(),
"(" + Ty.getAsString() + ")(")
<< FixItHint::CreateInsertion(E->getEndLoc(), ")");
Diag << includeStddefHeader(E->getBeginLoc());
}

QualType WideExprTy;
// Get Ty of the same signedness as ExprTy, because we only want to suggest
// to widen the computation, but not change it's signedness domain.
if (Ty->isSignedIntegerType() == ETy->isSignedIntegerType())
WideExprTy = Ty;
else if (Ty->isSignedIntegerType()) {
assert(ETy->isUnsignedIntegerType() &&
"Expected source type to be signed.");
WideExprTy = Context->getCorrespondingUnsignedType(Ty);
} else {
assert(Ty->isUnsignedIntegerType() &&
"Expected target type to be unsigned.");
assert(ETy->isSignedIntegerType() &&
"Expected source type to be unsigned.");
WideExprTy = Context->getCorrespondingSignedType(Ty);
}

{
auto Diag = diag(E->getBeginLoc(), "perform multiplication in a wider type",
DiagnosticIDs::Note)
<< LHS->getSourceRange();

if (ShouldUseCXXStaticCast)
Diag << FixItHint::CreateInsertion(LHS->getBeginLoc(),
"static_cast<" +
WideExprTy.getAsString() + ">(")
<< FixItHint::CreateInsertion(LHS->getEndLoc(), ")");
else
Diag << FixItHint::CreateInsertion(LHS->getBeginLoc(),
"(" + WideExprTy.getAsString() + ")");
Diag << includeStddefHeader(LHS->getBeginLoc());
}
}

void ImplicitWideningOfMultiplicationResultCheck::handlePointerOffsetting(
const Expr *E) {
ASTContext *Context = Result->Context;

// We are looking for a pointer offset operation,
// with one hand being a pointer, and another one being an offset.
const Expr *PointerExpr, *IndexExpr;
if (const auto *BO = dyn_cast<BinaryOperator>(E)) {
PointerExpr = BO->getLHS();
IndexExpr = BO->getRHS();
} else if (const auto *ASE = dyn_cast<ArraySubscriptExpr>(E)) {
PointerExpr = ASE->getLHS();
IndexExpr = ASE->getRHS();
} else
return;

if (IndexExpr->getType()->isPointerType())
std::swap(PointerExpr, IndexExpr);

if (!PointerExpr->getType()->isPointerType() ||
IndexExpr->getType()->isPointerType())
return;

IndexExpr = IndexExpr->IgnoreParens();

QualType IndexExprType = IndexExpr->getType();

// If the index expression's type is not known (i.e. we are in a template),
// we can't do anything here.
if (IndexExprType->isDependentType())
return;

QualType SSizeTy = Context->getPointerDiffType();
QualType USizeTy = Context->getSizeType();
QualType SizeTy = IndexExprType->isSignedIntegerType() ? SSizeTy : USizeTy;
// FIXME: is there a way to actually get the QualType for size_t/ptrdiff_t?
// Note that SizeTy.getAsString() will be unsigned long/..., NOT size_t!
StringRef TyAsString =
IndexExprType->isSignedIntegerType() ? "ptrdiff_t" : "size_t";

// So, is size_t actually wider than the result of the multiplication?
if (Context->getIntWidth(IndexExprType) >= Context->getIntWidth(SizeTy))
return;

// Does the index expression look like it might be unintentionally computed
// in a narrower-than-wanted type?
const Expr *LHS = getLHSOfMulBinOp(IndexExpr);
if (!LHS)
return;

// Ok, looks like we should diagnose this.
diag(E->getBeginLoc(),
"result of multiplication in type %0 is used as a pointer offset after "
"an implicit widening conversion to type '%1'")
<< IndexExprType << TyAsString;

{
auto Diag = diag(IndexExpr->getBeginLoc(),
"make conversion explicit to silence this warning",
DiagnosticIDs::Note)
<< IndexExpr->getSourceRange();

if (ShouldUseCXXStaticCast)
Diag << FixItHint::CreateInsertion(
IndexExpr->getBeginLoc(),
(Twine("static_cast<") + TyAsString + ">(").str())
<< FixItHint::CreateInsertion(IndexExpr->getEndLoc(), ")");
else
Diag << FixItHint::CreateInsertion(IndexExpr->getBeginLoc(),
(Twine("(") + TyAsString + ")(").str())
<< FixItHint::CreateInsertion(IndexExpr->getEndLoc(), ")");
Diag << includeStddefHeader(IndexExpr->getBeginLoc());
}

{
auto Diag =
diag(IndexExpr->getBeginLoc(), "perform multiplication in a wider type",
DiagnosticIDs::Note)
<< LHS->getSourceRange();

if (ShouldUseCXXStaticCast)
Diag << FixItHint::CreateInsertion(
LHS->getBeginLoc(),
(Twine("static_cast<") + TyAsString + ">(").str())
<< FixItHint::CreateInsertion(LHS->getEndLoc(), ")");
else
Diag << FixItHint::CreateInsertion(LHS->getBeginLoc(),
(Twine("(") + TyAsString + ")").str());
Diag << includeStddefHeader(LHS->getBeginLoc());
}
}

void ImplicitWideningOfMultiplicationResultCheck::registerMatchers(
MatchFinder *Finder) {
Finder->addMatcher(implicitCastExpr(unless(anyOf(isInTemplateInstantiation(),
isPartOfExplicitCast())),
hasCastKind(CK_IntegralCast))
.bind("x"),
this);
Finder->addMatcher(
arraySubscriptExpr(unless(isInTemplateInstantiation())).bind("x"), this);
Finder->addMatcher(binaryOperator(unless(isInTemplateInstantiation()),
hasType(isAnyPointer()),
hasAnyOperatorName("+", "-", "+=", "-="))
.bind("x"),
this);
}

void ImplicitWideningOfMultiplicationResultCheck::check(
const MatchFinder::MatchResult &Result) {
this->Result = &Result;
ShouldUseCXXStaticCast =
UseCXXStaticCastsInCppSources && Result.Context->getLangOpts().CPlusPlus;
ShouldUseCXXHeader =
UseCXXHeadersInCppSources && Result.Context->getLangOpts().CPlusPlus;

if (const auto *MatchedDecl = Result.Nodes.getNodeAs<ImplicitCastExpr>("x"))
handleImplicitCastExpr(MatchedDecl);
else if (const auto *MatchedDecl =
Result.Nodes.getNodeAs<ArraySubscriptExpr>("x"))
handlePointerOffsetting(MatchedDecl);
else if (const auto *MatchedDecl =
Result.Nodes.getNodeAs<BinaryOperator>("x"))
handlePointerOffsetting(MatchedDecl);
}

} // namespace bugprone
} // namespace tidy
} // namespace clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//===--- ImplicitWideningOfMultiplicationResultCheck.h ----------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_IMPLICITWIDENINGOFMULTIPLICATIONRESULTCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_IMPLICITWIDENINGOFMULTIPLICATIONRESULTCHECK_H

#include "../ClangTidyCheck.h"
#include "../utils/IncludeInserter.h"

namespace clang {
namespace tidy {
namespace bugprone {

/// Diagnoses instances of an implicit widening of multiplication result.
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-implicit-widening-of-multiplication-result.html
class ImplicitWideningOfMultiplicationResultCheck : public ClangTidyCheck {
const ast_matchers::MatchFinder::MatchResult *Result;
bool ShouldUseCXXStaticCast;
bool ShouldUseCXXHeader;

llvm::Optional<FixItHint> includeStddefHeader(SourceLocation File);

void handleImplicitCastExpr(const ImplicitCastExpr *ICE);
void handlePointerOffsetting(const Expr *E);

public:
ImplicitWideningOfMultiplicationResultCheck(StringRef Name,
ClangTidyContext *Context);
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;
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;

private:
const bool UseCXXStaticCastsInCppSources;
const bool UseCXXHeadersInCppSources;
utils::IncludeInserter IncludeInserter;
};

} // namespace bugprone
} // namespace tidy
} // namespace clang

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_IMPLICITWIDENINGOFMULTIPLICATIONRESULTCHECK_H
Loading