summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* X86InstrInfo: Support immediates that are +1/-1 different in ↵optimize_compinstr_fixMatthias Braun2022-01-115-24/+497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | optimizeCompareInstr This is a re-commit of e2c7ee0743592e39274e28dbe0d0c213ba342317 which was reverted in a2a58d91e82db38fbdf88cc317dcb3753d79d492 and ea81cea8163a1a0e54df42103ee1c657bbf03791. This includes a fix to consistently check for EFLAGS being live-out. See phabricator review. Original Summary: This extends `optimizeCompareInstr` to re-use previous comparison results if the previous comparison was with an immediate that was 1 bigger or smaller. Example: CMP x, 13 ... CMP x, 12 ; can be removed if we change the SETg SETg ... ; x > 12 changed to `SETge` (x >= 13) removing CMP Motivation: This often happens because SelectionDAG canonicalization tends to add/subtract 1 often when optimizing for fallthrough blocks. Example for `x > C` the fallthrough optimization switches true/false blocks with `!(x > C)` --> `x <= C` and canonicalization turns this into `x < C + 1`. Differential Revision: https://reviews.llvm.org/D110867
* [RISCV] Add DAG combine to fold (fp_to_int (ffloor X)) -> (fcvt X, rdn)Craig Topper2022-01-114-1/+2126
| | | | | | | | | | | | | | | | | | Similar for ceil, trunc, round, and roundeven. This allows us to use static rounding modes to avoid a libcall. This optimization is done for AArch64 as isel patterns. RISCV doesn't have instructions for ceil/floor/trunc/round/roundeven so the operations don't stick around until isel to enable a pattern match. Thus I've implemented a DAG combine. We only handle XLen types except i32 on RV64. i32 will be type legalized to a RISCVISD node. All other types will be type legalized to XLen and maintain the FP_TO_SINT/UINT ISD opcode. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D116771
* [SPIR-V] Drop double quote from test patternSven van Haastregt2022-01-111-1/+1
| | | | | | When spirv-link is found, it won't match a leading `"`. This fixes the test added by commit dbb8d086377b ("[SPIR-V] Add linking using spirv-link.", 2022-01-11).
* [clang] Move `ApplyHeaderSearchOptions` from Frontend to LexJan Svoboda2022-01-117-21/+14
| | | | | | | | | | In D116750, the `clangFrontend` library was added as a dependency of `LexTests` in order to make `clang::ApplyHeaderSearchOptions()` available. This increased the number of TUs the test depends on. This patch moves the function into `clangLex` and removes dependency of `LexTests` on `clangFrontend`. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D117024
* [libc][NFC] Move sys/mman entrypoints to the default build configs.Siva Chandra Reddy2022-01-1114-34/+37
| | | | | | Specifically, mmap and munmap have been moved to the default build list of entrypoints. To support this, certain deps and includes have been adjusted. The use of errno in some cases has been updated.
* Mark arith.minf, arith.maxf as commutative.Christian Sigg2022-01-112-2/+15
| | | | | | Reviewed By: herhut Differential Revision: https://reviews.llvm.org/D117010
* [GlobalsModRef] Apply indirect-global rule to all globals initialized from ↵Philip Reames2022-01-112-11/+7
| | | | | | | | noalias calls Extend the existing malloc-family specific optimization to all noalias calls. This allows us to handle allocation wrappers, and removes a dependency on a lib-func check in favor of generic attribute usage. Differential Revision: https://reviews.llvm.org/D116980
* [X86] Apply clang-format to X86TargetLowering::isVectorShiftByScalarCheapSimon Pilgrim2022-01-111-1/+1
| | | | Fix indentation
* [DSE] Style improvements after 3cef3cf - remove redundant dyn_casts [NFC]Philip Reames2022-01-111-13/+8
| | | | I'd been working on exactly the same patch when Nikita landed his, so this patch is basically the style diff between the two. :)
* [Nomination] Adding Intel representatives to security groupDimitry Andric2022-01-111-0/+2
| | | | | | | | | | We would like to nominate Andy Kaylor and Sergey Maslov to join the LLVM security group as a representative of Intel. Both are members of the Intel compiler team, and would like to register as vendor contacts. Intel packages and distributes LLVM-based toolchains as part of our compiler products. As such, we would like to be aware of any security vulnerability found in the compiler, and would like to contribute to the resolution of such issues. Please let us know if anything is missing from the nomination. Reviewed By: apilipenko, dim, george.burgess.iv, kristof.beyls, mattdr, nikhgupt, probinson, peter.smith, pietroalbini, steveklabnik Differential Revision: https://reviews.llvm.org/D115657
* [InstSimplify] Fold inbounds GEP to poison if base is undef.Florian Hahn2022-01-112-3/+4
| | | | | | | | | | | | D92270 updated constant expression folding to fold inbounds GEP to poison if the base is undef. Apply the same logic to SimplifyGEPInst. The justification is that we can choose an out-of-bounds pointer as base pointer. Reviewed By: nikic, lebedev.ri Differential Revision: https://reviews.llvm.org/D117015
* [mips][lld] Add test case to check symbol index reading on mips64el. NFCSimon Atanasyan2022-01-111-7/+15
|
* [mips] Use `push_back` to insert element at the end of a container. NFCSimon Atanasyan2022-01-111-1/+1
|
* [X86] Tag existing shuffle test case as PR53124Simon Pilgrim2022-01-111-0/+1
| | | | The poor AVX1 codegen matches the core issue raised in PR53124
* [SCEV] `getSequentialMinMaxExpr()`: look into `umin` when deduplicating operandsRoman Lebedev2022-01-112-27/+54
| | | | | | We could just merge all umin into umin_seq, but that is likely a pessimization, so don't do that, but pretend that we did for the purpose of deduplication.
* [NFC][SCEV] More tests with operand-wise redundant operands of umin of umin_seqRoman Lebedev2022-01-111-0/+75
|
* [compiler-rt] Silence warnings when building with MSVCAlexandre Ganea2022-01-1110-7/+41
| | | | Differential Revision: https://reviews.llvm.org/D116872
* [libc++] Use TEST_HAS_NO_UNICODE instead of _LIBCPP_HAS_NO_UNICODE in the ↵Louis Dionne2022-01-114-12/+14
| | | | | | test suite Differential Revision: https://reviews.llvm.org/D116973
* [ASan] Driver changes to always link-in asan_static library.Kirill Stoimenov2022-01-112-1/+5
| | | | | | | | This enables the changes from D116182. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D116670
* [GlobalStatus] Look through non-constexpr castsNikita Popov2022-01-112-3/+31
| | | | | | | analyzeGlobal() looks through non-constexpr cast instructions when looking for users. However, this particular place only strips the casts again if they are constexprs. We should be looking through all casts here.
* [NFC][SCEV] Add more tests for umin_seq with redundant operandsRoman Lebedev2022-01-111-0/+112
|
* [gn build] (manually) port 8503c688d555Nico Weber2022-01-111-0/+1
|
* [GlobalOpt] Regenerate test checks (NFC)Nikita Popov2022-01-111-7/+15
|
* [clang][lex] Keep references to `DirectoryLookup` objects up-to-dateJan Svoboda2022-01-114-73/+152
| | | | | | | | The elements of `SearchPath::SearchDirs` are being referenced to by their indices. This proved to be error-prone: `HeaderSearch::SearchDirToHSEntry` was accidentally not being updated in `HeaderSearch::AddSearchPath()`. This patch fixes that by referencing `SearchPath::SearchDirs` elements by their address instead, which is stable thanks to the bump-ptr-allocation strategy. Reviewed By: ahoppen Differential Revision: https://reviews.llvm.org/D116750
* [mlir][linalg] Use cast instead of dyn_cast that's always dereferencedBenjamin Kramer2022-01-111-1/+1
| | | | | This turns a random nullptr deref into an assertion failure in case `tensor::registerInferTypeOpInterfaceExternalModels` isn't called.
* [SCEV] `getSequentialMinMaxExpr()`: keep only the first instance of an operandRoman Lebedev2022-01-112-16/+34
| | | | | | Having the same operand more than once doesn't change the outcome here, neither reduction-wise nor poison-wise. We must keep the first instance specifically though.
* [SCEV] Add test for umin_seq with duplicate operandsRoman Lebedev2022-01-111-0/+37
|
* [SPIR-V] Remove unused variableAnastasia Stulova2022-01-111-1/+0
|
* [InstSimplify] Add additional GEP tests with undef bases.Florian Hahn2022-01-111-2/+16
|
* [lldb] Remove non address bits from memory read argumentsDavid Spickett2022-01-115-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addresses on AArch64 can have top byte tags, memory tags and pointer authentication signatures in the upper bits. While testing memory tagging I found that memory read couldn't read a range if the two addresses had different tags. The same could apply to signed pointers given the right circumstance. (lldb) memory read mte_buf_alt_tag mte_buf+16 error: end address (0x900fffff7ff8010) must be greater than the start address (0xa00fffff7ff8000). Or it would try to read a lot more memory than expected. (lldb) memory read mte_buf mte_buf_alt_tag+16 error: Normally, 'memory read' will not read over 1024 bytes of data. error: Please use --force to override this restriction just once. error: or set target.max-memory-read-size if you will often need a larger limit. Fix this by removing non address bits before we calculate the read range. A test is added for AArch64 Linux that confirms this by using the top byte ignore feature. This means that if you do read with a tagged pointer the output does not include those tags. This is potentially confusing but I think overall it's better that we don't pretend that we're reading memory from a range that the process is unable to map. (lldb) p ptr1 (char *) $4 = 0x3400fffffffff140 "\x80\xf1\xff\xff\xff\xff" (lldb) p ptr2 (char *) $5 = 0x5600fffffffff140 "\x80\xf1\xff\xff\xff\xff" (lldb) memory read ptr1 ptr2+16 0xfffffffff140: 80 f1 ff ff ff ff 00 00 38 70 bc f7 ff ff 00 00 ........8p...... Reviewed By: omjavaid, danielkiss Differential Revision: https://reviews.llvm.org/D103626
* [SPIR-V] Add linking using spirv-link.Anastasia Stulova2022-01-116-24/+52
| | | | | | | | | | | | | | | | | | Add support of linking files compiled into SPIR-V objects using spirv-link. Command line inteface examples: clang --target=spirv64 test1.cl test2.cl clang --target=spirv64 test1.cl -o test1.o clang --target=spirv64 test1.o test2.cl -o test_app.out This works independently from the SPIR-V generation method (via an external tool or an internal backend) and applies to either approach that is being used. Differential Revision: https://reviews.llvm.org/D116266
* [lldb/qemu] Implement GetMmapArgumentListPavel Labath2022-01-111-0/+8
| | | | By forwarding it to the host platform.
* [SCEV] Reenable umin_seq support and fix the `computeSCEVAtScope()`Roman Lebedev2022-01-113-41/+56
| | | | This reverts commit f62f47f5e1f641b41d3b7d593c058ebec2883534.
* [NFC][SCEV] Add reproducers for umin_seq crashesRoman Lebedev2022-01-111-0/+70
| | | | As reported in https://reviews.llvm.org/D116766#3233042
* [LSR] Use pointer args instead of undef for uglygep*.ll tests.Florian Hahn2022-01-112-11/+11
| | | | | Make the test more robust by replacing undef by pointer arguments. This ensures that the GEPs cannot be folded to undef.
* Revert "[Clang][AArch64][ARM] PMUv3.4 Option Added"David Green2022-01-118-78/+49
| | | | | | | | It turns out this is conflating a few different PMU extensions. And on Arm ended up breaking M-Profile code generation. Reverting for the moment whilst we sort out the details. This reverts commit d17fb46e894501568a1bf3b11a5d920817444630.
* [Clang][Sema] Fix attribute mismatch warning for ObjC class propertiesEgor Zhdan2022-01-114-4/+58
| | | | | | | | If a class declares an instance property, and an inheritor class declares a class property with the same name, Clang Sema currently treats the latter as an overridden property, and compares the attributes of the two properties to check for a mismatch. The resulting diagnostics might be misleading, since neither of the properties actually overrides the another one. rdar://86018435 Differential Revision: https://reviews.llvm.org/D116412
* [CodeGen] Avoid deprecated Address constructorNikita Popov2022-01-111-0/+1
|
* [SVE][CodeGen] Use splice instruction when lowering VECTOR_SPLICEDavid Sherwood2022-01-113-260/+193
| | | | | | | | | | | | | | | For certain negative indices passed to the VECTOR_SPLICE operation we can actually directly use the SVE splice instruction by creating the appropriate predicate. The predicate needs to be constructed in such a way that all but the last -idx elements are false. We can do this efficiently using a combination of 'ptrue' (with the appropriate fixed pattern, e.g. vl1, vl2, etc.) and 'rev'. The advantage of using these instructions to generate the predicate is they do not set any flags, unlike the whilelo instruction. This is critical when the splice operation is in a loop, since we want MachineLICM to hoist the predicate generation out of the loop. Differential Revision: https://reviews.llvm.org/D115863
* ARM: make FastISel & GISel pass -1 to ADJCALLSTACKUP to signal no callee pop.Tim Northover2022-01-116-27/+46
| | | | | | | The interface for these instructions changed with support for mandatory tail calls, and now -1 indicates the CalleePopAmount argument is not valid. Unfortunately I didn't realise FastISel or GISel did calls at the time so didn't update them.
* [SemaTemplateInstantiate] Use cast<> instead of dyn_cast<> to avoid ↵Simon Pilgrim2022-01-111-4/+3
| | | | | | dereference of nullptr The pointer is always dereferenced immediately below, so assert the cast is correct instead of returning nullptr
* [MemoryBuiltins] Remove unused isOpNewLikeFn() (NFC)Nikita Popov2022-01-112-10/+0
| | | | | This function is no longer used since 2cafbcb560d9e6e2300941d088e754b01d56595b.
* [MemoryBuiltins] Remove unused isStrdupLikeFn() function (NFC)Nikita Popov2022-01-112-10/+0
| | | | | This function is no longer used after dcbc91f40c2e6ff578667020f7c6a05c25149865.
* [DSE] Check for noalias calls rather than alloc functionsNikita Popov2022-01-112-6/+2
| | | | | | | | | | For these "visible on unwind/ret" checks we only care about the fact that no other code has access to the pointer (unless it escapes). A noalias call is sufficient for this, it does not have to be a known allocation function. This is basically the same change as D116728, but for DSE rather than LICM.
* [LSR] Remove duplicated test address-space-loop.ll.Florian Hahn2022-01-111-56/+0
| | | | | llvm/test/Transforms/LoopStrengthReduce/uglygep-address-space.ll has exactly the same checks and input. Remove the duplicated test.
* [mlir][linalg][bufferize] Fix CallOp bufferizationMatthias Springer2022-01-114-131/+281
| | | | | | | | | | Previously, CallOps did not have any aliasing OpResult/OpOperand pairs. Therefore, CallOps were mostly ignored by the analysis and buffer copies were not inserted when necessary. This commit introduces the following changes: * Function bbArgs writable by default. A function can now be bufferized without inspecting its callers. * Callers must introduce buffer copies of function arguments when necessary. If a function is external, the caller must conservatively assume that a function argument is modified by the callee after bufferization. If the function is not external, the caller inspects the callee to determine if a function argument is modified. Differential Revision: https://reviews.llvm.org/D116457
* [DSE] Add additional tests for noalias calls (NFC)Nikita Popov2022-01-111-9/+42
| | | | Currently this is special-cased to TLI alloc functions only.
* Reland "[AST] Add RParen loc for decltype AutoTypeloc."Haojian Wu2022-01-1113-26/+45
| | | | Reland 55d96ac and 37ec65e with a clang-tidy fix.
* [ADT] Add an in-place version of toHex()Hans Wennborg2022-01-114-27/+24
| | | | | | | | and use that to simplify MD5's hex string code which was previously using a string stream, as well as Clang's CGDebugInfo::computeChecksum(). Differential revision: https://reviews.llvm.org/D116960
* [DSE] Make test more robust (NFC)Nikita Popov2022-01-111-10/+10
| | | | | If the allocation is not captured, then all the stores before the ret are dead anyway.