This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Implement RISCVRegisterInfo::getPointerRegClass
ClosedPublic

Authored by luismarques on Aug 26 2019, 10:18 AM.

Details

Summary

TargetRegisterInfo::getPointerRegClass is used, directly and indirectly, by several passes and CodeGen so it should be implemented (overridden) for RISC-V too.

@reshabh This will probably affect your GSoC work implementing 64-bit pointers on RV32. Not sure what the status of that is and how you want to proceed, but I imagine you'll just tweak this method once this patch is committed?

Diff Detail

Event Timeline

luismarques created this revision.Aug 26 2019, 10:18 AM

LGTM with one question:

This should be causing an assert everywhere it's used right now, shouldn't it? I'm confused that we're not seeing any of those asserts/failures in our testcases.

This should be causing an assert everywhere it's used right now, shouldn't it? I'm confused that we're not seeing any of those asserts/failures in our testcases.

That's because overall it's not used much, so we were "lucky" not to hit the assert. But your reasoning makes sense.

lenary accepted this revision.Aug 27 2019, 4:46 AM

This should be causing an assert everywhere it's used right now, shouldn't it? I'm confused that we're not seeing any of those asserts/failures in our testcases.

That's because overall it's not used much, so we were "lucky" not to hit the assert. But your reasoning makes sense.

Ok, cool. I'm happy for this to land without a testcase.

This revision is now accepted and ready to land.Aug 27 2019, 4:46 AM
asb accepted this revision.Aug 27 2019, 6:22 AM

This triggers when building the Linux kernel too. I forgot to submit this patch after getting that working. I also couldn't get a meaningful test case for it that didn't seem like it would be horribly brittle. LGTM, thanks.

Ok, cool. I'm happy for this to land without a testcase.

I didn’t add a test case because it would be too fragile and would only test that method very indirectly.

reshabh accepted this revision.Aug 27 2019, 6:48 AM

Thanks for letting me know about this, right now we are focusing on getting some perf numbers out of it. After testing I'll merge all latest commits from the upstream then I think it will be totally viable to tweak this method for 64 bit pointer support. Again thanks for keeping me in the loop.

This revision was automatically updated to reflect the committed changes.