- Oct 13, 2021
-
-
Jeremy Morse authored
Old versions of gcc want template specialisations to happen within the namespace where the template lives; this is still present in gcc 5.1, which we officially support, so it has to be worked around.
-
Jeremy Morse authored
InstrRefBasedLDV used to try and determine which values are in which registers using a lattice approach; however this is hard to understand, and broken in various ways. This patch replaces that approach with a standard SSA approach using existing LLVM utilities. PHIs are placed at dominance frontiers; value propagation then eliminates un-necessary PHIs. This patch also adds a bunch of unit tests that should cover many of the weirder forms of control flow. Differential Revision: https://reviews.llvm.org/D110173
-
Kerry McLaughlin authored
This patch adds patterns to match the following with INC/DEC: - @llvm.aarch64.sve.cnt[b|h|w|d] intrinsics + ADD/SUB - vscale + ADD/SUB For some implementations of SVE, INC/DEC VL is not as cheap as ADD/SUB and so this behaviour is guarded by the "use-scalar-inc-vl" feature flag, which for SVE is off by default. There are no known issues with SVE2, so this feature is enabled by default when targeting SVE2. Reviewed By: david-arm Differential Revision: https://reviews.llvm.org/D111441
-
Heejin Ahn authored
This makes Wasm EH work with dynamic linking. So far we were only able to handle destructors, which do not use any tags or LSDA info. 1. This uses `TargetExternalSymbol` for `GCC_except_tableN` symbols, which points to the address of per-function LSDA info. It is more convenient to use than `MCSymbol` because it can take additional target flags. 2. When lowering `wasm_lsda` intrinsic, if PIC is enabled, make the symbol relative to `__memory_base` and generate the `add` node. If PIC is disabled, continue to use the absolute address. 3. Make tag symbols (`__cpp_exception` and `__c_longjmp`) undefined in the backend, because it is hard to make it work with dynamic linking's loading order. Instead, we make all tag symbols undefined in the LLVM backend and import it from JS. 4. Add support for undefined tags to the linker. Companion patches: - https://github.com/WebAssembly/binaryen/pull/4223 - https://github.com/emscripten-core/emscripten/pull/15266 Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D111388
-
- Oct 12, 2021
-
-
Amara Emerson authored
Differential Revision: https://reviews.llvm.org/D111524
-
Hongtao Yu authored
This patch continues unblocking optimizations that are blocked by pseudo probe instrumentation. Not exactly like DbgIntrinsics, PseudoProbe intrinsic has other attributes (such as mayread, maywrite, mayhaveSideEffect) that can block optimizations. The issues fixed are: - Flipped default param of getFirstNonPHIOrDbg API to skip pseudo probes - Unblocked CSE by avoiding pseudo probe from clobbering memory SSA - Unblocked induction variable simpliciation - Allow empty loop deletion by treating probe intrinsic isDroppable - Some refactoring. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D110847
-
Jeremy Morse authored
These "dump" methods call into MachineOperand::dump, which doesn't exist with NDEBUG, thus we croak. Disable LiveDebugValues dump methods when NDEBUG is turned on to avoid this.
-
Jay Foad authored
With the -early-live-intervals command line flag, TwoAddressInstructionPass::runOnMachineFunction would call MachineFunction::verify before returning to check the live intervals. But there was not much benefit to doing this since -verify-machineinstrs and LLVM_ENABLE_EXPENSIVE_CHECKS provide a more general way of scheduling machine verification after every pass. Also it caused problems on targets like Lanai which are marked as "not machine verifier clean", since verification would fail for known target-specific problems which are nothing to do with LiveIntervals. Differential Revision: https://reviews.llvm.org/D111618
-
Jeremy Morse authored
This patch shifts the InstrRefBasedLDV class declaration to a header. Partially because it's already massive, but mostly so that I can start writing some unit tests for it. This patch also adds the boilerplate for said unit tests. Differential Revision: https://reviews.llvm.org/D110165
-
Yonghong Song authored
Per discussion in https://reviews.llvm.org/D111199, the existing btf_tag attribute will be renamed to btf_decl_tag. This patch mostly updated the Bitcode and DebugInfo test cases with new attribute name. Differential Revision: https://reviews.llvm.org/D111591
-
Amara Emerson authored
We shouldn't call APInt::getSExtValue() on a >64b value.
-
Guozhi Wei authored
This patch contains following enhancements to SrcRegMap and DstRegMap: 1 In findOnlyInterestingUse not only check if the Reg is two address usage, but also check after commutation can it be two address usage. 2 If a physical register is clobbered, remove SrcRegMap entries that are mapped to it. 3 In processTiedPairs, when create a new COPY instruction, add a SrcRegMap entry only when the COPY instruction is coalescable. (The COPY src is killed) With these enhancements isProfitableToCommute can do better commute decision, and finally more register copies are removed. Differential Revision: https://reviews.llvm.org/D108731
-
- Oct 11, 2021
-
-
Roman Lebedev authored
-
Jay Foad authored
PHI elimination updates LiveVariables info as described here: // We only need to update the LiveVariables kill of SrcReg if this was the // last PHI use of SrcReg to be lowered on this CFG edge and it is not live // out of the predecessor. We can also ignore undef sources. Unfortunately if the last use also happened to be an undef use then it would fail to update the LiveVariables at all. Fix this by not counting undef uses in the VRegPHIUse map. Thanks to Mikael Holmén for the test case! Differential Revision: https://reviews.llvm.org/D111552
-
- Oct 10, 2021
-
-
Amara Emerson authored
If the wide store we'd generate is not a multiple of the memory type of the narrow stores (e.g. s48 and s32), we'd assert. Fix that.
-
- Oct 09, 2021
-
-
Dávid Bolvanský authored
-
Dávid Bolvanský authored
-
Arthur Eubanks authored
Followup to D110451.
-
- Oct 08, 2021
-
-
Reid Kleckner authored
This moves the registry higher in the LLVM library dependency stack. Every client of the target registry needs to link against MC anyway to actually use the target, so we might as well move this out of Support. This allows us to ensure that Support doesn't have includes from MC/*. Differential Revision: https://reviews.llvm.org/D111454
-
Amara Emerson authored
-
Craig Topper authored
[RegisterScavenging] Use a Twine in a call to report_fatal_error instead of going from std::string to c_str. NFC The std::string was built on the line above. Might as well just build it as a Twine in the call.
-
Bradley Smith authored
This reverts commit 3e8d2008. The code removed in this commit is actually required for extracting fixed types from illegal scalable types, hence this commit causes assertion failures in such extracts.
-
Mirko Brkusanin authored
Differential Revision: https://reviews.llvm.org/D111319
-
Amara Emerson authored
This was using MachineFunction::createExternalSymbolName() before, which seems reasonable, but in fact this is freed before the asm emitter which tries to access the function name string. Switching it to use the string returned by the attribute seems to fix the problem.
-
Amara Emerson authored
In order to not generate an unnecessary G_CTLZ, I extended the constant folder in the CSEMIRBuilder to handle G_CTLZ. I also added some extra handing of vector constants too. It seems we don't have any support for doing constant folding of vector constants, so the tests show some other useless G_SUB instructions too. Differential Revision: https://reviews.llvm.org/D111036
-
Jay Foad authored
The "coloring with register" functionality it refers to was removed ten years ago in svn r144481 "Remove the -color-ss-with-regs option".
-
Itay Bookstein authored
The shift libcalls have a shift amount parameter of MVT::i32, but sometimes ExpandIntRes_Shift may be called with a node whose second operand is a type that is larger than that. This leads to an ABI mismatch, and for example causes a spurious zeroing of a register in RV32 for 64-bit shifts. Note that at present regular shift intstructions already have their shift amount operand adapted at SelectionDAGBuilder::visitShift time, and funnelled shifts bypass that. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D110508
-
Wang, Pengfei authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D110557
-
- Oct 07, 2021
-
-
Adrian Prantl authored
This change fixes a bug where the compiler generates a prologue_end for line 0 locs. That is because line 0 is not associated with any source location, so there should not be a prolgoue_end at a location that doesn't correspond to a source location. There were some LLVM tests that were explicitly checking for line 0 prologue_end's as well since I believe that to be incorrect, I had to change those tests as well. Patch by Shubham Rastogi! Differential Revision: https://reviews.llvm.org/D110740
-
Jay Foad authored
In a couple of places machine verification was disabled for no apparent reason, probably just because an "addPass(..., false)" line was cut and pasted from elsewhere. After this patch the only remaining place where machine verification is disabled in the generic TargetPassConfig code, is after addPreEmitPass.
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D111007
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D111006
-
Jay Foad authored
When PHIElimination adds kills after lowering PHIs to COPYs it knows that some instructions after the inserted COPY might use the same SrcReg, but it was only looking at the terminator instructions at the end of the block, not at other instructions like INLINEASM_BR that can appear after the COPY insertion point. Since we have already called findPHICopyInsertPoint, which knows about INLINEASM_BR, we might as well reuse the insertion point that it calculated when looking for instructions that might use SrcReg. This fixes a machine verification failure if you force machine verification to run after PHIElimination (currently it is disabled for other reasons) when running test/CodeGen/X86/callbr-asm-phi-placement.ll. Differential Revision: https://reviews.llvm.org/D110834
-
Amara Emerson authored
This is a straight port from the equivalent DAG combine. Differential Revision: https://reviews.llvm.org/D110890
-
Jay Foad authored
Print this basic block flag as inlineasm-br-indirect-target and parse it. This allows you to write MIR test cases for INLINEASM_BR. The test case I added is one that I wanted to precommit anyway for D110834. Differential Revision: https://reviews.llvm.org/D111291
-
Bradley Smith authored
Differential Revision: https://reviews.llvm.org/D111135
-
Jack Andersen authored
Based on the reasoning of D53903, register operands of DBG_VALUE are invariably treated as RegState::Debug operands. This change enforces this invariant as part of MachineInstr::addOperand so that all passes emit this flag consistently. RegState::Debug is inconsistently set on DBG_VALUE registers throughout LLVM. This runs the risk of a filtering iterator like MachineRegisterInfo::reg_nodbg_iterator to process these operands erroneously when not parsed from MIR sources. This issue was observed in the development of the llvm-mos fork which adds a backend that relies on physical register operands much more than existing targets. Physical RegUnit 0 has the same numeric encoding as $noreg (indicating an undef for DBG_VALUE). Allowing debug operands into the machine scheduler correlates $noreg with RegUnit 0 (i.e. a collision of register numbers with different zero semantics). Eventually, this causes an assert where DBG_VALUE instructions are prohibited from participating in live register ranges. Reviewed By: MatzeB, StephenTozer Differential Revision: https://reviews.llvm.org/D110105
-
Carl Ritson authored
When propagating undefined copies the undef flag must also be propagated. Reviewed By: foad Differential Revision: https://reviews.llvm.org/D111219
-
Jay Foad authored
Fix the calculation of ReplacedAllUntiedUses when any of the tied defs are early-clobber. The effect of this is to fix the placement of kill flags on an instruction like this (from @f2 in test/CodeGen/SystemZ/asm-18.ll): INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], killed %4:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit After TwoAddressInstruction without this patch: %3:grh32bit = COPY killed %4:grh32bit INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit Note that the COPY kills %4, even though there is a later use of %4 in the INLINEASM. This fails machine verification if you force it to run after TwoAddressInstruction (currently it is disabled for other reasons). After TwoAddressInstruction with this patch: %3:grh32bit = COPY %4:grh32bit INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit Differential Revision: https://reviews.llvm.org/D110848
-
Mikael Holmen authored
-