This is an archive of the discontinued LLVM Phabricator instance.

Fix unwind information for floating point registers
ClosedPublic

Authored by Jackson on Aug 30 2018, 9:59 AM.

Details

Summary

Fixes the unwind information generated for floating-point registers. Previously, all padding registers were assumed to be four bytes wide. Now, the width of the register is used to specify the amount of padding.

Diff Detail

Repository
rL LLVM

Event Timeline

Jackson created this revision.Aug 30 2018, 9:59 AM
chill edited reviewers, added: chill; removed: momchil.velikov.Aug 30 2018, 10:02 AM
olista01 added inline comments.Aug 31 2018, 1:59 AM
lib/Target/ARM/ARMAsmPrinter.cpp
1105 ↗(On Diff #163358)

We already get the MachineFunction and TargetRegisterInfo at the top of this function, and the MachineRegisterInfo should be moved up there to keep these together.

test/CodeGen/ARM/unwind-fp.ll
1 ↗(On Diff #163358)

This test can be simplified a lot, to something like this:

target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7-arm-none-eabi"

define void @foo() minsize {
entry:
  %a = alloca i32, align 4
  call void asm sideeffect "", "r,~{d8}"(i32* %a)
  ret void
}

Also, it would be clearer to put the CHECK line inside the IR for the function being tested, and to also check the other frame directives and the actual frame setup instructions.

Jackson updated this revision to Diff 163550.Aug 31 2018, 9:32 AM

Thanks for the feedback. I have vastly simplified the testcase as suggested and deduplicated and lifted the definitions of {Target,Machine}RegisterInformation and MachineFunction out of the loop.

Jackson marked 2 inline comments as done.Aug 31 2018, 9:32 AM
olista01 accepted this revision.Sep 19 2018, 3:11 AM
This revision is now accepted and ready to land.Sep 19 2018, 3:11 AM

Thanks for the review. Since I don't have commit rights, could this be committed on my behalf?

This revision was automatically updated to reflect the committed changes.