[PATCH] D46162: [PowerPC] Don't transform to CTR loop if the decrement branch instr. would end up in a different loop

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 17:22:11 PDT 2018


nemanjai created this revision.
nemanjai added reviewers: chandlerc, hfinkel, echristo, kbarton.
Herald added a subscriber: javed.absar.

This fixes PR37229.

Basically, we don't want to transform a loop to a CTR loop if the decrement-and-branch instruction would end up in an exiting block that is also part of another nested loop. Previously this couldn't happen because of how SCEV computed the trip count. However, the check is fundamentally needed.


Repository:
  rL LLVM

https://reviews.llvm.org/D46162

Files:
  lib/Target/PowerPC/PPCCTRLoops.cpp
  test/CodeGen/PowerPC/no-ctr-loop-if-exit-in-nested-loop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46162.144250.patch
Type: text/x-patch
Size: 3964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180427/ef6d7a9c/attachment.bin>


More information about the llvm-commits mailing list