This is an archive of the discontinued LLVM Phabricator instance.

MachineFunction: Copy call site info when duplicating insts
ClosedPublic

Authored by vsk on Apr 7 2020, 3:41 PM.

Details

Summary

Preserve call site info for duplicated instructions. We copy over the
call site info in CloneMachineInstrBundle to avoid repeated calls to
copyCallSiteInfo in CloneMachineInstr.

(Alternatively, we could copy call site info higher up the stack, e.g.
into TargetInstrInfo::duplicate, or even into individual backend passes.
However, I don't see how that would be safer or more general than the
current approach.)

Diff Detail

Event Timeline

vsk created this revision.Apr 7 2020, 3:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2020, 3:41 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
djtodoro accepted this revision.Apr 7 2020, 11:48 PM

Nice! Lgtm, thanks.

This revision is now accepted and ready to land.Apr 7 2020, 11:48 PM

(Alternatively, we could copy call site info higher up the stack, e.g.
into TargetInstrInfo::duplicate, or even into individual backend passes.
However, I don't see how that would be safer or more general than the
current approach.)

I agree with this.

This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Apr 8 2020, 11:45 AM

Looks like the test fails on Windows:
http://45.33.8.238/win/12463/step_11.txt

vsk added a comment.Apr 8 2020, 12:05 PM

I see 'unknown file: error: SEH exception with code 0x3221225477 thrown in the test body', but don't know what causes this. It looks like this has come up before (https://reviews.llvm.org/rL329195, and http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180910/587425.html). I'll try testing locally with UBSan to see if that uncovers anything. If not I'll disable the test.

vsk added a comment.Apr 8 2020, 12:12 PM

I disabled the unit test on Windows in 381bdd54.

vsk added a comment.Apr 8 2020, 12:19 PM

Somehow, details about the host architecture are creeping into the bogus target set up in MFCommon.inc. I've deleted the unit test to unblock the bots, until I can figure this out.