- Jun 26, 2021
-
-
mydeveloperday authored
https://bugs.llvm.org/show_bug.cgi?id=50525 AlignConsecutiveAssignments/Declarations cause incorrect alignment in the presence of a DesignatedInitializerPeriod (https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html) ``` static NTSTATUS stg(PLW_STREAM Stream, int identity) { NTSTATUS status; BYTE payload[256] = {'l', 'h', 'o', 't', 's', 'e'}; struct dm_rpc_header header = {.drh_magic = DRH_MAGIC, .drh_op_code = RPC_OP_ECHO, .drh_payload_size = sizeof(payload), .drh_body_size = sizeof(payload), .drh_request_id = 1}; header.drh_version = identity; ``` This fix addresses that by ensuring the period isn't ignored Reviewed By: HazardyKnusperkeks Differential Revision: https://reviews.llvm.org/D104900
-
David Green authored
-
Florian Hahn authored
Suggested in D104197, avoids the early exit.
-
LLVM GN Syncbot authored
-
Lang Hames authored
ELFLinkGraphBuilder<ELFT> will hold generic parsing and LinkGraph-building code that can be shared between JITLink ELF backends for different architectures. For now it's just a stub. The plan is to incrementally move functionality down from ELFLinkGraphBuilder_x86_64 into the new template.
-
Timm Bäder authored
Clang can be configured with a different default unwindlib, for example gcc. In that case, -lunwind will not be present in the output. Fix this by explicitly specifying libunwind as the unwindlib. Differential Revision: https://reviews.llvm.org/D104899
-
Jim Lin authored
Reviewed By: frasercrmck Differential Revision: https://reviews.llvm.org/D104838
-
Saurabh Jha authored
There were some issues in the patch https://reviews.llvm.org/D104198. I also forgot to address one comment. This patch addresses these. Reviewed By: xgupta Differential Revision: https://reviews.llvm.org/D104971
-
Craig Topper authored
[RISCV] Add DAG combine to detect opportunities to replace (i64 (any_extend (i32 X)) with sign_extend. If type legalization is going to insert a sign_extend for other users of X and we can fold the sign_extend into ADDW/MULW/SUBW, it is better to replace the ANY_EXTEND so we don't end up with a separate ADD/MUL/SUB instruction for the users of the ANY_EXTEND. I'm only handling setcc uses right now, but there are other instructions that force sign_extends like ashr. There are probably other *W instructions we could use in addition to ADDW/SUBW/MULW. My motivating case was a loop terminating compare and a phi use as seen in the new test file. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D104581
-
Gus Smith authored
This allows us to use `buildLattices` in the `Merger` unittests. Reviewed By: aartbik Differential Revision: https://reviews.llvm.org/D104879
-
Eric Astor authored
-
Luo, Yuanke authored
When set opt-bisect-limit to some value that is less than ISel pass in command line and CurBisectNum expired, "DAG to DAG" pass lower its opt level to O0. However "processimpdefs" and "X86 FP Stackifier" is not stopped due to the CurBisectNum expiration. So undefined fp0 is generated. This cause crash in the "X86 FP Stackifier" pass, because Stackifier doesn't expect any undefined fp value. Here is the scenario that cause compiler crash. successors: %bb.26 liveins: $r14 ST_FPrr $st0, implicit-def $fpsw, implicit $fpcw renamable $rdi = MOV64ri @.str.3.16422 renamable $rdx = LEA64r %stack.6, 1, $noreg, 0, $noreg ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def dead $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp dead $esi = MOV32r0 implicit-def dead $eflags, implicit-def $rsi CALL64pcrel32 @foo, implicit $rsp, implicit $ssp, implicit $rdi, implicit $rsi, implicit $rdx, implicit-def dead $fp0 renamable $xmm0 = MOVSDrm_alt %stack.10, 1, $noreg, 0, $noreg :: (load 8 from %stack.10) ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def dead $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp renamable $fp2 = CHS_Fp80 killed undef renamable $fp0, implicit-def $fpsw JMP_1 %bb.26 The CALL64pcrel32 mark fp0 dead, so llvm free the stack slot for fp0 and the stack become empty. In the late instruction CHS_Fp80, it use undefined register fp0, the original code assume there must be a stack slot for the src register (fp0) without respecting it is undefined, so llvm report error. We have some discussion in https://reviews.llvm.org/D104440 and we decide to fix it in fast ISel. The fix is to lower undefined fp value to zero value, so that it release the burden of "X86 FP Stackifier" pass. Thank Craig for the suggestion and the initial patch to fix it. Differential Revision: https://reviews.llvm.org/D104678 -
Jon Chesterfield authored
Most tests passed with an extra argument to explicitly enable the pass. One does not, deleted it as part of this change. I can't see why the codegen would be different between default on and default off but switched on. It can be retrieved from the project history. This would be a revert, but git revert was not clean. Disabling the pass and leaving it in tree is less likely to cause breakage elsewhere than patching up the git revert conflicts on unfamiliar code. It'll be landed without review, as @hsmhsm is believed unavailable at present. Differential Revision: https://reviews.llvm.org/D104962
-
Andrew Browne authored
Previously on x86_64: +--------------------+ 0x800000000000 (top of memory) | application memory | +--------------------+ 0x700000008000 (kAppAddr) | | | unused | | | +--------------------+ 0x300000000000 (kUnusedAddr) | origin | +--------------------+ 0x200000008000 (kOriginAddr) | unused | +--------------------+ 0x200000000000 | shadow memory | +--------------------+ 0x100000008000 (kShadowAddr) | unused | +--------------------+ 0x000000010000 | reserved by kernel | +--------------------+ 0x000000000000 MEM_TO_SHADOW(mem) = mem & ~0x600000000000 SHADOW_TO_ORIGIN(shadow) = kOriginAddr - kShadowAddr + shadow Now for x86_64: +--------------------+ 0x800000000000 (top of memory) | application 3 | +--------------------+ 0x700000000000 | invalid | +--------------------+ 0x610000000000 | origin 1 | +--------------------+ 0x600000000000 | application 2 | +--------------------+ 0x510000000000 | shadow 1 | +--------------------+ 0x500000000000 | invalid | +--------------------+ 0x400000000000 | origin 3 | +--------------------+ 0x300000000000 | shadow 3 | +--------------------+ 0x200000000000 | origin 2 | +--------------------+ 0x110000000000 | invalid | +--------------------+ 0x100000000000 | shadow 2 | +--------------------+ 0x010000000000 | application 1 | +--------------------+ 0x000000000000 MEM_TO_SHADOW(mem) = mem ^ 0x500000000000 SHADOW_TO_ORIGIN(shadow) = shadow + 0x100000000000 Reviewed By: stephan.yichao.zhao, gbalats Differential Revision: https://reviews.llvm.org/D104896
-
Siva Chandra Reddy authored
__builtin_ctzl takes an unsigned long argument which need not be 64-bit long on all platforms. Using __builtin_ctzll, which takes an unsigned long long argument, ensures that 64-bit values will be handled on a wider range of platforms. Without this change, the test corresponding to M512 fails in Windows. Reviewed By: gchatelet Differential Revision: https://reviews.llvm.org/D104897
-
Nikita Popov authored
This reverts commit 5cb20ef8. Assertion failures with this patch were reported on https://reviews.llvm.org/rG5cb20ef8a235, revert for now.
-
Duncan P. N. Exon Smith authored
Bring back the testcase dropped in 1e6303e6 and get it passing by checking explicitly for `ptr*` in LLParser. Uses `Type::isOpaquePointerTy()` from ad4bb828. Differential Revision: https://reviews.llvm.org/D104938
-
Aart Bik authored
Reviewed By: gussmith23 Differential Revision: https://reviews.llvm.org/D104939
-
Matheus Izvekov authored
Word on the grapevine was that the committee had some discussion that ended with unanimous agreement on eliminating relational function pointer comparisons. We wanted to be bold and just ban all of them cold turkey. But then we chickened out at the last second and are going for eliminating just the spaceship overload candidate instead, for now. See D104680 for reference. This should be fine and "safe", because the only possible semantic change this would cause is that overload resolution could possibly be ambiguous if there was another viable candidate equally as good. But to save face a little we are going to: * Issue an "error" for three-way comparisons on function pointers. But all this is doing really is changing one vague error message, from an "invalid operands to binary expression" into an "ordered comparison of function pointers", which sounds more like we mean business. * Otherwise "warn" that comparing function pointers like that is totally not cool (unless we are told to keep quiet about this). Signed-off-by:
Matheus Izvekov <mizvekov@gmail.com> Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D104892
-
Jonas Devlieghere authored
Avoid standing the Objective-C runtime lock by calling objc_copyRealizedClassList_nolock instead of objc_copyRealizedClassList. We already guarantee that no other threads can run while we're running this utility expression, similar to when we parse the data ourselves from the gdb_objc_realized_classes struct. Worst case this will crash if the list is getting edited, which won't do any harm and we'll just try again later. Differential revision: https://reviews.llvm.org/D104951
-
Jim Ingham authored
This was an oversight of the commit: bb93483c that added support for the Frozen variants. Also added a test case for the way that currently produces one of these variants (a copy).
-
Eli Friedman authored
The implementation is identical, but it makes the semantics a bit more obvious.
-
Eric Astor authored
Match ML.EXE's behavior for ALIGN, EVEN, and ORG directives both at file level and in STRUCTs. We currently reject negative offsets passed to ORG inside STRUCTs (in ML.EXE and ML64.EXE, they wrap around as for an unsigned 32-bit integer). Also, if a STRUCT is declared using an ORG directive, no value of that type can be defined. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D92507
-
Adrian Prantl authored
This is an NFC modernization refactoring that replaces the combination of a bool return + reference argument, with an Optional return value. Differential Revision: https://reviews.llvm.org/D104404
-
Juneyoung Lee authored
This fixes a bug at LibCallSimplifier::optimizeMemChr which does the following transformation: ``` // memchr("\r\n", C, 2) != nullptr -> (1 << C & ((1 << '\r') | (1 << '\n'))) // != 0 // after bounds check. ``` As written above, a bounds check on C (whether it is less than integer bitwidth) is done before doing `1 << C` otherwise 1 << C will overflow. If the bounds check is false, the result of (1 << C & ...) must not be used at all, otherwise the result of shift (which is poison) will contaminate the whole results. A correct way to encode this is `select i1 (bounds check), (1 << C & ...), false` because select does not allow the unused operand to contaminate the result. However, this optimization was introducing `and (bounds check), (1 << C & ...)` which cannot do that. The bug was found from compilation of this C++ code: https://reviews.llvm.org/rG2fd3037ac615#1007197 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D104901 -
Joseph Huber authored
The metadata added in D102361 introduces a module flag that we can check to determine if the module was compiled with `-fopenmp` enables. We can now check for the precense of this instead of scanning the call graph for OpenMP runtime functions. Depends on D102361 Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D102423
-
Joseph Huber authored
This patch adds a module level metadata flag indicating that the module was compiled with the `-fopenmp` flag. This will make it easier for passes like OpenMPOpt to determine if it should be run. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D102361
-
Nemanja Ivanovic authored
This causes failures on the big endian bootstrap bot. Disabling this combine temporarily until I can get a proper fix.
-
Valeriy Savchenko authored
rdar://76948312 Differential Revision: https://reviews.llvm.org/D104716
-
Martin Storsjö authored
When the default target arch isn't one that is supported as a windows target, we want to set a suitable architecture (so that Clang tests that run plain 'llvm-rc' succeed checks for e.g. "#ifdef _WIN32" even for llvm builds that default to e.g. ppc64). But if the default target architecture is usable, don't rewrite it. (Rewriting it, by e.g. "T.setArch(T.getArch())", normalizes the spelling of the architecture, e.g. changing i686 to i386. Such a change can make clang unable to find the right sysroot.) This can't, unfortunately, practically be tested very well because it is entirely dependent on the default triple of the llvm build. Differential Revision: https://reviews.llvm.org/D104589
-
Fangrui Song authored
Modify the D13209 logic: for a script inside the sysroot, if an absolute path does not exist, report an error instead of falling back to the path without the sysroot prefix. This matches GNU ld, which makes sense to me: we don't want to find an arbitrary file in the host. Reviewed By: ikudrin Differential Revision: https://reviews.llvm.org/D104894
-
Ulrich Weigand authored
Add support for the .reloc directive along the lines of other back-ends. This fixes a regression after https://reviews.llvm.org/D104080 was merged, since that patch presupposed support for .reloc.
-
Hongtao Yu authored
Types should be defined in function scope instead of a local lexical scope. Field types should be defined inside in its parent type scope. We were seeing a type defined in a local scope causing trouble to the dwarf emitter where a context is required to be a funciton scope, a namespace or a global scope. Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D104937
-
Eugene Zhulenev authored
Accidentally pushed old branches that did not include all the changes discussed in the PRs. https://reviews.llvm.org/rGd43b23608ad664f02f56e965ca78916bde220950 https://reviews.llvm.org/rG86ad0af87054c3cccd68d32e103a6f1f6c6194c7 Differential Revision: https://reviews.llvm.org/D104943
-
Nikita Popov authored
The type is no longer implicitly enumerated through the pointer type.
-
Arthur O'Dwyer authored
Continuing to eliminate no-longer-needed uses of _LIBCPP_CXX03_LANG. Differential Revision: https://reviews.llvm.org/D104725
-
Nikita Popov authored
Shortcut to check for opaque pointers without a cast to PointerType.
-
peter klausler authored
A recent change that extended semantic analysis for actual arguments that associate with procedure dummy arguments exposed some bugs in regression test suites due to points of confusion in symbol table handling in situations where a generic interface contains a specific procedure of the same name. When passing that name as an actual argument, for example, it's necessary to take this possibility into account because the symbol for the generic interface shadows the symbol of the same name for the specific procedure, which is what needs to be checked. So add a small utility that bypasses the symbol for a generic interface in this case, and use it where needed. Differential Revision: https://reviews.llvm.org/D104929
-
David Green authored
This add as a fold of sub(0, splat(sub(0, x))) -> splat(x). This can come up in the lowering of right shifts under AArch64, where we generate a shift left of a negated number. Differential Revision: https://reviews.llvm.org/D103755
-
Craig Topper authored
We don't need to have the compare output a value and then copy it to FPSW for use by FNSTSW. Instead we can just have the compare output Glue and glue the FNSTSW to it. InstrEmitter effectively performed this optimization when emitting the Machine IR. Doing it directly simplifies the codes and reduces the work in InstrEmitter. There's no change in the machine IR at the end of isel before and after this change.
-