This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Scan for existing loop intrinsics
ClosedPublic

Authored by samparker on Jun 12 2019, 8:48 AM.

Details

Summary

TTI should report that it's not profitable to generate a hardware loop if it, or one of its child loops, has already been converted.

Diff Detail

Event Timeline

samparker created this revision.Jun 12 2019, 8:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2019, 8:48 AM

I can't see what's being changed in ARMTargetTransformInfo.cpp. Can you upload the patch with more context?

SjoerdMeijer added inline comments.Jun 12 2019, 9:16 AM
lib/Target/ARM/ARMTargetTransformInfo.cpp
839

We can nest hwloops, so it would be legal, but we think it will never be benecial because it involves spilling and reloading LR. Do we really need to set IsNestingLegal? Don't think this is important, but was just curious; I haven't looked and reminded myself how it is used.

samparker marked an inline comment as done.Jun 12 2019, 9:20 AM
samparker added inline comments.
lib/Target/ARM/ARMTargetTransformInfo.cpp
839

Yep, so 'Legal' is a bit of a misnomer, but it prevents the independent pass from trying to generate nested hardware loops. The default is false, but I wanted to make it explicit here too.

SjoerdMeijer accepted this revision.Jun 13 2019, 12:27 AM

Looks very reasonable to me.

lib/Target/ARM/ARMTargetTransformInfo.cpp
815

nitpick: perhaps "found hwloop intrinsic"

test/Transforms/HardwareLoops/ARM/structure.ll
138

another nit: don't need the comments

This revision is now accepted and ready to land.Jun 13 2019, 12:27 AM
dmgreen added inline comments.Jun 13 2019, 1:00 AM
lib/Target/ARM/ARMTargetTransformInfo.cpp
809

IntrinsicInst has a getIntrinsicID directly, I believe.

This revision was automatically updated to reflect the committed changes.
samparker marked an inline comment as done.Jun 13 2019, 1:29 AM