This is an archive of the discontinued LLVM Phabricator instance.

[Debug] Look through bitcasts to find argument registers
ClosedPublic

Authored by olista01 on Sep 21 2015, 2:16 AM.

Details

Summary

On targets where f32 is not legal, we have to look through a BITCAST SDNode to find the register that an argument is stored in when emitting debug info, or we will not be able to emit a DW_AT_location for it.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 updated this revision to Diff 35215.Sep 21 2015, 2:16 AM
olista01 retitled this revision from to [Debug] Look through bitcasts to find argument registers.
olista01 updated this object.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.

Looks plausible, but I haven't done much with the debug info location side of things - wouldn't mind a second opinion.

test/DebugInfo/ARM/float-args.ll
3 ↗(On Diff #35215)

Usually I run the llc and dwarfdump commands together, rather than using a temp file:

llc -o - | llvm-dwarfdump - | FileCheck

(plus all the other usual args)

9 ↗(On Diff #35215)

Do you need a use of 'p' for this test case, or just the argument 'p'? (do you need the arithmetic - or can you just "return p" (or sometimes I'll use a stub-function to ensure a use:

void f1(float);
void f2(float p) {
  f1(p);
}

to make it clear that a use is necessary (& the call can't be optimized away) but it doesn't really matter what that use is))

olista01 updated this revision to Diff 35888.Sep 28 2015, 10:30 AM
olista01 removed rL LLVM as the repository for this revision.

Simplified test

aprantl added a subscriber: aprantl.Oct 5 2015, 3:11 PM
aprantl accepted this revision.Oct 12 2015, 8:43 AM
aprantl added a reviewer: aprantl.

This looks like a strict improvement.

This revision is now accepted and ready to land.Oct 12 2015, 8:43 AM
This revision was automatically updated to reflect the committed changes.