This is an archive of the discontinued LLVM Phabricator instance.

InferAddressSpaces: Move target intrinsic handling to TTI
ClosedPublic

Authored by arsenm on Aug 13 2019, 2:28 PM.

Details

Summary

I'm planning on handling intrinsics that will benefit from checking
the address space enums. Don't bother moving the address collection
for now, since those won't need th enums.

Diff Detail

Event Timeline

arsenm created this revision.Aug 13 2019, 2:28 PM
hliao added inline comments.Aug 14 2019, 6:37 AM
include/llvm/Analysis/TargetTransformInfo.h
374

In general, we need to tell the value use, says save a generic pointer to somewhere, of a pointer from its address use. Only the later needs address-space resolving or inferring. It would be better to add the extra opnd index to help the target checks that case and only rewrite the address use.

arsenm marked an inline comment as done.Aug 14 2019, 7:50 AM
arsenm added inline comments.
include/llvm/Analysis/TargetTransformInfo.h
374

InferAddressSpaces doesn't track this based on the operand index. This will expect any operands reported by collectRewritableIntrinsicOperands to be replaced, so it shouldn't be reporting any non-address uses

hliao added inline comments.Aug 14 2019, 8:05 AM
include/llvm/Analysis/TargetTransformInfo.h
374

following the same idea adding rewriteIntrinsicWithAddressSpace, collectRewritableIntrinsicOperands should be added a target hook as well.

arsenm updated this revision to Diff 215141.Aug 14 2019, 9:26 AM

Also move operand collection to TTI

hliao accepted this revision.Aug 14 2019, 9:29 AM

LGTM

This revision is now accepted and ready to land.Aug 14 2019, 9:29 AM
arsenm closed this revision.Aug 14 2019, 11:12 AM

r368895