[llvm] [NFC][AArch64] Refactor AArch64LoopIdiomTransform in preparation for more idioms (PR #78471)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 05:55:29 PST 2024


================
@@ -202,32 +227,135 @@ bool AArch64LoopIdiomTransform::run(Loop *L) {
                     << CurLoop->getHeader()->getParent()->getName()
                     << "] Loop %" << CurLoop->getHeader()->getName() << "\n");
 
-  return recognizeByteCompare();
+  MemCompareIdiom BCI(TTI, DT, LI, L);
+  if (BCI.recognize()) {
----------------
david-arm wrote:

I wanted to leave the door open for recognising more types than just bytes. Also, given the class itself is called `MemCompareIdiom` I was worried that `MemCompareIdiom::recognizeByteCompare` was a bit wordy, but I'm happy to  change it to `recognizeMemCompare` instead of just `recognize` if that helps? 

https://github.com/llvm/llvm-project/pull/78471


More information about the llvm-commits mailing list