Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW37) #2432

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 358 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
358 commits
Select commit Hold shift + click to select a range
51d34c0
[TargetLowering] Strip tailing whitespace (NFC)
nikic Aug 29, 2020
f90d73e
[EarlyCSE] add tests for commutative intrinsics; NFC
rotateright Aug 27, 2020
0965272
[EarlyCSE] fold commutable intrinsics
rotateright Aug 29, 2020
5ec2b75
[Instruction] Speculatively undo isIdenticalToWhenDefined() PHI handl…
LebedevRI Aug 29, 2020
b4a2d36
[Sema] ICK_Function_Conversion is a third kind conversion
aaronpuchert Aug 29, 2020
85fce44
[Sema] Simplify ShouldDiagnoseUnusedDecl, NFC
aaronpuchert Aug 29, 2020
8e5b155
[IR] Inline AttrBuilder::addAttribute. It just sets 1 bit. NFC.
d0k Aug 29, 2020
31cdb29
[DSE,MemorySSA] Return early when hitting a MemoryPhi.
fhahn Aug 24, 2020
6ce5b74
[Attributor][NFC] rerun update_test_checks without --scrub-attributes
Aug 29, 2020
1364d85
[Attributor][NFC] Do not manifest noundef for positions to be changed…
okuraofvegetable Aug 29, 2020
961483a
[NFCI][Local] Rewrite EliminateDuplicatePHINodes to optionally check …
LebedevRI Aug 29, 2020
1dcb936
[NFC][Local] EliminateDuplicatePHINodes(): add STATISTIC()
LebedevRI Aug 29, 2020
6d88f6e
Reapply [LVI] Normalize pointer behavior
nikic Dec 4, 2019
a400a61
[LVI] Remove unnecessary lambda capture (NFC)
nikic Aug 29, 2020
5067f4b
[LV] Check opt-for-size before expanding runtime checks.
fhahn Aug 29, 2020
a5be86f
[InstSimplify] Protect against more poison in SimplifyWithOpReplaced …
nikic Aug 29, 2020
88b310f
[InstSimplify] Reduce code duplication in simplifySelectWithICmpCond …
nikic Aug 29, 2020
7a15dfd
[Attributor] Fix AANoUndef identification
okuraofvegetable Aug 29, 2020
a711b5e
[libc++] Add from-scratch configuration files for the test suite
ldionne Aug 28, 2020
f9ca205
[libc++] Move the default site config template alongside other config…
ldionne Aug 29, 2020
1013468
[libc++] Temporarily force-set the LIBCXX_TEST_CONFIG cache value
ldionne Aug 29, 2020
e1d5f7d
[ORC] Add getDFSLinkOrder / getReverseDFSLinkOrder methods to JITDylib.
lhames Aug 29, 2020
4fbf063
Remove OpenBSD/sparc support
brad0 Aug 30, 2020
6ae7b40
Set alignment of .llvmbc and .llvmcmd to 1
MaskRay Aug 30, 2020
7082381
[Attributor][NFC] Fix dependency type in AAUndefinedBehaviorImpl::upd…
okuraofvegetable Aug 30, 2020
a7ca9e0
[Attributor] Fix callsite check in AAUndefinedBehavior
okuraofvegetable Aug 30, 2020
98e5776
[LangRef] State that storing an aggregate fills padding with undef
aqjune Aug 19, 2020
09dcb52
[LangRef] Apply a missing comment from D86189
aqjune Aug 30, 2020
ef01823
[OpenMPOpt][NFC] add reproducer for problem found in D85544
Aug 30, 2020
deb9961
Improve doc comments for several methods returning bools
kamleshbhalui Aug 30, 2020
8d8ce85
[Attributor] Introduce module slice.
Aug 30, 2020
5dfd7cc
Reland [OpenMPOpt] ICV tracking for calls
Aug 30, 2020
daedfb6
[llvm-reduce] Function body reduction: don't forget to unset comdat
Ralender Aug 30, 2020
543c542
[LV] Add some const to RecurrenceDescriptor. NFC
davemgreen Aug 30, 2020
69fac67
[Hexagon] Fix perfect shuffle generation for single vectors
Aug 29, 2020
11cf634
[NFC][compiler-rt] Factor out __div[sdt]i3 and __mod[dt]i3 implementa…
atrosinenko Aug 30, 2020
cb392c8
[CVP] Regenerate test checks (NFC)
nikic Aug 30, 2020
af4581e
[SLP] make commutative check apply only to binops; NFC
rotateright Aug 30, 2020
ed5fe00
[x86] add tests for multi-use fast sqrt/recip; NFC
rotateright Aug 30, 2020
7692cb1
[AArch64] add tests for multi-use fast sqrt/recip; NFC
rotateright Aug 30, 2020
716e35a
[DAGCombiner] skip reciprocal divisor optimization for x/sqrt(x)
rotateright Aug 30, 2020
2d3e128
[FastISel] update to use intrinsic's isCommutative(); NFC
rotateright Aug 30, 2020
7d15ece
[libcxx/variant] Implement workaround for GCC bug.
mpark Aug 30, 2020
eb35ebb
[LV] Update CFG before adding runtime checks.
fhahn Aug 30, 2020
719548d
Fix gcc warning by explicitly initializing the base class copy ctor (…
joker-eph Aug 30, 2020
998709b
[FileCheck] Add precision to format specifier
Jun 11, 2020
c01a4ad
[llvm-reduce] Add test for BB reduction with non-void ret type.
fhahn Aug 30, 2020
81733fd
[X86] Pre-commit the test-shrink.ll changes from D86578.
topperc Aug 30, 2020
42c57c2
[DSE,MemorySSA] Simplify code, EarlierAccess is be a MemoryDef (NFC).
fhahn Aug 30, 2020
58b4623
[GVN] add test for commutative intrinsic; NFC
rotateright Aug 30, 2020
342fea3
[NewGVN] add test for commutative intrinsic; NFC
rotateright Aug 30, 2020
25597f7
[IR][GVN] allow intrinsics in Instruction's isCommutative query
rotateright Aug 30, 2020
86d817d
[DSE,MemorySSA] Skip defs without analyzable write locations.
fhahn Aug 30, 2020
badd726
Revert "[IR][GVN] allow intrinsics in Instruction's isCommutative query"
rotateright Aug 30, 2020
d0518a2
[GVN] add another commutable intrinsic test; NFC
rotateright Aug 30, 2020
86163f8
[InstCombine] add extra-use tests for fmul+sqrt; NFC
venkataramanankumar Aug 30, 2020
389fd30
[Sink][test] Add nounwind test and properly test convergent
MaskRay Aug 31, 2020
f2284e3
[Sink] Optimize/simplify sink candidate finding with nearest common d…
MaskRay Aug 31, 2020
1d01fc1
[Test] Simplify DWARF test cases. NFC.
higuoxing Aug 31, 2020
1c5a0cb
[lldb] Don't crash when LLDB can't extract the tsan report
Teemperor Aug 31, 2020
e9a3d1a
[FileCheck] Move FileCheck implementation out of LLVMSupport into its…
Teemperor Aug 31, 2020
ed89eb3
Revert "[FileCheck] Move FileCheck implementation out of LLVMSupport …
Teemperor Aug 31, 2020
506f89c
[llvm-readobj/elf] - Don't fail when dumping an archive with a member…
Aug 28, 2020
b51321c
[lldb] Fix TestCompletion's pid completion failing randomly
Teemperor Aug 31, 2020
da0d43d
[lldb][NFC] Remove trailing whitespace in TestCompletion
Teemperor Aug 31, 2020
9026d3b
Fix sphinx documentation after a6a37a2fcd2a8048a75bd0d8280497ed89d73224
aganea Aug 31, 2020
1cd99fe
[lldb] tab completion for class `CommandObjectTypeFormatterDelete`
MrHate Aug 31, 2020
db464a2
[NFCI] Silent a build warning due to an extra semi-colon
SouraVX Aug 31, 2020
1b743a9
[analyzer] Add modeling for unique_ptr move constructor
vrnithinkumar Aug 31, 2020
f787c9a
[Flang][NFC] Remove license comments from files in docs/ folder.
Aug 31, 2020
9ff05dc
[x86] add another test for reciprocal sqrt; NFC
rotateright Aug 31, 2020
11e0c5b
[AArch64] add another test for reciprocal sqrt; NFC
rotateright Aug 31, 2020
1c9a09f
[DAGCombiner] skip reciprocal divisor optimization for x/sqrt(x), better
rotateright Aug 31, 2020
f5fd748
[clang-tidy] New check readability-prefer-member-initializer
Dec 12, 2019
14dd073
[Clang-Tidy] New check `bugprone-redundant-branch-condition`
Jun 5, 2020
04b30af
[gn build] Port 14dd0737822
llvmgnsyncbot Aug 31, 2020
077238f
[gn build] Port f5fd7486d6c
llvmgnsyncbot Aug 31, 2020
4163449
Teach the swift calling convention about _Atomic types
aschwaighofer Aug 19, 2020
a9a6e62
[CodeGen] Make sure the EH cleanup for block captures is conditional …
epilk Aug 31, 2020
22808d6
[clang-tidy] Buildbot failure fix for commit rGf5fd7486d6c0
Aug 31, 2020
84875f6
[PowerPC][AIX] Add test for returning a vector type. [NFC]
mandlebug Aug 31, 2020
a5bb247
[llvm-reduce] Create returns with undef values for non-void functions.
fhahn Aug 31, 2020
eb2a405
[NFC] [DAGCombiner] Remove unnecessary negation in visitFNEG
ecnelises Aug 31, 2020
5475154
[NFC] [DAGCombiner] Refactor bitcast folding within fabs/fneg
ecnelises Aug 31, 2020
bc3d4d9
[analyzer] Add bool operator modeling for unque_ptr
vrnithinkumar Aug 31, 2020
44133d9
[X86][CGP] Pre-commit test cases for D86371.
topperc Aug 31, 2020
a54919e
[LLD] [COFF] Error out if creating a DLL with too many exported symbols
mstorsjo Aug 27, 2020
85b4d28
[ARM] Register pressure with -mthumb forces register reload before ea…
Aug 31, 2020
b16ac94
[ORC] Remove a stray semicolon, silencing warnings. NFC.
mstorsjo Aug 31, 2020
c23aefd
[NFC][InstCombine] visitPHINode(): cleanup PHI CSE instruction replac…
LebedevRI Aug 31, 2020
640f20b
[SVE] Remove calls to VectorType::getNumElements from InstCombine
christetreault-llvm Aug 31, 2020
e25449f
[IR][GVN] allow intrinsics in Instruction's isCommutative query (2nd …
rotateright Aug 31, 2020
ab83348
[X86][CGP] Add gather test cases for D86371.
topperc Aug 31, 2020
61e15ec
[docs] Fix indentation in FileCheck.rst
aeubanks Aug 31, 2020
88c6e25
[mlir][OpFormatGen] Add support for specifiy "custom" directives.
River707 Aug 31, 2020
24b8892
[mlir][ODS] Add new SymbolNameAttr and add support for in assemblyFormat
River707 Aug 31, 2020
eaeadce
[mlir][OpFormatGen] Add initial support for regions in the custom op …
River707 Aug 31, 2020
2481846
[mlir][PDL] Move the formats for PatternOp and RewriteOp to the decla…
River707 Aug 31, 2020
8931add
[OpenMPOpt][HideMemTransfersLatency] Get values stored in offload arrays
hamax97 Aug 31, 2020
646f19b
[flang] Format label scope is independent of block scope
klausler Aug 31, 2020
d563d7a
[analyzer][NFC] Add `override` keyword missing from D86027
hubert-reinterpretcast Aug 31, 2020
867de15
[SVE] Mark VectorType::getNumElements() deprecated
christetreault-llvm Aug 31, 2020
297f69a
[lldb] Add reproducer verifier
JDevlieghere Aug 31, 2020
b79e19e
[ORC] Remove an unused variable.
lhames Aug 31, 2020
4cbfd93
[flang] Make `TypeParamInquiry` monomorphic
klausler Aug 25, 2020
474a5a6
[SVE] Remove calls to VectorType::getNumElements() from llvm-stress
christetreault-llvm Aug 31, 2020
f549140
Fix mlir-reduce to explicitly register dialects and disable the globa…
joker-eph Aug 31, 2020
f862d85
[flang] Check shape conformance on initializers
klausler Aug 31, 2020
2bbbcae
[mlir][openacc] Add missing attributes and operands for acc.loop
clementval Aug 31, 2020
1d3d9b9
[OpenMPOpt][NFC] Moving constants as struct static attributes
hamax97 Aug 31, 2020
428b2ff
[DWARFYAML] Make the debug_str section optional.
higuoxing Sep 1, 2020
63844c1
[MemorySSA] Clean up single value phis.
alinas Aug 31, 2020
3c7bfbd
[CMake] Use find_library for ncurses
petrhosek Aug 31, 2020
0da8453
Remove -Wcompound-token-split-by-space from -Wall.
zygoloid Sep 1, 2020
113861b
Fix -Wcompound-token-split to give the same warnings under -E
zygoloid Sep 1, 2020
e7f5304
[Test] Move IndVars test to a proper place
xortator Sep 1, 2020
cff6dda
More accurately compute the ranges of possible values for +, -, *, &, %.
zygoloid Aug 11, 2020
f819dbf
Classify (small unsigned bitfield) < 0 comparisons under
zygoloid Sep 1, 2020
ffd0b31
Revert "[ARM] Register pressure with -mthumb forces register reload b…
davemgreen Sep 1, 2020
9fbb113
[SVE][CodeGen] Fix TypeSize/ElementCount related warnings in sve-spli…
david-arm Aug 26, 2020
a787a4e
[analyzer][StdLibraryFunctionsChecker] Use Optionals throughout the s…
Aug 25, 2020
7c80f2d
Revert "[lldb] Add reproducer verifier"
Teemperor Sep 1, 2020
0381204
[NFCI] Removed an un-used declaration got accidentally introduced in …
SouraVX Sep 1, 2020
7de090a
[llvm-readobj/elf] - Report warnings instead of errors when dumping b…
Aug 28, 2020
6c6984e
[llvm-readobj][test] - Update the comment in archive.test
Sep 1, 2020
ca233be
[llvm-readobj][test] - Remove amdgpu-elf-definitions.test
Aug 28, 2020
722db5c
[libcxx] Link target `cxx_external_threads` to `cxx-headers` for BUIL…
Sep 1, 2020
ea1f513
[llvm-dwarfdump][test] Add tests for dumping the .debug_line_str sect…
higuoxing Sep 1, 2020
bd6ee51
[NFC][Asan] Format includes
vitalybuka Sep 1, 2020
2114f71
[OpenMP] Fix infinite loop in Sema::isOpenMPGlobalCapturedDecl()
nullptr-cpp Sep 1, 2020
5ffd940
Reland [FileCheck] Move FileCheck implementation out of LLVMSupport i…
Teemperor Sep 1, 2020
d48699e
[InstCombine] adjust recip sqrt tests for better coverage; NFC
rotateright Sep 1, 2020
3d90a61
[llvm-readobj] - Remove Error.cpp,.h and drop dependencies in the code.
Aug 28, 2020
5a3ede5
[NFC] Test commit, whitespace changes
abhina-sree Sep 1, 2020
68717ac
[LoopIdiomRecognizePass] Options to disable part or the entire Loop I…
anhtuyenibm Sep 1, 2020
3e1e5f5
[SystemZ][z/OS] Adding initial toolchain for z/OS
abhina-sree Sep 1, 2020
c831a14
[SystemZ][z/OS] Fix build break in z/OS toolchain
abhina-sree Sep 1, 2020
4a9a488
AMDGPU: Convert test to MIR
arsenm Aug 31, 2020
7f5b4ea
AMDGPU: Check some offsets in test
arsenm Aug 31, 2020
0f42d18
PowerPC: Switch test to generated checks
arsenm Sep 1, 2020
18bbd9f
GlobalISel: Artifact combine unmerge of unmerge
arsenm Aug 20, 2020
bc9a29b
Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain"
paulwalker-arm Sep 1, 2020
92090e8
GlobalISel: Implement computeKnownBits for G_UNMERGE_VALUES
arsenm Aug 27, 2020
9e7e1b2
GlobalISel: Implement computeNumSignBits for G_SEXTLOAD/G_ZEXTLOAD
arsenm Aug 28, 2020
061182b
GlobalISel: Add combines for extend operations
Sep 1, 2020
1a633e7
[flang] Improve compile-time shape conformance checking
klausler Aug 31, 2020
ca2227c
[PowerPC] Implement instruction definitions/MC Tests for xvcvspbf16 a…
amy-kwan Sep 1, 2020
15e880a
[DAGCombiner] Fold an AND of a masked load into a zext_masked_load
SamTebbs33 Sep 1, 2020
8df143c
[libc++] Improve REQUIRES for _ExtInt test on recent Clangs
ldionne Sep 1, 2020
0e90d8d
[builtins] Unify the softfloat division implementation
atrosinenko Sep 1, 2020
29ae448
[PowerPC] Handle STRICT_FSETCC(S) in more cases
ecnelises Sep 1, 2020
759482d
GlobalISel: Implement computeKnownBits for G_BSWAP and G_BITREVERSE
arsenm Aug 27, 2020
35c94d3
GlobalISel: Port smarter known bits for umin/umax from DAG
arsenm Aug 27, 2020
32a8a10
GlobalISel: Implement computeNumSignBits for G_SELECT
arsenm Aug 27, 2020
7be8682
[tsan] Fix "failed to intercept sysctlnametomib" on FreeBSD
arichardson Sep 1, 2020
a57fdcd
x87 FPU state instructions do not use an f32 memory location
ericastor Sep 1, 2020
8ad8f48
[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred), _, _)
aemerson Aug 21, 2020
11ddb84
[flang] Fix integer CASE constant typing
klausler Aug 31, 2020
b11c527
[flang] Version information in flang/f18
coti Aug 25, 2020
5ded444
[AArch64][GlobalISel] Optimize away a Not feeding a brcond by using t…
aemerson Aug 23, 2020
96ae43b
[Bitstream] Use alignTo to make code more readable. NFC
topperc Sep 1, 2020
fecc27d
[PowerPC][AIX] Update save/restore offset for frame and base pointers.
mandlebug Sep 1, 2020
2665425
[libfuzzer] Reduce default verbosity when printing large mutation seq…
mhlakhani Sep 1, 2020
ab919ee
[gn build] port 5ffd940ac02 a bit more
nico Sep 1, 2020
1914fc9
[gn build] Port 3d90a61cf2e
llvmgnsyncbot Sep 1, 2020
293fc6c
[gn build] Port 3e1e5f54492
llvmgnsyncbot Sep 1, 2020
40fed00
First commit on the release/11.x branch.
zmodem Jul 15, 2020
cb89127
[fuzzer] Create user provided fuzzer writeable directories when reque…
morehouse Sep 1, 2020
93eed63
[builtins] Make __div[sdt]f3 handle denormal results
atrosinenko Aug 27, 2020
c292fba
[MemorySSA] Update phi map with replacement value.
alinas Sep 1, 2020
10670bd
Revert "[fuzzer] Create user provided fuzzer writeable directories wh…
morehouse Sep 1, 2020
99f3b23
[libc++] Workaround timespec_get not always being available in Apple …
ldionne Sep 1, 2020
ae95cee
[OpenMP] Consolidate error handling and debug messages in Libomptarget
jhuber6 Aug 28, 2020
5987da8
Revert "Revert "Reapply D70800: Fix AArch64 AAPCS frame record chain""
resistor Sep 1, 2020
3e753ce
[ORC] Add unit test for HasMaterializationSideEffectsOnly failure beh…
lhames Sep 1, 2020
b1f3948
Do not emit "-tune-cpu generic" for PS4 platform
dyung Sep 1, 2020
96f0b57
[Bindings] Add LLVMAddInstructionSimplifyPass
aeubanks Aug 28, 2020
4783e2c
[MachineCopyPropagation] In isNopCopy, check the destination register…
topperc Sep 1, 2020
d7e16ca
[LV] Interleave to expose ILP for small loops with scalar reductions.
AaronHLiu Sep 1, 2020
7139736
Revert "[libfuzzer] Reduce default verbosity when printing large muta…
morehouse Sep 1, 2020
0d966ae
[Loads] Add canReplacePointersIfEqual helper.
fhahn Sep 1, 2020
c90f15d
[NFC] Fix unused var in release build
rupprecht Sep 1, 2020
1f4e746
[amdgpu] Run SROA after loop unrolling.
darkbuck Jul 20, 2020
8693ddc
Revert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inverse(pred…
rupprecht Sep 1, 2020
137dfd6
[LangRef] Fix condition for when a loop is considered parallel.
Meinersbur Sep 1, 2020
431bb8b
[mlir][ODS] Use c++ types for integer attributes of fixed width when …
River707 Sep 1, 2020
8ca00c5
Thread safety analysis: More consistent warning message
aaronpuchert Sep 1, 2020
5538339
[builtins] Fix divtf3_test.c
atrosinenko Sep 1, 2020
520ab71
Revert "Revert "[GlobalISel] Fold xor(cmp(pred, _, _), 1) -> cmp(inve…
aemerson Sep 1, 2020
fad7559
[llvm] [unittests] Remove temporary files after they're not needed
broadwaylamb Jul 6, 2020
478eb98
[Docs] Remove outdated OS limitation
Sep 1, 2020
cfe2b81
[SVE] Update INSERT_SUBVECTOR DAGCombine to use getVectorElementCount().
Sep 1, 2020
224d815
[llvm] [unittests] Fix failing test 'FileCollectorTest.addDirectory'
broadwaylamb Sep 1, 2020
0c2d872
[PowerPC] Implement builtins for xvcvspbf16 and xvcvbf16spn
amy-kwan Sep 1, 2020
49dda4e
[libFuzzer] Break dependency on common_interface_defs.h
morehouse Sep 1, 2020
8d65504
[mlir][vulkan-runner] Explicitly export vulkan-runtime-wrapper entry …
ThomasRaoux Sep 1, 2020
663f4f7
[clang] consistently use getLangOpts()
nickdesaulniers Aug 25, 2020
94948f3
[ADT] Make Optional a literal type.
varungandhi-apple Aug 21, 2020
7cd6b0c
[clang] Do not consider the template arguments of bases to be bases t…
HighCommander4 Aug 24, 2020
ca842c8
[clangd] Handle templates more consistently in type hierarchy
HighCommander4 Aug 31, 2020
0224738
[lldb/interpreter] Improve REPL init file compatibility
medismailben Sep 1, 2020
82139b8
Simplify Symbol Status Message to Only Debug Info Size
Sep 1, 2020
2027669
[NFC] Fix unused var in release builds.
rupprecht Sep 1, 2020
9390b34
[lldb] Move ScriptCommand and RegexCommand under Commands (NFC)
JDevlieghere Sep 2, 2020
1ccfb52
[MemCpyOptimizer] Preserve analyses and replace use of lambdas to get…
alinas Feb 7, 2020
369f916
[DebugInfo] Simplify string table dumpers.
higuoxing Sep 2, 2020
0ffbbce
Don't take the expression range into account when looking for widening
zygoloid Sep 2, 2020
057028e
Revert switch based variant temporarily.
EricWF Sep 2, 2020
7ff335a
[ORC] Fix MachOPlatform's synthetic symbol dependence registration.
lhames Sep 2, 2020
c40ce0d
[ORC] Add an early out for MachOPlatform's init-scraper plugin setup.
lhames Sep 2, 2020
ce66089
Fix build-bots.
alinas Sep 2, 2020
bd09e0d
[ORC] Remove stray debugging output.
lhames Sep 2, 2020
dc67340
[CMake] Remove -Wl,-allow-shlib-undefined which was added in rL221530
MaskRay Aug 29, 2020
b21ddde
[RFC][Target] Add a new triple called Triple::csky
zixuan-wu Sep 2, 2020
1258baf
Merge from 'sycl' to 'sycl-web'
Sep 2, 2020
284d318
Merge from 'master' to 'sycl-web' (#1)
MoringLiu Sep 2, 2020
1d99472
[mlir] Add Complex Type, Vector Type and Tuple Type subclasses to pyt…
zhanghb97 Sep 2, 2020
7558e9e
[Attributor] Fix AANoUndef initialization
okuraofvegetable Sep 2, 2020
5d13479
[Attributor] Make use of AANoUndef in AAUndefinedBehavior
okuraofvegetable Sep 2, 2020
8142425
Revert "[libc++] Workaround timespec_get not always being available i…
Teemperor Sep 2, 2020
21d02dc
[X86][SSE] SimplifyDemandedVectorEltsForTargetNode - add general shuf…
RKSimon Sep 2, 2020
2bf491c
[mlir][VectorOps] Fail fast when a strided memref is passed to vector…
d0k Sep 1, 2020
4820af2
[X86] Remove superfluous trailing semicolons, fixing warnings. NFC.
mstorsjo Sep 2, 2020
71eed48
[DebugInfo] Remove Dwarf5AccelTableWriter::Header::UnitLength. NFC.
igorkudrin Sep 2, 2020
3445ec9
[DebugInfo] Emit a 1-byte value as a terminator of entries list in th…
igorkudrin Sep 2, 2020
f13beac
[AArch64][SVE] Preserve full vector regs over EH edge.
sdesmalen-arm Sep 2, 2020
4bdab2e
[AMDGPU] Fix offset for REL32_HI relocs
jayfoad Sep 1, 2020
f721212
[SVE] Don't reorder subvector/binop sequences when the resulting bino…
paulwalker-arm Aug 21, 2020
94f5d24
[mlir] Extend BufferAssignmentTypeConverter with result conversion ca…
Jul 31, 2020
8a3907c
[Test] Simplify test by removing unneeded variable
xortator Sep 2, 2020
c4a2a13
Move all fields of '-cc1' option related classes into def file databases
daniel-grumberg Aug 19, 2020
9321609
Merge from 'sycl' to 'sycl-web'
Sep 2, 2020
b1169bd
Merge from 'master' to 'sycl-web' (#1)
Sep 3, 2020
b33989c
Merge remote-tracking branch sycl-web into llvmspirv_pulldown
vladimirlaz Sep 7, 2020
016e3d1
Support of SPV_INTEL_variable_length_array
AlexeySotkin Jun 29, 2020
de59b6e
Support 1024-bit constants (#719)
AlexeySachkov Aug 31, 2020
51366c7
Fix inlined-formal-parameter LIT test after LLVM update (#722)
AlexeySachkov Sep 1, 2020
65daffe
Lower UIToFPInst with bool operand (#721)
Fznamznon Sep 1, 2020
5a28d4e
Improve error reporting (#693)
fadeeval Sep 1, 2020
bbd225b
Do not emit OpDecorationGroup and OpGroupDecorate
Fznamznon Sep 1, 2020
1ef5316
Add a test for consumption
Fznamznon Sep 2, 2020
fed680e
Do not use std::set in getRequiredExtensions
AlexeySachkov Aug 24, 2020
73c07bb
Replace the IVDep index group validity assertion (#723)
Sep 3, 2020
23a6952
Refactor Access Qualifiers
NikitaRudenkoIntel Aug 28, 2020
bbefc42
Add llvm:Optional to SPIRVStream.h
NikitaRudenkoIntel Sep 3, 2020
525781b
Implement OpTypeBufferSurfaceINTEL according to the spec published at…
NikitaRudenkoIntel Sep 1, 2020
f7ef4c0
Fix build
AlexeySachkov Sep 3, 2020
e24fc16
[SYCL] fix build of unittests after LLVM commit 3c7bfbd6
vladimirlaz Aug 24, 2020
8736025
Revert "[SYCL] XFAIL test failing in public"
vladimirlaz Sep 7, 2020
0730882
[SYCL] XFAIL test blcoking pulldown
vladimirlaz Sep 7, 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 @@ -38,6 +38,7 @@
#include "NotNullTerminatedResultCheck.h"
#include "ParentVirtualCallCheck.h"
#include "PosixReturnCheck.h"
#include "RedundantBranchConditionCheck.h"
#include "ReservedIdentifierCheck.h"
#include "SignedCharMisuseCheck.h"
#include "SizeofContainerCheck.h"
Expand Down Expand Up @@ -119,6 +120,8 @@ class BugproneModule : public ClangTidyModule {
"bugprone-move-forwarding-reference");
CheckFactories.registerCheck<MultipleStatementMacroCheck>(
"bugprone-multiple-statement-macro");
CheckFactories.registerCheck<RedundantBranchConditionCheck>(
"bugprone-redundant-branch-condition");
CheckFactories.registerCheck<cppcoreguidelines::NarrowingConversionsCheck>(
"bugprone-narrowing-conversions");
CheckFactories.registerCheck<NoEscapeCheck>("bugprone-no-escape");
Expand Down
1 change: 1 addition & 0 deletions clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ add_clang_library(clangTidyBugproneModule
NotNullTerminatedResultCheck.cpp
ParentVirtualCallCheck.cpp
PosixReturnCheck.cpp
RedundantBranchConditionCheck.cpp
ReservedIdentifierCheck.cpp
SignedCharMisuseCheck.cpp
SizeofContainerCheck.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
//===--- RedundantBranchConditionCheck.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 "RedundantBranchConditionCheck.h"
#include "../utils/Aliasing.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Analysis/Analyses/ExprMutationAnalyzer.h"
#include "clang/Lex/Lexer.h"

using namespace clang::ast_matchers;
using clang::tidy::utils::hasPtrOrReferenceInFunc;

namespace clang {
namespace tidy {
namespace bugprone {

static const char CondVarStr[] = "cond_var";
static const char OuterIfStr[] = "outer_if";
static const char InnerIfStr[] = "inner_if";
static const char FuncStr[] = "func";

/// Returns whether `Var` is changed in `S` before `NextS`.
static bool isChangedBefore(const Stmt *S, const Stmt *NextS,
const VarDecl *Var, ASTContext *Context) {
ExprMutationAnalyzer MutAn(*S, *Context);
const auto &SM = Context->getSourceManager();
const Stmt *MutS = MutAn.findMutation(Var);
return MutS &&
SM.isBeforeInTranslationUnit(MutS->getEndLoc(), NextS->getBeginLoc());
}

void RedundantBranchConditionCheck::registerMatchers(MatchFinder *Finder) {
const auto ImmutableVar =
varDecl(anyOf(parmVarDecl(), hasLocalStorage()), hasType(isInteger()),
unless(hasType(isVolatileQualified())))
.bind(CondVarStr);
Finder->addMatcher(
ifStmt(
hasCondition(ignoringParenImpCasts(anyOf(
declRefExpr(hasDeclaration(ImmutableVar)),
binaryOperator(hasOperatorName("&&"),
hasEitherOperand(ignoringParenImpCasts(declRefExpr(
hasDeclaration(ImmutableVar)))))))),
hasThen(hasDescendant(
ifStmt(hasCondition(ignoringParenImpCasts(
anyOf(declRefExpr(hasDeclaration(
varDecl(equalsBoundNode(CondVarStr)))),
binaryOperator(
hasAnyOperatorName("&&", "||"),
hasEitherOperand(ignoringParenImpCasts(
declRefExpr(hasDeclaration(varDecl(
equalsBoundNode(CondVarStr)))))))))))
.bind(InnerIfStr))),
forFunction(functionDecl().bind(FuncStr)))
.bind(OuterIfStr),
this);
// FIXME: Handle longer conjunctive and disjunctive clauses.
}

void RedundantBranchConditionCheck::check(const MatchFinder::MatchResult &Result) {
const auto *OuterIf = Result.Nodes.getNodeAs<IfStmt>(OuterIfStr);
const auto *InnerIf = Result.Nodes.getNodeAs<IfStmt>(InnerIfStr);
const auto *CondVar = Result.Nodes.getNodeAs<VarDecl>(CondVarStr);
const auto *Func = Result.Nodes.getNodeAs<FunctionDecl>(FuncStr);

// If the variable has an alias then it can be changed by that alias as well.
// FIXME: could potentially support tracking pointers and references in the
// future to improve catching true positives through aliases.
if (hasPtrOrReferenceInFunc(Func, CondVar))
return;

if (isChangedBefore(OuterIf->getThen(), InnerIf, CondVar, Result.Context))
return;

auto Diag = diag(InnerIf->getBeginLoc(), "redundant condition %0") << CondVar;

// For standalone condition variables and for "or" binary operations we simply
// remove the inner `if`.
const auto *BinOpCond = dyn_cast<BinaryOperator>(InnerIf->getCond());
if (isa<DeclRefExpr>(InnerIf->getCond()->IgnoreParenImpCasts()) ||
(BinOpCond && BinOpCond->getOpcode() == BO_LOr)) {
SourceLocation IfBegin = InnerIf->getBeginLoc();
const Stmt *Body = InnerIf->getThen();
const Expr *OtherSide = nullptr;
if (BinOpCond) {
const auto *LeftDRE =
dyn_cast<DeclRefExpr>(BinOpCond->getLHS()->IgnoreParenImpCasts());
if (LeftDRE && LeftDRE->getDecl() == CondVar)
OtherSide = BinOpCond->getRHS();
else
OtherSide = BinOpCond->getLHS();
}

SourceLocation IfEnd = Body->getBeginLoc().getLocWithOffset(-1);

// For compound statements also remove the left brace.
if (isa<CompoundStmt>(Body))
IfEnd = Body->getBeginLoc();

// If the other side has side effects then keep it.
if (OtherSide && OtherSide->HasSideEffects(*Result.Context)) {
SourceLocation BeforeOtherSide =
OtherSide->getBeginLoc().getLocWithOffset(-1);
SourceLocation AfterOtherSide =
Lexer::findNextToken(OtherSide->getEndLoc(), *Result.SourceManager,
getLangOpts())
->getLocation();
Diag << FixItHint::CreateRemoval(
CharSourceRange::getTokenRange(IfBegin, BeforeOtherSide))
<< FixItHint::CreateInsertion(AfterOtherSide, ";")
<< FixItHint::CreateRemoval(
CharSourceRange::getTokenRange(AfterOtherSide, IfEnd));
} else {
Diag << FixItHint::CreateRemoval(
CharSourceRange::getTokenRange(IfBegin, IfEnd));
}

// For comound statements also remove the right brace at the end.
if (isa<CompoundStmt>(Body))
Diag << FixItHint::CreateRemoval(
CharSourceRange::getTokenRange(Body->getEndLoc(), Body->getEndLoc()));

// For "and" binary operations we remove the "and" operation with the
// condition variable from the inner if.
} else {
const auto *CondOp = cast<BinaryOperator>(InnerIf->getCond());
const auto *LeftDRE =
dyn_cast<DeclRefExpr>(CondOp->getLHS()->IgnoreParenImpCasts());
if (LeftDRE && LeftDRE->getDecl() == CondVar) {
SourceLocation BeforeRHS =
CondOp->getRHS()->getBeginLoc().getLocWithOffset(-1);
Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
CondOp->getLHS()->getBeginLoc(), BeforeRHS));
} else {
SourceLocation AfterLHS =
Lexer::findNextToken(CondOp->getLHS()->getEndLoc(),
*Result.SourceManager, getLangOpts())
->getLocation();
Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange(
AfterLHS, CondOp->getRHS()->getEndLoc()));
}
}
}

} // namespace bugprone
} // namespace tidy
} // namespace clang
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//===--- RedundantBranchConditionCheck.h - clang-tidy -----------*- 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_REDUNDANTBRANCHCONDITIONCHECK_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_REDUNDANTBRANCHCONDITIONCHECK_H

#include "../ClangTidyCheck.h"

namespace clang {
namespace tidy {
namespace bugprone {

/// Finds condition variables in nested `if` statements that were also checked
/// in the outer `if` statement and were not changed.
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone-redundant-branch-condition.html
class RedundantBranchConditionCheck : public ClangTidyCheck {
public:
RedundantBranchConditionCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
};

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

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_BUGPRONE_REDUNDANTBRANCHCONDITIONCHECK_H
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ add_clang_library(clangTidyCppCoreGuidelinesModule
NarrowingConversionsCheck.cpp
NoMallocCheck.cpp
OwningMemoryCheck.cpp
PreferMemberInitializerCheck.cpp
ProBoundsArrayToPointerDecayCheck.cpp
ProBoundsConstantArrayIndexCheck.cpp
ProBoundsPointerArithmeticCheck.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "NarrowingConversionsCheck.h"
#include "NoMallocCheck.h"
#include "OwningMemoryCheck.h"
#include "PreferMemberInitializerCheck.h"
#include "ProBoundsArrayToPointerDecayCheck.h"
#include "ProBoundsConstantArrayIndexCheck.h"
#include "ProBoundsPointerArithmeticCheck.h"
Expand Down Expand Up @@ -66,6 +67,8 @@ class CppCoreGuidelinesModule : public ClangTidyModule {
"cppcoreguidelines-non-private-member-variables-in-classes");
CheckFactories.registerCheck<OwningMemoryCheck>(
"cppcoreguidelines-owning-memory");
CheckFactories.registerCheck<PreferMemberInitializerCheck>(
"cppcoreguidelines-prefer-member-initializer");
CheckFactories.registerCheck<ProBoundsArrayToPointerDecayCheck>(
"cppcoreguidelines-pro-bounds-array-to-pointer-decay");
CheckFactories.registerCheck<ProBoundsConstantArrayIndexCheck>(
Expand Down
Loading