- Apr 08, 2020
-
-
Matt Arsenault authored
These should not be assuming address space 0. Calling getPointerTy is generally the wrong thing to do, since you should already know the type from the incoming IR.
-
Amy Huang authored
The change in bcf6604 added a debug info flag, which caused some tests to fail; I removed some commas so that the test matching still works.
-
Amy Huang authored
Summary: This change adds DIFlagNonTrivial to forward declarations of DICompositeType. It adds the flag to nontrivial types and types with unknown triviality. It fixes adding the "CxxReturnUdt" flag to functions inconsistently, since it is added based on whether the return type is marked NonTrivial, and that changes if the return type was a forward declaration. continues the discussion at https://reviews.llvm.org/D75215 Bug: https://bugs.llvm.org/show_bug.cgi?id=44785 Reviewers: rnk, dblaikie, aprantl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77436
- Apr 07, 2020
-
-
Nikita Popov authored
RDA sometimes needs to visit blocks twice, to take into account reaching defs coming in along loop back edges. Currently it handles repeated visitation the same way as usual, which means that it will scan through all instructions and their reg unit defs again. Not only is this very inefficient, it also means that all reaching defs in loops are going to be inserted twice. We can do much better than this. The only thing we need to handle is a new reaching def from a predecessor, which either needs to be prepended to the reaching definitions (if there was no reaching def from a predecessor), or needs to replace an existing predecessor reaching def, if it is more recent. Since D77508 we only store the most recent predecessor reaching def, so that's the only one that may need updating. This also has the nice side-effect that reaching definitions are now automatically sorted and unique, so drop the llvm::sort() call in favor of an assertion. Differential Revision: https://reviews.llvm.org/D77511
-
Nikita Popov authored
Only pass the MachineBasicBlock itself down to helper methods, they don't need to know about traversal. Move the debug print into the main method.
-
Nikita Popov authored
An instruction may define the same reg unit multiple times, avoid inserting the same reaching def multiple times in that case. Also print the reg unit, rather than the super-register, in the debug code.
-
David Tenty authored
Summary: - Remove the no longer used Darwin CalleeSavedRegs - Combine the SVR464 callee saved regs and AIX64 since the two are (and should be) identical into PPC64 - Update tests for 64-bit CSR change Reviewers: sfertile, ZarkoCA, cebowleratibm, jasonliu, #powerpc Reviewed By: sfertile Subscribers: wuzish, nemanjai, hiraditya, kbarton, shchenz, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77235
-
diggerlin authored
SUMMARY: refactor readobj/XCOFFDumper.cpp with helper function getAlignmentLog2() , getSymbolType(), isLabel(). Reviewers: Hubert Tong, James Henderson Subscribers: rupprecht, seiyai,hiradityu Differential Revision: https://reviews.llvm.org/D77562
-
Dmitry Vyukov authored
PPC now requires ReExec due to ASLR. Pull in more functions for Go build. Suggested-by: Keith Randall (khr)
-
Raphael Isemann authored
-
Sriraman Tallam authored
This is part of the Propeller framework to do post link code layout optimizations. Please see the RFC here: https://groups.google.com/forum/#!msg/llvm-dev/ef3mKzAdJ7U/1shV64BYBAAJ and the detailed RFC doc here: https://github.com/google/llvm-propeller/blob/plo-dev/Propeller_RFC.pdf This patch adds lld support for basic block sections and performs relaxations after the basic blocks have been reordered. After the linker has reordered the basic block sections according to the desired sequence, it runs a relaxation pass to optimize jump instructions. Currently, the compiler emits the long form of all jump instructions. AMD64 ISA supports variants of jump instructions with one byte offset or a four byte offset. The compiler generates jump instructions with R_X86_64 32-bit PC relative relocations. We would like to use a new relocation type for these jump instructions as it makes it easy and accurate while relaxing these instructions. The relaxation pass does two things: First, it deletes all explicit fall-through direct jump instructions between adjacent basic blocks. This is done by discarding the tail of the basic block section. Second, If there are consecutive jump instructions, it checks if the first conditional jump can be inverted to convert the second into a fall through and delete the second. The jump instructions are relaxed by using jump instruction mods, something like relocations. These are used to modify the opcode of the jump instruction. Jump instruction mods contain three values, instruction offset, jump type and size. While writing this jump instruction out to the final binary, the linker uses the jump instruction mod to determine the opcode and the size of the modified jump instruction. These mods are required because the input object files are memory-mapped without write permissions and directly modifying the object files requires copying these sections. Copying a large number of basic block sections significantly bloats memory. Differential Revision: https://reviews.llvm.org/D68065
-
Michael Liao authored
Summary: - Use `device_builtin_surface` and `device_builtin_texture` for surface/texture reference support. So far, both the host and device use the same reference type, which could be revised later when interface/implementation is stablized. Reviewers: yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77583
-
Simon Pilgrim authored
Shuffle combining can insert zero byte sized elements into the shuffle mask, which combineX86ShufflesConstants will attempt to fold without taking into account whether the byte-sized type is legal (e.g. AVX512F only targets). If we have a full-zeroable vector then we should just return a zero version of the root type, otherwise if the type isn't valid we should bail. Fixes PR45443
-
Artem Dergachev authored
This reverts commit cfd388d3.
-
Louis Dionne authored
The new format should be equivalent to the old format, and it is now the default format when running the libc++ tests. This commit changes the libc++abi tests to use the new format by default too. If unexpected failures are discovered, it should be fine to revert this commit until they are addressed. Also note that it is still possible to use the old format by passing `--param=use_old_format=True` when running Lit for the time being.
-
Louis Dionne authored
libc++abi has two of these tests.
-
Marcel Hlopko authored
Summary: Same restrictions apply as in the other direction: macro arguments are not supported yet, only full macro expansions can be mapped. Taking over from https://reviews.llvm.org/D72581. Reviewers: gribozavr2, sammccall Reviewed By: gribozavr2 Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77209
-
Sam McCall authored
Summary: Our previous definition of "top-level" was too informal, and didn't allow for overlapping macros that each directly produce expanded tokens. See D77507 for previous discussion. Fixes http://bugs.llvm.org/show_bug.cgi?id=45428 Reviewers: kadircet, vabridgers Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77615
-
Florian Hahn authored
Currently Clang does not respect -fno-unroll-loops during LTO. During D76916 it was suggested to respect -fno-unroll-loops on a TU basis. This patch uses the existing llvm.loop.unroll.disable metadata to disable loop unrolling explicitly for each loop in the TU if unrolling is disabled. This should ensure that loops from TUs compiled with -fno-unroll-loops are skipped by the unroller during LTO. This also means that if a loop from a TU with -fno-unroll-loops gets inlined into a TU without this option, the loop won't be unrolled. Due to the fact that some transforms might drop loop metadata, there potentially are cases in which we still unroll loops from TUs with -fno-unroll-loops. I think we should fix those issues rather than introducing a function attribute to disable loop unrolling during LTO. Improving the metadata handling will benefit other use cases, like various loop pragmas, too. And it is an improvement to clang completely ignoring -fno-unroll-loops during LTO. If that direction looks good, we can use a similar approach to also respect -fno-vectorize during LTO, at least for LoopVectorize. In the future, this might also allow us to remove the UnrollLoops option LLVM's PassManagerBuilder. Reviewers: Meinersbur, hfinkel, dexonsmith, tejohnson Reviewed By: Meinersbur, tejohnson Differential Revision: https://reviews.llvm.org/D77058
-
Sam McCall authored
Summary: The motivation here is fixing https://bugs.llvm.org/show_bug.cgi?id=45428, see D77507. The fundamental problem is that a "top-level" expansion wasn't precisely defined. Repairing this concept means that TokenBuffer's "top-level expansion" may not correspond to a single macro expansion. Example: ``` M(2); // expands to 1+2 ``` The expansions overlap, but neither expansion alone yields all the tokens. We need a TokenBuffer::Mapping that corresponds to their union. This is fairly easy to fix in CollectPPExpansions, but the current design of TokenCollector::Builder needs a fix too as it relies on the macro's expansion range rather than the captured expansion bounds. This fix is hard to make due to the way code is reused within Builder. And honestly, I found that code pretty hard to reason about too. The new approach doesn't use the expansion range, but only the expansion location: it assumes an expansion is the contiguous set of expanded tokens with the same expansion location, which seems like a reasonable formalization of the "top-level" notion. And hopefully the control flow is easier to follow too, it's considerably shorter even with more documentation. Reviewers: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77614
-
Louis Dionne authored
Otherwise, files don't link when using a GNU linker, which is more sensitive on the order of the source file relative to the various linked libraries. See http://c-faq.com/lib/libsearch.html for an explanation of the problem.
-
Denys Petrov authored
This is the second part of Denys's patch, committed separately due to being more risky. Differential Revision: https://reviews.llvm.org/D76768
-
Haojian Wu authored
Summary: crash stack: ``` lang: workspace/llvm-project/clang/lib/AST/ExprConstant.cpp:13704: bool EvaluateInPlace(clang::APValue &, (anonymous namespace)::EvalInfo &, const (anonymous namespace)::LValue &, const clang::Expr *, bool): Assertion `!E->isValueDependent()' failed. #8 EvaluateInPlace(clang::APValue&, (anonymous namespace)::EvalInfo&, (anonymous namespace)::LValue const&, clang::Expr const*, bool) workspace/llvm-project/clang/lib/AST/ExprConstant.cpp:0:0 #9 HandleConstructorCall(clang::Expr const*, (anonymous namespace)::LValue const&, clang::APValue*, clang::CXXConstructorDecl const*, (anonymous namespace)::EvalInfo&, clang::APValue&) workspace/llvm-project/clang/lib/AST/ExprConstant.cpp:5779:57 #10 HandleConstructorCall(clang::Expr const*, (anonymous namespace)::LValue const&, llvm::ArrayRef<clang::Expr const*>, clang::CXXConstructorDecl const*, (anonymous namespace)::EvalInfo&, clang::APValue&) workspace/llvm-project/clang/lib/AST/ExprConstant.cpp:5819:10 #11 clang::Expr::isPotentialConstantExpr(clang::FunctionDecl const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic> >&) workspace/llvm-project/clang/lib/AST/ExprConstant.cpp:14746:5 #12 CheckConstexprFunctionBody(clang::Sema&, clang::FunctionDecl const*, clang::Stmt*, clang::Sema::CheckConstexprKind) workspace/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:2306:7 #13 clang::Sema::CheckConstexprFunctionDefinition(clang::FunctionDecl const*, clang::Sema::CheckConstexprKind) workspace/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:1766:0 #14 clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool) workspace/llvm-project/clang/lib/Sema/SemaDecl.cpp:14357:9 #15 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) workspace/llvm-project/clang/lib/Parse/ParseStmt.cpp:2213:18 ``` Reviewers: sammccall Reviewed By: sammccall Subscribers: rsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77041
-
Nico Weber authored
This has been unnecessary since https://reviews.llvm.org/D37756. https://reviews.llvm.org/D37838 removed it for llvm. This removes it from clang, lld, clang-tools-extra (and the GN build). No intended behavior change. Differential Revision: https://reviews.llvm.org/D77585
-
Muhammad Omair Javaid authored
This reverts commit a53bf9b7.
-
Muhammad Omair Javaid authored
-
Kadir Cetinkaya authored
-
Kadir Cetinkaya authored
Summary: FileInputs are only written by ASTWorker thread, therefore it is safe to read them without the lock inside that thread. It can still be read by other threads through ASTWorker::getCurrentCompileCommand though. This patch also gets rid of the smart pointer wrapping FileInputs as there is never mutliple owners. Reviewers: sammccall Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77309
-
Georgii Rymar authored
Currently we have no dedicated warnings, but we return error message instead of a result. It is generally not consistent with another warnings we have. This change was suggested and discussed here: https://reviews.llvm.org/D77216#1954873 This change refines error messages we report and also I had to update the API to implement it. Differential revision: https://reviews.llvm.org/D77399
-
Sanjay Patel authored
See post-commit comments for rG0f56bbc1.
-
cchen authored
Chen Reviewers: ABataev, jdoerfert Reviewed By: ABataev Subscribers: cfe-commits, dreachem, sandoval Tags: #clang Differential Revision: https://reviews.llvm.org/D77581
-
Nathan James authored
-
Nathan James authored
Summary: Removes the `static` token when defining a function out of line if the function is a `CXXMethodDecl` Reviewers: sammccall, kadircet, hokein Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D77534
-
Keith Walker authored
If the stack pointer is altered for local variables and we are generating Thumb2 execute-only code the .pad directive is missing. Usually the size of the adjustment is stored in a PC-relative location and loaded into a register which is then added to the stack pointer. However when we are generating execute-only code code the size of the adjustment is instead generated using the MOVW/MOVT instruction pair. As a by product of handling the execute-only case this also fixes an existing issue that in the none execute-only case the .pad directive was generated against the load of the constant to a register instruction, instead of the instruction which adds the register to the stack pointer. Differential Revision: https://reviews.llvm.org/D76849
-
Pierre Gousseau authored
Warnings in emmintrin.h and xmmintrin.h are reported by -fsanitize=implicit-integer-sign-change. Reviewed By: RKSimon, craig.topper Differential Revision: https://reviews.llvm.org/D77393
-
Uday Bondhugula authored
Introduce the alloca op for stack memory allocation. When converting to the LLVM dialect, this is lowered to an llvm.alloca. Refactor the std to llvm conversion for alloc op to reuse with alloca. Drop useAlloca option with alloc op lowering. Differential Revision: https://reviews.llvm.org/D76602
-
Florian Hahn authored
This patch updates the code that deals with conditions from predicate info to make use of constant ranges. For ssa_copy instructions inserted by PredicateInfo, we have 2 ranges: 1. The range of the original value. 2. The range imposed by the linked condition. 1. is known, 2. can be determined using makeAllowedICmpRegion. The intersection of those ranges is the range for the copy. With this patch, we get a nice increase in the number of instructions eliminated by both SCCP and IPSCCP for some benchmarks: For MultiSource, SPEC2000 & SPEC2006: Tests: 237 Same hash: 170 (filtered out) Remaining: 67 Metric: sccp.NumInstRemoved Program base patch diff test-suite...Source/Benchmarks/sim/sim.test 10.00 71.00 610.0% test-suite...CFP2000/177.mesa/177.mesa.test 361.00 1626.00 350.4% test-suite...encode/alacconvert-encode.test 141.00 602.00 327.0% test-suite...decode/alacconvert-decode.test 141.00 602.00 327.0% test-suite...CI_Purple/SMG2000/smg2000.test 1639.00 4093.00 149.7% test-suite...peg2/mpeg2dec/mpeg2decode.test 75.00 163.00 117.3% test-suite...T2006/401.bzip2/401.bzip2.test 358.00 513.00 43.3% test-suite...rks/FreeBench/pifft/pifft.test 11.00 15.00 36.4% test-suite...langs-C/unix-tbl/unix-tbl.test 4.00 5.00 25.0% test-suite...lications/sqlite3/sqlite3.test 541.00 667.00 23.3% test-suite.../CINT2000/254.gap/254.gap.test 243.00 299.00 23.0% test-suite...ks/Prolangs-C/agrep/agrep.test 25.00 29.00 16.0% test-suite...marks/7zip/7zip-benchmark.test 1135.00 1304.00 14.9% test-suite...lications/ClamAV/clamscan.test 1105.00 1268.00 14.8% test-suite...urce/Applications/lua/lua.test 398.00 436.00 9.5% Metric: sccp.IPNumInstRemoved Program base patch diff test-suite...C/CFP2000/179.art/179.art.test 1.00 3.00 200.0% test-suite...006/447.dealII/447.dealII.test 429.00 1056.00 146.2% test-suite...nch/fourinarow/fourinarow.test 3.00 7.00 133.3% test-suite...CI_Purple/SMG2000/smg2000.test 818.00 1748.00 113.7% test-suite...ks/McCat/04-bisect/bisect.test 3.00 5.00 66.7% test-suite...CFP2000/177.mesa/177.mesa.test 165.00 255.00 54.5% test-suite...ediabench/gsm/toast/toast.test 18.00 27.00 50.0% test-suite...telecomm-gsm/telecomm-gsm.test 18.00 27.00 50.0% test-suite...ks/Prolangs-C/agrep/agrep.test 24.00 35.00 45.8% test-suite...TimberWolfMC/timberwolfmc.test 43.00 62.00 44.2% test-suite...encode/alacconvert-encode.test 46.00 66.00 43.5% test-suite...decode/alacconvert-decode.test 46.00 66.00 43.5% test-suite...langs-C/unix-tbl/unix-tbl.test 12.00 17.00 41.7% test-suite...peg2/mpeg2dec/mpeg2decode.test 31.00 41.00 32.3% test-suite.../CINT2000/254.gap/254.gap.test 117.00 154.00 31.6% Reviewers: efriedma, davide Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D76611
-
Djordje Todorovic authored
Note that x86, arm and aarch64 targets support the Debug Entry Values feature by default. Differential Revision: https://reviews.llvm.org/D77494
-
Serguei Katkov authored
Move the logic whether lowering of deopt value requires a spill slot in a separate lambda. Reviewers: reames, dantrushin Reviewed By: dantrushin Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D77629
-