This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Handle llvm.read_register
ClosedPublic

Authored by arsenm on Dec 30 2019, 6:46 AM.

Details

Summary

Compared to the attempt in bdcc6d3d2638b3a2c99ab3b9bfaa9c02e584993a,
this uses intermediate generic instructions. This does create more
work for targets to support it though.

Diff Detail

Event Timeline

arsenm created this revision.Dec 30 2019, 6:46 AM

Hi Matt,

Can you foresee any additional use to selectCommon? I'm not familiar with Global Isel that much, but it feels this is easier to implement, but may not be a good long term strategy.

--renato

arsenm added a comment.Jan 6 2020, 8:54 AM

Hi Matt,

Can you foresee any additional use to selectCommon? I'm not familiar with Global Isel that much, but it feels this is easier to implement, but may not be a good long term strategy.

--renato

The 3 big things SelectionDAG uses for this are in the same category. read_register, write_register and inline asm. The rest doesn't really apply. The alternative is every target needs to implement the exact same string parsing which is unneeded duplication

rengolin accepted this revision.Jan 6 2020, 9:10 AM

The 3 big things SelectionDAG uses for this are in the same category. read_register, write_register and inline asm. The rest doesn't really apply. The alternative is every target needs to implement the exact same string parsing which is unneeded duplication

Right, then perhaps a more strict name would help this not turn into a medusa of left over cases. :)

LGTM, thanks!

This revision is now accepted and ready to land.Jan 6 2020, 9:10 AM

+ @dsanders

Since you're introducing a new opcode for this, can't we implement a Lower action? Daniel mentioned a while ago that he also prefers having targets explicitly opt-in to using default lowerings/expansions.

arsenm updated this revision to Diff 237107.Jan 9 2020, 9:16 AM

Move to lowering

arsenm requested review of this revision.Jan 9 2020, 9:16 AM
aemerson accepted this revision.Jan 9 2020, 9:36 AM

LGTM.

This revision is now accepted and ready to land.Jan 9 2020, 9:36 AM
arsenm closed this revision.Jan 9 2020, 2:07 PM

4a94b8d648c5f44edf0e84df8e260a06cafb85b5

foad added a subscriber: foad.Jan 27 2020, 8:45 AM

Can you add G_READ_REGISTER and G_WRITE_REGISTER to docs/GlobalISel/GenericOpcode.rst?