llvm-project/llvm/test
ARCHIT SAXENA 3bb1ce2319 Add a nop instruction if a section starts with landing pad for function splitter
This change adds a nop instruction if section starts with landing pad. This change is like [D73739](https://reviews.llvm.org/D73739) which avoids zero offset landing pad in basic block sections.

Detailed description:
The current machine functions splitter can create ˜sections which start with a landing pad themselves. This places landing pad at offset zero from LPStart.
```
	.section	.text.split.foo10,"ax",@progbits
foo10.cold:                             # %lpad
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception5
	.cfi_def_cfa %rsp, 16
.Ltmp11: <--- This is a Landing pad and also LP Start as it is start of this section
	movq	%rax, %rdi <--- first instruction is at offest 0 from LPStart
	callq	_Unwind_Resume@PLT

 ```
This will cause landing pad entries to become zero (.Ltmp11-foo10.cold)
```
.Lcst_begin4:
	.uleb128 .Ltmp9-.Lfunc_begin2           # >> Call Site 1 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-foo10.cold  <---This is zero           #     jumps to .Ltmp11
	.byte	3                               #   On action: 2
	.uleb128 .Ltmp10-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Lfunc_end9-.Ltmp10            #   Call between .Ltmp10 and .Lfunc_end9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.p2align	2
```
The C++ ABI somehow assumes that no landing pads point directly to LPStart (which works in the normal case since the function begin is never a landing pad), and uses LP.offset = 0 to specify no landing pad. This change adds a nop instruction at start of such sections so that such a case could be avoided. Output:
```
	.section	.text.split.foo10,"ax",@progbits
foo10.cold:                             # %lpad
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception5
	.cfi_def_cfa %rsp, 16
	nop <--- new instruction that is added
.Ltmp11:
	movq	%rax, %rdi
	callq	_Unwind_Resume@PLT
```

Reviewed By: modimo, snehasish, rahmanl

Differential Revision: https://reviews.llvm.org/D130133
2022-07-22 15:20:10 -07:00
..
Analysis [InstCombine] Improve folding of mul + icmp 2022-07-22 22:08:53 +00:00
Assembler [IR] Don't use blockaddresses as callbr arguments 2022-07-15 10:18:17 +02:00
Bindings [IR] Remove support for float binop constant expressions 2022-07-12 09:40:49 +02:00
Bitcode [LegacyPM] Remove NameAnonGlobalLegacyPass 2022-07-17 14:38:29 -07:00
BugPoint
CodeGen Add a nop instruction if a section starts with landing pad for function splitter 2022-07-22 15:20:10 -07:00
DebugInfo [Symbolizer] Implement contextual symbolizer markup elements. 2022-07-21 11:29:19 -07:00
Demangle
Examples
ExecutionEngine [JITLink][COFF] Add missing REQUIRES: asserts. 2022-07-13 04:05:56 +09:00
Feature
FileCheck
Instrumentation [LegacyPM] Remove InstrOrderFileLegacyPass 2022-07-19 23:58:51 -07:00
Integer
JitListener
LTO [LTO] Update remark test after 644a965c1e. 2022-07-04 15:21:15 +01:00
Linker [IR] Allow absence for Min module flags and make AArch64 BTI/PAC-RET flags backward compatible 2022-07-18 09:35:12 -07:00
MC [AMDGPU] gfx11 Fix VOP3 dot instructions 2022-07-22 11:43:35 +02:00
MachineVerifier
Object [AIX] support read global symbol of big archive 2022-07-18 10:43:30 -04:00
ObjectYAML [obj2yaml] Add -o to specify output filename 2022-07-14 00:32:48 -07:00
Other [NewPM] Print function/SCC size with -debug-pass-manager 2022-07-19 09:00:37 -07:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen [TableGen] Add a location for a class definition that was forward-declared 2022-07-20 15:56:17 +02:00
ThinLTO/X86 [ThinLTO] Support aliased GlobalIFunc 2022-07-20 15:30:38 -07:00
Transforms [InstCombine] Improve folding of mul + icmp 2022-07-22 22:08:53 +00:00
Unit
Verifier [MemProf] Basic metadata support and verification 2022-07-20 15:30:55 -07:00
YAMLParser
tools [llvm-ar] Add object mode option -X for AIX 2022-07-22 09:55:21 -04:00
.clang-format Disable clang-format entirely for test directories 2022-07-08 07:34:18 -04:00
CMakeLists.txt [Reland][Debuginfo][llvm-dwarfutil] llvm-dwarfutil dsymutil-like tool for ELF. 2022-07-19 15:11:36 +03:00
TestRunner.sh
lit.cfg.py [llvm-ar] Add object mode option -X for AIX 2022-07-22 09:55:21 -04:00
lit.site.cfg.py.in [llvm] add zstd to `llvm::compression` namespace 2022-07-19 10:54:36 -07:00