[PATCH] D109631: [HardwareLoops] Loop guard intrinsic to recognise zext

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 14 00:55:28 PDT 2021


samparker added inline comments.


================
Comment at: llvm/lib/CodeGen/HardwareLoops.cpp:369
+  // Check if Count is a zext.
+  Value *CountBefZext =
+      isa<ZExtInst>(Count) ? cast<ZExtInst>(Count)->getOperand(0) : nullptr;
----------------
sherwin-dc wrote:
> samparker wrote:
> > Can we use SCEV isLoopEntryGuardedByCond instead of doing the pattern matching? It feels like we should be able to replace IsCompareZero with it which would remove the need to do an explicit zext check. 
> It seems that isLoopEntryGuardedByCond is already used just before this (see below comment). This was added at the same time as IsCompareZero in D63809, so I'm not sure if IsCompareZero was needed in some way to explicitly check the instructions.
Ah, yes... those unfortunate cases where pattern matching is more useful than SCEV.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109631/new/

https://reviews.llvm.org/D109631



More information about the llvm-commits mailing list