[PATCH] D39009: [PowerPC] Simplify a Swap if it feeds a Splat

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 10:55:38 PDT 2017


echristo added a comment.

First pass on review.



================
Comment at: lib/Target/PowerPC/PPCMIPeephole.cpp:379
+
+        // Splat is fed by a SWAP: XXPERMDI %VA, %VA, 2
+        if (DefOpcode == PPC::XXPERMDI && MI.getOperand(1).isImm()) {
----------------
A bit more elaborate description here please.


================
Comment at: lib/Target/PowerPC/PPCMIPeephole.cpp:389-391
+            if (MI.getOpcode() == PPC::VSPLTB) {
+              NewElem = (SplatImm + 8) & 0xF;
+            }
----------------
Style wise we try to avoid single statements in braces.


================
Comment at: test/CodeGen/PowerPC/ppc64-peephole-swap.ll:1
+; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr9 -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -verify-machineinstrs | FileCheck %s -check-prefix=CHECK-PWR8
----------------
Please add a description of what the testcase is supposed to be testing for each case.


https://reviews.llvm.org/D39009





More information about the llvm-commits mailing list