[PATCH] D68841: [PowerPC] Do not convert loop to HW loop if the body contains calls to lrint/lround

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 15:39:49 PDT 2019


nemanjai created this revision.
nemanjai added reviewers: hfinkel, echristo, PowerPC.
Herald added subscribers: shchenz, jsji, MaskRay, kbarton.
Herald added a project: LLVM.
nemanjai marked an inline comment as done.
nemanjai added inline comments.
Herald added a subscriber: wuzish.


================
Comment at: lib/Target/PowerPC/PPCTargetTransformInfo.cpp:281
+          // a call for safety.
+          default: return true;
           // If we have a call to ppc_is_decremented_ctr_nonzero, or ppc_mtctr
----------------
@hfinkel What do you think about this conservative approach to prevent similar issues in the future? This is I think a third time I address a similar bug.


These two intrinsics are lowered to calls so should prevent the formation of CTR loops.

This patch rather aggressively disables CTR loops if there are calls to unknown intrinsics so that we don't keep hitting similar issues in the future. I will certainly collect some data about the number of CTR loops we emit before and after the patch before committing such an "aggressively pessimistic" patch. Posting this early just to gauge what others think about this conservative behaviour.


Repository:
  rL LLVM

https://reviews.llvm.org/D68841

Files:
  lib/Target/PowerPC/PPCTargetTransformInfo.cpp
  test/CodeGen/PowerPC/pr43527.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68841.224493.patch
Type: text/x-patch
Size: 4614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191010/2c9296c3/attachment.bin>


More information about the llvm-commits mailing list