[PATCH] D77448: [PowerPC] Canonicalize shuffles to match more single-instruction masks on LE

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 19:16:13 PDT 2020


steven.zhang added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:14037
+  // Find first non-undef input.
+  for (int i = 0, e = Op.getNumOperands(); i < e; i++) {
+    FirstOp = Op.getOperand(i);
----------------
lei wrote:
> Can this and the for-loop below be a range based for-loop?
> ```
> for (auto FirstOp : Op->op_values())
>   if (!FirstOp.isUndef())
>     break;
> ```
Can we use llvm::any_of to make the code more compact ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77448





More information about the llvm-commits mailing list