This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Fix label address calculation for ppc64
ClosedPublic

Authored by spetrovic on Aug 20 2018, 4:19 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

spetrovic created this revision.Aug 20 2018, 4:19 AM
kbarton added a subscriber: sfertile.

I'm not overly familiar with this. I think @sfertile is more familiar with this, so I've added him as a reviewer.

nemanjai accepted this revision.Aug 27 2018, 7:56 AM

This seems to make sense to me and it resolves the kernel build issue. If @sfertile sees something wrong with the patch, he can chime in before or after the commit.

This revision is now accepted and ready to land.Aug 27 2018, 7:56 AM
sfertile accepted this revision.Aug 27 2018, 8:23 AM

LGTM with a few minor comments about the test.

test/CodeGen/PowerPC/ppc-label2.ll
1

Please add -ppc-asm-full-reg-names to the run steps.

3

Since the codegen is expected to be identical between position-dependent and position-independent we should use the same check-prefix for both.

19

The addis will always use the toc-pointer (r2) as the second operand so we should be checking for it directly.

addis r3, r2, .LC0@toc@ha
ld r3, .LC0@toc@l(r3)
spetrovic updated this revision to Diff 162867.Aug 28 2018, 7:55 AM
spetrovic marked 3 inline comments as done.

Comments Addressed. Thanks for the review.

jsji added a subscriber: jsji.Sep 7 2018, 9:05 AM

Committing this should also resolve https://bugs.llvm.org/show_bug.cgi?id=38864

joel added a subscriber: joel.Sep 10 2018, 3:24 AM

I tested this patch applied to trunk and can confirm this resolves the kernel build issue.

Do you need help committing this?

This revision was automatically updated to reflect the committed changes.