[PATCH] D54929: Support StackMaps For ARM
zuojian lin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 26 22:15:48 PST 2018
linzj marked an inline comment as done.
linzj added a comment.
This patch pass the test:
; ModuleID = 'test'
source_filename = "test"
target triple = "armv7-linux-android"
define i64 @main([40 x i64]*) {
Prologue:
br label %Body
Body: ; preds = %Prologue
%1 = getelementptr inbounds [40 x i64], [40 x i64]* %0, i32 0, i32 2
%2 = load i64, i64* %1
%3 = getelementptr inbounds [40 x i64], [40 x i64]* %0, i32 0, i32 0
%4 = load i64, i64* %3
%5 = add i64 %4, 1
%6 = icmp ne i64 %2, 0
%7 = select i1 %6, i64 %5, i64 %4
%8 = getelementptr inbounds [40 x i64], [40 x i64]* %0, i32 0, i32 0
store i64 %7, i64* %8
br label %Patch
Patch: ; preds = %Body
%9 = getelementptr inbounds [40 x i64], [40 x i64]* %0, i32 0, i32 24
store i64 4707696, i64* %9
call anyregcc void (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.void(i64 1, i32 17, i8* inttoptr (i32 17 to i8*), i32 1, i8* inttoptr (i64 4707696 to i8*))
unreachable
}
And emit the assembly:
.text
.syntax unified
.eabi_attribute 67, "2.09" @ Tag_conformance
.eabi_attribute 6, 10 @ Tag_CPU_arch
.eabi_attribute 7, 65 @ Tag_CPU_arch_profile
.eabi_attribute 8, 1 @ Tag_ARM_ISA_use
.eabi_attribute 9, 2 @ Tag_THUMB_ISA_use
.fpu neon
.eabi_attribute 34, 1 @ Tag_CPU_unaligned_access
.eabi_attribute 17, 1 @ Tag_ABI_PCS_GOT_use
.eabi_attribute 20, 1 @ Tag_ABI_FP_denormal
.eabi_attribute 21, 1 @ Tag_ABI_FP_exceptions
.eabi_attribute 23, 3 @ Tag_ABI_FP_number_model
.eabi_attribute 24, 1 @ Tag_ABI_align_needed
.eabi_attribute 25, 1 @ Tag_ABI_align_preserved
.eabi_attribute 38, 1 @ Tag_ABI_FP_16bit_format
.eabi_attribute 14, 0 @ Tag_ABI_PCS_R9_use
.file "test"
.globl main @ -- Begin function main
.p2align 2
.type main,%function
.code 32 @ @main
main:
.fnstart
@ %bb.0: @ %Prologue
.save {r4, r5, r6, r7, r8, r9, r11, lr}
push {r4, r5, r6, r7, r8, r9, r11, lr}
ldrd r4, r5, [r0]
movw r2, #54640
ldrd r6, r7, [r0, #16]
movt r2, #71
adds r8, r4, #1
mov r3, #0
adc r9, r5, #0
orrs r1, r6, r7
moveq r8, r4
moveq r9, r5
strd r2, r3, [r0, #192]
strd r8, r9, [r0]
.Ltmp0:
movt r12, #0
movw r12, #17
blx r12
nop
.Lfunc_end0:
.size main, .Lfunc_end0-main
.fnend
@ -- End function
.section ".note.GNU-stack","",%progbits
.section .llvm_stackmaps,"a",%progbits
__LLVM_StackMaps:
.byte 3
.byte 0
.short 0
.long 1
.long 0
.long 1
.long 4294967295
.long 4294967295
.long 32
.long 0
.long 1
.long 0
.long 1
.long 0
.long .Ltmp0-main
.short 0
.short 1
.byte 1
.byte 0
.short 4
.short 2
.short 0
.long 0
.p2align 3
.short 0
.short 0
.p2align 3
================
Comment at: lib/MC/MCAsmStreamer.cpp:917
if (!Value->evaluateAsAbsolute(IntValue))
- report_fatal_error("Don't know how to emit this value.");
+ IntValue = -1;
----------------
I make it emit invalid integer for the output of assembly file.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54929/new/
https://reviews.llvm.org/D54929
More information about the llvm-commits
mailing list