- Nov 03, 2020
-
-
Jessica Clarke authored
ADDI often has a frameindex in operand 1, but consumers of this interface, such as MachineSink, tend to call getReg() on the Destination and Source operands, leading to the following crash when building FreeBSD after this implementation was added in 8cf6778d: ``` clang: llvm/include/llvm/CodeGen/MachineOperand.h:359: llvm::Register llvm::MachineOperand::getReg() const: Assertion `isReg() && "This is not a register operand!"' failed. PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: #0 0x00007f4286f9b4d0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm/lib/Support/Unix/Signals.inc:563:0 #1 0x00007f4286f9b587 PrintStackTraceSignalHandler(void*) llvm/lib/Support/Unix/Signals.inc:630:0 #2 0x00007f4286f9926b llvm::sys::RunSignalHandlers() llvm/lib/Support/Signals.cpp:71:0 #3 0x00007f4286f9ae52 SignalHandler(int) llvm/lib/Support/Unix/Signals.inc:405:0 #4 0x00007f428646ffd0 (/lib/x86_64-linux-gnu/libc.so.6+0x3efd0) #5 0x00007f428646ff47 raise /build/glibc-2ORdQG/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0 #6 0x00007f42864718b1 abort /build/glibc-2ORdQG/glibc-2.27/stdlib/abort.c:81:0 #7 0x00007f428646142a __assert_fail_base /build/glibc-2ORdQG/glibc-2.27/assert/assert.c:89:0 #8 0x00007f42864614a2 (/lib/x86_64-linux-gnu/libc.so.6+0x304a2) #9 0x00007f428d4078e2 llvm::MachineOperand::getReg() const llvm/include/llvm/CodeGen/MachineOperand.h:359:0 #10 0x00007f428d8260e7 attemptDebugCopyProp(llvm::MachineInstr&, llvm::MachineInstr&) llvm/lib/CodeGen/MachineSink.cpp:862:0 #11 0x00007f428d826442 performSink(llvm::MachineInstr&, llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::SmallVectorImpl<llvm::MachineInstr*>&) llvm/lib/CodeGen/MachineSink.cpp:918:0 #12 0x00007f428d826e27 (anonymous namespace)::MachineSinking::SinkInstruction(llvm::MachineInstr&, bool&, std::map<llvm::MachineBasicBlock*, llvm::SmallVector<llvm::MachineBasicBlock*, 4u>, std::less<llvm::MachineBasicBlock*>, std::allocator<std::pair<llvm::MachineBasicBlock* const, llvm::SmallVector<llvm::MachineBasicBlock*, 4u> > > >&) llvm/lib/CodeGen/MachineSink.cpp:1073:0 #13 0x00007f428d824a2c (anonymous namespace)::MachineSinking::ProcessBlock(llvm::MachineBasicBlock&) llvm/lib/CodeGen/MachineSink.cpp:410:0 #14 0x00007f428d824513 (anonymous namespace)::MachineSinking::runOnMachineFunction(llvm::MachineFunction&) llvm/lib/CodeGen/MachineSink.cpp:340:0 ``` Thus, check that operand 1 is also a register in the condition. Reviewed By: arichardson, luismarques Differential Revision: https://reviews.llvm.org/D89090
-
Jonas Devlieghere authored
Remove commented out code and print statements.
-
Jonas Devlieghere authored
Python doesn't support enums before PEP 435, but using a class with constants is how it's commonly emulated. It can be converted into a real Enum (in Python 3.4 and later) by extending the Enum class: class CrashLogParseMode(Enum): NORMAL = 0 THREAD = 1 IMAGES = 2 THREGS = 3 SYSTEM = 4 INSTRS = 5 -
Qiu Chaofan authored
Vector types, quadword integers and f128 currently cannot be handled in FastISel. We did not skip f128 type in lowering arguments, which causes a crash. This patch will fix it. Reviewed By: steven.zhang Differential Revision: https://reviews.llvm.org/D90206
-
Qiu Chaofan authored
Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D90581
-
Jonas Devlieghere authored
Don't try to guess the location of LLDB.framework but use xcrun to ask the command line driver for the location of the lldb module.
-
Sam McCall authored
I think this was just an oversight. Differential Revision: https://reviews.llvm.org/D90541
-
Fangrui Song authored
-
Alina Sbirlea authored
The API `canSinkOrHoistInst` may be called by LoopSink. Add assert to avoid having two analyses passed in.
-
Vitaly Buka authored
-
Akira Hatanaka authored
-
Diego Caballero authored
This patch renames AffineParallelNormalize to AffineLoopNormalize to make it more generic and be able to hold more loop normalization transformations in the future for affine.for and affine.parallel ops. Eventually, it could also be extended to support scf.for and scf.parallel. As a starting point for affine.for, the patch also adds support for removing single iteration affine.for ops to the the pass. Differential Revision: https://reviews.llvm.org/D90267
-
Reid Kleckner authored
parallelTransformReduce is modelled on the C++17 pstl API of std::transform_reduce, except our wrappers do not use execution policy parameters. parallelForEachError allows loops that contain potentially failing operations to propagate errors out of the loop. This was one of the major challenges I encountered while parallelizing PDB type merging in LLD. Parallelizing a loop with parallelForEachError is not behavior preserving: the loop will no longer stop on the first error, it will continue working and report all errors it encounters in a list. I plan to use this to propagate errors out of LLD's coff::TpiSource::remapTpiWithGHashes, which currently stores errors an error in the TpiSource object. Differential Revision: https://reviews.llvm.org/D90639
-
Fangrui Song authored
In the wild, kexec-tools purgatory/arch/ppc64/v2wrap.S and hvcall.S use this directive.
-
MaheshRavishankar authored
Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D90582
-
Alex Lorenz authored
The __isPlatformVersionAtLeast routine is an implementation of `if (@available)` check that uses the _availability_version_check API on Darwin that's supported on macOS 10.15, iOS 13, tvOS 13 and watchOS 6. Differential Revision: https://reviews.llvm.org/D90367
-
Louis Dionne authored
The strings were concatenated together without adding spaces between numbers, which lead to numbers that wouldn't fit in an unsigned int. Thanks to Casey Carter for the find.
-
Kostya Kortchinsky authored
- we have clutter-reducing helpers for relaxed atomics that were barely used, use them everywhere we can - clang-format everything with a recent version Differential Revision: https://reviews.llvm.org/D90649
-
Fangrui Song authored
This is a pre-existing problem exposed by D90511 (asan failurs with clang/test/Driver/relax.s and a few other tests).
-
Gaurav Jain authored
Differential Revision: https://reviews.llvm.org/D90611
-
Thomas Rodgers authored
Standard libraries may (libstdc++ in particular) forbid direct use of assert()/<cassert> in library code. Differential Revision: https://reviews.llvm.org/D60249
-
Ben Dunbobbin authored
415f7ee8 had LIT test failures on any build where the clang executable was not called "clang". I have adjusted the LIT CHECKs to remove the binary name to fix this. Original commit message: For PlayStation we offer source code compatibility with Microsoft's dllimport/export annotations; however, our file format is based on ELF. To support this we translate from DLL storage class to ELF visibility at the end of codegen in Clang. Other toolchains have used similar strategies (e.g. see the documentation for this ARM toolchain: https://developer.arm.com/documentation/dui0530/i/migrating-from-rvct-v3-1-to-rvct-v4-0/changes-to-symbol-visibility-between-rvct-v3-1-and-rvct-v4-0) This patch adds the ability to perform this translation. Options are provided to support customizing the mapping behaviour. Differential Revision: https://reviews.llvm.org/D89970
-
Rahul Joshi authored
Differential Revision: https://reviews.llvm.org/D90651
-
Artem Belevich authored
This reverts commit f38a9e51 Which triggered assertions.
-
Jonas Devlieghere authored
Address post-commit review from Adrian.
-
River Riddle authored
This revision refactors the base Op/AbstractOperation classes to reduce the amount of generated code size when defining a new operation. The current scheme involves taking the address of functions defined directly on Op and Trait classes. This is problematic because even when these functions are empty/unused we still result in these functions being defined in the main executable. In this revision, we switch to using SFINAE and template type filtering to remove remove functions that are not needed/used. For example, if an operation does not define a custom `print` method we shouldn't define a templated `printAssembly` method for it. The same applies to parsing/folding/verification/etc. This dropped MLIR code size for a large downstream library by ~10%(~1 mb in an opt build). Differential Revision: https://reviews.llvm.org/D90196
-
Artem Belevich authored
While CUDA documentation claims that such variables are not allowed[1], NVCC has been accepting them since CUDA-10.0[2] and some headers in CUDA-11 rely on this working. 1. https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#static-variables-function 2. https://godbolt.org/z/zsodzc Differential Revision: https://reviews.llvm.org/D88345
-
Fangrui Song authored
MC currently produces monolithic .gcc_except_table section. GCC can split up .gcc_except_table: * if comdat: `.section .gcc_except_table._Z6comdatv,"aG",@progbits,_Z6comdatv,comdat` * otherwise, if -ffunction-sections: `.section .gcc_except_table._Z3fooi,"a",@progbits` This ensures that (a) non-prevailing copies are discarded and (b) .gcc_except_table associated to discarded text sections can be discarded by a .gcc_except_table-aware linker (GNU ld, but not gold or LLD) This patches matches the GCC behavior. If -fno-unique-section-names is specified, we don't append the suffix. If -ffunction-sections is additionally specified, use `.section ...,unique`. Note, if clang driver communicates that the linker is LLD and we know it is new (11.0.0 or later) we can use SHF_LINK_ORDER to avoid string table costs, at least in the -fno-unique-section-names case. We cannot use it on GNU ld because as of binutils 2.35 it does not support mixed SHF_LINK_ORDER & non-SHF_LINK_ORDER components in an output section https://sourceware.org/bugzilla/show_bug.cgi?id=26256 For RISC-V -mrelax, this patch additionally fixes an assembler-linker interaction problem: because a section is shrinkable, the length of a call-site code range is not a constant. Relocations referencing the associated text section (STT_SECTION) are needed. However, a STB_LOCAL relocation referencing a discarded section group member from outside the group is disallowed by the ELF specification (PR46675): ``` // a.cc inline int comdat() { try { throw 1; } catch (int) { return 1; } return 0; } int main() { return comdat(); } // b.cc inline int comdat() { try { throw 1; } catch (int) { return 1; } return 0; } int foo() { return comdat(); } clang++ -target riscv64-linux -c a.cc b.cc -fPIC -mno-relax ld.lld -shared a.o b.o => ld.lld: error: relocation refers to a symbol in a discarded section: ``` -fbasic-block-sections= is similar to RISC-V -mrelax: there are outstanding relocations. Reviewed By: jrtc27, rahmanl Differential Revision: https://reviews.llvm.org/D83655
-
Nikita Popov authored
-
Kostya Kortchinsky authored
The initial version of GWP-ASan on Fuchsia doesn't support crash and signal handlers, so this just adds empty stubs to be able to compile the project on the platform. Differential Revision: https://reviews.llvm.org/D90537
-
Benjamin Kramer authored
Looks like we have a blind spot in the testing matrix. AsyncRegionRewriter.cpp: In member function ‘virtual void {anonymous}::GpuAsyncRegionPass::runOnFunction()’: AsyncRegionRewriter.cpp:113:16: internal compiler error: in replace_placeholders_r, at cp/tree.c:2804 if (getFunction() ~~~~~~~~~~~~~ .getRegion() ~~~~~~~~~~~~ .walk(Callback{OpBuilder{&getContext()}}) ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
Rahul Joshi authored
- Add standard dialect operations to define global variables with memref types and to retrieve the memref for to a named global variable - Extend unit tests to test verification for these operations. Differential Revision: https://reviews.llvm.org/D90337
-
peter klausler authored
Ensure that character length is properly calculated for actual arguments to intrinsics, and that source provenance information is available when expression analysis calls folding in cases where the length is invalid. Differential revision: https://reviews.llvm.org/D90636
-
Tony authored
Separate the AMDGPU memory model description into separate sections for each architecture. Differential Revision: https://reviews.llvm.org/D90548
-
Nikita Popov authored
-
Fangrui Song authored
``` // The legacy PM CGPassManager discovers SCCs this way: for function in the source order tarjanSCC(function) // While the new PM CGSCCPassManager does: for function in the reversed source order [1] discover a reference graph SCC build call graph SCCs inside the reference graph SCC ``` In the common cases, reference graph ~= call graph, the new PM order is undesired because for `a | b | c` (3 independent functions), the new PM will process them in the reversed order: c, b, a. If `a <-> b <-> c`, we can see that `-print-after-all` will report the sole SCC as `scc: (c, b, a)`. This patch corrects the iteration order. The discovered SCC order will match the legacy PM in the common cases. For some tests (`Transforms/Inline/cgscc-*.ll` and `unittests/Analysis/CGSCCPassManagerTest.cpp`), the behaviors are dependent on the SCC discovery order and there are too many check lines for the particular order. This patch simply reverses the function order to avoid changing too many check lines. Differential Revision: https://reviews.llvm.org/D90566
-
Atmn Patel authored
This has already been done by @rjmccall in D76526 (49e5a97e), and 9514c048. We should remove this from the docs. Differential Revision: https://reviews.llvm.org/D90550
-
Duncan P. N. Exon Smith authored
Attempt to fix build error on bots not seen locally.
-
Sean Silva authored
BufferPlacement is no longer part of bufferization. However, this test is an important test of "finalizing" bufferize passes. A "finalizing" bufferize conversion is one that performs a "full" conversion and expects all tensors to be gone from the program. This in particular involves rewriting funcs (including block arguments of the contained region), calls, and returns. The unique property of finalizing bufferization passes is that they cannot be done via a local transformation with suitable materializations to ensure composability (as other bufferization passes do). For example, if a call is rewritten, the callee needs to be rewritten otherwise the IR will end up invalid. Thus, finalizing bufferization passes require an atomic change to the entire program (e.g. the whole module). This new designation makes it clear also that it shouldn't be testing bufferization of linalg ops, so the tests have been updated to not use linalg.generic ops. (linalg.copy is still used as the "copy" op for copying into out-params) Differential Revision: https://reviews.llvm.org/D89979
-
Sean Silva authored
This is the most basic possible finalizing bufferization pass, which I also think is sufficient for most new use cases. The more concentrated nature of this pass also greatly clarifies the invariants that it requires on its input to safely transform the program (see the pass description in Passes.td). With this pass, I have now upstreamed practically all of the bufferizations from npcomp (the exception being std.constant, which can be upstreamed when std.global_memref lands: https://llvm.discourse.group/t/rfc-global-variables-in-mlir/2076/16 ) Differential Revision: https://reviews.llvm.org/D90205
-