[llvm] 718a1c9 - [X86] Add test where block placement separates call from RV marker.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 7 02:53:10 PST 2021
Author: Florian Hahn
Date: 2021-12-07T10:52:54Z
New Revision: 718a1c989ace99ea6059ed907d46dedca542d308
URL: https://github.com/llvm/llvm-project/commit/718a1c989ace99ea6059ed907d46dedca542d308
DIFF: https://github.com/llvm/llvm-project/commit/718a1c989ace99ea6059ed907d46dedca542d308.diff
LOG: [X86] Add test where block placement separates call from RV marker.
The test shows how block placement can separate a call from the marker
instruction and the ObjC call after CALL_RVMARKER expansion.
Added:
Modified:
llvm/test/CodeGen/X86/call-rv-marker.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/call-rv-marker.ll b/llvm/test/CodeGen/X86/call-rv-marker.ll
index fd22ec59e5f7..609e53a89f33 100644
--- a/llvm/test/CodeGen/X86/call-rv-marker.ll
+++ b/llvm/test/CodeGen/X86/call-rv-marker.ll
@@ -219,3 +219,42 @@ declare i8* @foo_nonlazybind() nonlazybind
declare i8* @objc_retainAutoreleasedReturnValue(i8*)
declare i8* @objc_unsafeClaimAutoreleasedReturnValue(i8*)
declare i32 @__gxx_personality_v0(...)
+
+declare i8* @fn1()
+declare i8* @fn2()
+
+define i8* @rv_marker_block_placement(i1 %c.0) {
+; CHECK-LABEL: _rv_marker_block_placement:
+; CHECK: pushq %rax
+; CHECK-NEXT: .cfi_def_cfa_offset 16
+; CHECK-NEXT: testb $1, %dil
+; CHECK-NEXT: je LBB8_2
+
+; CHECK-NEXT: ## %bb.1:
+; CHECK-NEXT: callq _fn1
+; CHECK-NEXT: jmp LBB8_3
+
+; CHECK-NEXT: LBB8_2:
+; CHECK-NEXT: callq _fn2
+
+; CHECK-NEXT: LBB8_3:
+; CHECK-NEXT: movq %rax, %rdi
+; CHECK-NEXT: callq _objc_retainAutoreleasedReturnValue
+; CHECK-NEXT: xorl %eax, %eax
+; CHECK-NEXT: popq %rcx
+; CHECK-NEXT: retq
+;
+entry:
+ br i1 %c.0, label %then, label %else
+
+then:
+ %call.0 = notail call i8* @fn1() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_retainAutoreleasedReturnValue) ]
+ br label %exit
+
+else:
+ %call.1 = notail call i8* @fn2() [ "clang.arc.attachedcall"(i8* (i8*)* @objc_retainAutoreleasedReturnValue) ]
+ br label %exit
+
+exit:
+ ret i8* null
+}
More information about the llvm-commits
mailing list