- Jun 10, 2022
-
-
Shivam Gupta authored
-
Markus Mützel authored
The implementation of the Lock class on Windows currently uses C++ mutexes. That introduces a dependency on the C++ runtime on that platform. Use a Windows CriticalSection instead of a std::mutex to avoid that dependency. This works for me with MinGW (tested in a CLANG64 environment of MSYS2). See also D126291. Differential Revision: https://reviews.llvm.org/D127316
-
Balazs Benics authored
D126215 removed the `AnalysisStoreOpt` field, so `clang-tidy` should not refer to it. http://45.33.8.238/linux/78232/step_4.txt ../../clang-tools-extra/clang-tidy/ClangTidy.cpp:444:22: error: no member named 'AnalysisStoreOpt' in 'clang::AnalyzerOptions' AnalyzerOptions->AnalysisStoreOpt = RegionStoreModel; ~~~~~~~~~~~~~~~~~^ ../../clang-tools-extra/clang-tidy/ClangTidy.cpp:444:41: error: use of undeclared identifier 'RegionStoreModel' AnalyzerOptions->AnalysisStoreOpt = RegionStoreModel; This one liner patch should resolve the build failure. Differential Revision: https://reviews.llvm.org/D126215
-
Balazs Benics authored
This flag was introduced by https://github.com/llvm/llvm-project/commit/6818991d7165f68fe196922d9e5c6648dd57cc47 commit 6818991d Author: Ted Kremenek <kremenek@apple.com> Date: Mon Dec 7 22:06:12 2009 +0000 Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks. The last reference was removed by this commit: https://github.com/llvm/llvm-project/commit/5c32dfc5fb1cfcff8ae3671284e17daa8da3a188 commit 5c32dfc5 Author: Anna Zaks <ganna@apple.com> Date: Fri Dec 21 01:19:15 2012 +0000 [analyzer] Add blocks and ObjC messages to the call graph. This paves the road for constructing a better function dependency graph. If we analyze a function before the functions it calls and inlines, there is more opportunity for optimization. Note, we add call edges to the called m...
-
Alex Zinenko authored
In the transform dialect, a transform IR handle may be pointing to a payload IR operation that is an ancestor of another payload IR operation pointed to by another handle. If such a "parent" handle is consumed by a transformation, this indicates that the associated operation is likely rewritten, which in turn means that the "child" handle may now be associated with a dangling pointer or a pointer to a different operation than originally. Add a handle invalidation mechanism to guard against such situations by reporting errors at runtime. Reviewed By: springerm Differential Revision: https://reviews.llvm.org/D127480
-
Balazs Benics authored
Reviewed By: martong Differential Revision: https://reviews.llvm.org/D126216
-
Andrzej Warzynski authored
This relatively small change will allow Flang's frontend driver, `flang-new -fc1`, to consume and parse MLIR files. Semantically (i.e. from user's perspective) this is identical to reading LLVM IR files. Two file extensions are associated with MLIR files: .fir and .mlir. Note that reading MLIR files makes only sense when running one of the code-generation actions, i.e. when using one of the following action flags: -S, -emit-obj, -emit-llvm, -emit-llvm-bc. The majority of tests that required `tco` to run are updated to also run with `flang-new -fc1`. A few tests are updated to use `fir-opt` instead of `tco` (that's the preferred choice when testing a particular MLIR pass). basic-program.fir is not updated as that test is intended to verify the behaviour of `tco` specifically. Differential Revision: https://reviews.llvm.org/D126890
-
Balazs Benics authored
I'm trying to remove unused options from the `Analyses.def` file, then merge the rest of the useful options into the `AnalyzerOptions.def`. Then make sure one can set these by an `-analyzer-config XXX=YYY` style flag. Then surface the `-analyzer-config` to the `clang` frontend; After all of this, we can pursue the tablegen approach described https://discourse.llvm.org/t/rfc-tablegen-clang-static-analyzer-engine-options-for-better-documentation/61488 In this patch, I'm proposing flag deprecations. We should support deprecated analyzer flags for exactly one release. In this case I'm planning to drop this flag in `clang-16`. In the clang frontend, now we won't pass this option to the cc1 frontend, rather emit a warning diagnostic reminding the users about this deprecated flag, which will be turned into error in clang-16. Unfortunately, I had to remove all the tests referring to this flag, causing a mass change. I've also added a test for checking this warning. I've seen that `scan-build` also uses this flag, but I think we should remove that part only after we turn this into a hard error. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D126215
-
Bin Cheng authored
This patch improves the fix in D110529 to prevent from crashing on value with byval attribute that is not added in SCCP solver. Authored-by:
<sinan.lin@linux.alibaba.com> Reviewed By: ChuanqiXu Differential Revision: https://reviews.llvm.org/D126355
-
Dmitry Preobrazhensky authored
Differential Revision: https://reviews.llvm.org/D127198
-
LLVM GN Syncbot authored
-
LLVM GN Syncbot authored
-
Andrzej Warzynski authored
Until now, `-x` wasn't really taken into account in Flang's compiler and frontend drivers. `flang-new` and `flang-new -fc1` only recently gained powers to consume inputs other than Fortran files and that's probably why this hasn't been noticed yet. This patch makes sure that `-x` is supported correctly and consistently with Clang. To this end, verification is added when reading LLVM IR files (i.e. IR modules are verified with `llvm::verifyModule`). This way, LLVM IR parsing errors are correctly reported to Flang users. This also aids testing. With the new functionality, we can verify that `-x ir` breaks compilation for e.g. Fortran files and vice-versa. Tests are updated accordingly. Differential Revision: https://reviews.llvm.org/D127207
-
Simon Tatham authored
By both AAPCS32 and AAPCS64, the test for whether an aggregate qualifies as homogeneous (either HFA or HVA) is based on the data layout alone. So any logical member of the structure that does not affect the data layout also should not affect homogeneity. In particular, an empty bitfield ('int : 0') should make no difference. In fact, clang considered it to make a difference in C but not in C++, and justified that policy as compatible with gcc. But that's considered a bug in gcc as well (at least for Arm targets), and it's fixed in gcc 12.1. This fix mimics gcc's: zero-sized bitfields are now ignored in all languages for the Arm (32- and 64-bit) ABIs. But I've left the previous behaviour unchanged in other ABIs, by means of adding an ABIInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate query method which the Arm subclasses override. Reviewed By: lenary Differential Revision: https://reviews.llvm.org/D127197 -
Nico Weber authored
-
Balazs Benics authored
I've faced crashes in the past multiple times when some `check::EndAnalysis` callback caused some crash. It's really anoying that it doesn't tell which function triggered this callback. This patch adds the well-known trace for that situation as well. Example: 1. <eof> parser at end of file 2. While analyzing stack: #0 Calling test11 Note that this does not have tests. I've considered `unittests` for this purpose, by using the `ASSERT_DEATH()` similarly how we check double eval called functions in `ConflictingEvalCallsTest.cpp`, however, that the testsuite won't invoke the custom handlers. Only the message of the `llvm_unreachable()` will be printed. Consequently, it's not applicable for us testing this feature. I've also considered using an end-to-end LIT test for this. For that, we would need to somehow overload the `clang_analyzer_crash()` `ExprInspection` handler, to get triggered by other events than the `EvalCall`. I'm not saying that we could not come up with a generic way of causing crash in a specific checker callback, but I'm not sure if that would worth the effort. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D127389 -
David Sherwood authored
We already have patterns for matching fadd(select(..., -0.0)), but an upcoming patch will lead to patterns using +0.0 as the identity instead of -0.0. I'm adding support for these patterns now to avoid any regressions for MVE. Differential Revision: https://reviews.llvm.org/D127275
-
Nikolas Klauser authored
Reviewed By: ldionne, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D126593
-
Nikolas Klauser authored
Reviewed By: var-const, #libc Spies: libcxx-commits, mgorny Differential Revision: https://reviews.llvm.org/D126283
-
Nikita Popov authored
This is a recurring pattern, add an API function for it.
-
David Green authored
This adds a fold for aggressive instcombine that converts smin(smax(fptosi(x))) into a llvm.fptosi.sat, providing that the saturation constants are correct and the cost of the llvm.fptosi.sat is lower. Unfortunately, a llvm.fptosi.sat cannot always be converted back to a smin/smax/fptosi. The llvm.fptosi.sat intrinsic is more defined that the original, which produces poison if the original fptosi was out of range. The llvm.fptosi.sat will saturate any value, so needs to be expanded to a fptosi(fpmin(fpmax(x))), which can be worse for codegeneration depending on the target. So this change thais conditional on the backend reporting that the llvm.fptosi.sat is cheaper that the original smin+smax+fptost. This is a change to the way that AggressiveInstrcombine has worked in the past. Instead of just being a canonicalization pass, that canonicalization can be dependant on the target in certain specific cases. Differential Revision: https://reviews.llvm.org/D125755
-
Michał Górny authored
Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.llvm.org/D126982
-
Matthias Springer authored
There are various shortcuts in `BufferizationState::getBuffer` that avoid a buffer copy when we just need an allocation (and no initialization). This change adds those shortcuts to the TensorCopyInsertion pass, so that `getBuffer` can be simplified in a subsequent change. Differential Revision: https://reviews.llvm.org/D126821
-
Benjamin Kramer authored
-
isuckatcs authored
There was one missing parenthesis and a typo in the mentioned part of the documentation. Differential Revision: https://reviews.llvm.org/D124738
-
Kirill Okhotnikov authored
Some function added in preparation to fmod commit. Differential Revision: https://reviews.llvm.org/D127097
-
Balázs Kéri authored
Fix a case of importing a function with auto return type that is resolved with a type template argument that is declared inside the function. Fixes #55500 Reviewed By: martong Differential Revision: https://reviews.llvm.org/D127396
-
Kirill Okhotnikov authored
Added test handler in preparation to fmod/fmodf commit. Differential Revision: https://reviews.llvm.org/D127091
-
Nikita Popov authored
Update the EarlyCSE tests to use opaque pointers. Worth noting that this leaves some bitcast ptr to ptr instructions in the input IR behind which are no longer necessary. This is because these use numbered instructions, so it's hard to drop them in an automated fashion (as it would require renumbering all other instructions as well). I'm leaving that as a problem for another day. The test updates have been performed using https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34. Differential Revision: https://reviews.llvm.org/D127278
-
Nikita Popov authored
Export the driver-template.cpp.in file so that tools using GENERATE_DRIVER work in standalone builds (currently only relevant for clang). I've given the file an llvm- prefix, as we're now searching for the file in CMAKE_MODULE_PATH. Differential Revision: https://reviews.llvm.org/D127384
-
Nikita Popov authored
D125887 changed the ctlz/cttz despeculation transform to insert a freeze for the introduced branch on zero. While this does fix the "branch on poison" issue, we may still get in trouble if we pick a different value for the branch and for the ctz argument (i.e. non-zero for the branch, but zero for the ctz). To avoid this, we should use the same frozen value in both positions. This does cause a regression in RISCV codegen by introducing an additional sext. The DAG looks like this: t0: ch = EntryToken t2: i64,ch = CopyFromReg t0, Register:i64 %3 t4: i64 = AssertSext t2, ValueType:ch:i32 t23: i64 = freeze t4 t9: ch = CopyToReg t0, Register:i64 %0, t23 t16: ch = CopyToReg t0, Register:i64 %4, Constant:i64<32> t18: ch = TokenFactor t9, t16 t25: i64 = sign_extend_inreg t23, ValueType:ch:i32 t24: i64 = setcc t25, Constant:i64<0>, seteq:ch t28: i64 = and t24, Constant:i64<1> t19: ch = brcond t18, t28, BasicBlock:ch<cond.end 0x8311f68> t21: ch = br t19, BasicBlock:ch<cond.false 0x8311e80> I don't see a really obvious way to improve this, as we can't push the freeze past the AssertSext (which may produce poison). Differential Revision: https://reviews.llvm.org/D126638 -
Jay Foad authored
Add new intrinsic and codegen support for the s_sendmsg_rtn_b32 and s_sendmsg_rtn_b64 instructions. Differential Revision: https://reviews.llvm.org/D127315
-
Jay Foad authored
In GFX10 dlc controlled L1 cache bypass. In GFX11 it has been repurposed to control MALL NOALLOC, and glc controls L1 as well as L0 cache bypass. Update the documentation and SIMemoryLegalizer accordingly. Set dlc for nontemporal and volatile accesses. Differential Revision: https://reviews.llvm.org/D127405
-
Tony authored
Update most of the document to include GFX11. Memory model changes will come later. Differential Revision: https://reviews.llvm.org/D127402
-
Valentin Clement authored
Remove a backwards dependence from Optimizer -> Lower by moving Todo.h to the optimizer and out of lowering. This patch is part of the upstreaming effort from fir-dev branch. Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com> Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D127292
-
Sunho Kim authored
Removes CodeAlignmentFactor and DataAlignmentFactor validation in EHFrameEdgeFixer. I observed some of aarch64 elf files generated by clang contains CIE record with code_alignment_factor = 4 or data_alignment_factor = -8. code_alignment_factor and data_alignment_factor are used by call fram instruction that should be correctled handled by libunwind. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D127062
-
Adrian Kuegel authored
-
Eric Schweitz authored
* Fix assertion strings. * Fixes assertion that arose from bad FIR being constructed. With the default member-wise component assignment, the LHS and RHS may be compatible but distinct types. This change to lowering manages both the LHS and RHS independently rather than assume the two types are identical. This avoids creating bogus FIR and asserting/crashing in codegen. Update the tests with the member-wise copy code. This patch is part of the upstreaming effort from fir-dev branch. Co-authored-by:
Eric Schweitz <eschweitz@nvidia.com> Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D127297
-
Nathan James authored
-
Yeting Kuo authored
The patch is a replacement of D125199. PseudoReadVL with vtype has worry for computing same vtypes of VLEFF/VLSEGFF in two different places, DAGToDAG and InsertVSETVLI. VLEFF/VLSEGFF MI with VL output still could provide the vtype of VLEFF/VLSEGFF to the users of its VL. The patch names the new pseudo as original VLEFF/VLSEGFF name suffixed "_VL" and expand them in RISCVInsertVSETVLI pass. This patch also reverts commit 4537aae0, "[RISCV] Make PseudoReadVL have the vtypes of the corresponding VLEFF/VLSEGFF.". Reviewed By: reames Differential Revision: https://reviews.llvm.org/D126794
-