This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Enable LoopDataPrefetch pass
ClosedPublic

Authored by XiaodongLoong on Mar 21 2023, 8:08 PM.

Details

Summary

Keep EnableLoopDataPrefetch option off for now because
we need a few more TTIs and ISels.

This patch is inspired by http://reviews.llvm.org/D17943.

Diff Detail

Event Timeline

XiaodongLoong created this revision.Mar 21 2023, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 8:08 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
XiaodongLoong requested review of this revision.Mar 21 2023, 8:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 8:08 PM
XiaodongLoong retitled this revision from Enable LoopDataPrefetch pass to [LoongArch] Enable LoopDataPrefetch pass.Mar 21 2023, 8:14 PM
SixWeining accepted this revision.Mar 21 2023, 10:56 PM

LGTM except a nit.

llvm/test/Transforms/LoopDataPrefetch/LoongArch/basic.ll
2

According to previous review comments from other guys, it's better to use ;; for non-CHECK and non-RUN lines although this is not a coding standard.

This revision is now accepted and ready to land.Mar 21 2023, 10:56 PM

Fix a comment nit.

XiaodongLoong marked an inline comment as done.Mar 21 2023, 11:07 PM
This revision was automatically updated to reflect the committed changes.

Hi I'm getting build failures with this patch due to a linker error where it says:

ld.lld: error: undefined symbol: llvm::createLoopDataPrefetchPass()
>>> referenced by LoongArchTargetMachine.cpp
>>>               lib/Target/LoongArch/CMakeFiles/LLVMLoongArchCodeGen.dir/LoongArchTargetMachine.cpp.o:((anonymous namespace)::LoongArchPassConfig::addIRPasses())
collect2: error: ld returned 1 exit status`

I think this is missing a dependence on ScalarOpts in lib/Target/LoongArch/CMakeLists.txt

OK, I'll reproduce this issue and submit a new patch. Thanks.

I think this is missing a dependence on ScalarOpts in lib/Target/LoongArch/CMakeLists.txt

I submit a new patch to fix this issue: https://reviews.llvm.org/D146806. Thanks.