[PATCH] D69168: [PowerPC] Fold redundant load immediates of zero and delete if possible

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 10:58:05 PDT 2019


NeHuang added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1393
+// This is a modified version of FoldImmediate where the DefMI is not deleted
+// Its purpose is to defer the decision to delete to the caller of this function
+// and only performs the fold.
----------------
nit: typo - "delete the caller"


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:1405
+    return false;
+  if (DefMI.getOperand(1).getImm() != 0)
+    return false;
----------------
Is this function defined for load immediate 0 case only? Better to add it into function comments. 


================
Comment at: llvm/test/CodeGen/PowerPC/fold-remove-li.ll:3
+; NOTE: from its use in an isel and deleted as it is no longer in use.
+; RUN:  llc -mtriple=powerpc64le-unknown-linux-gnu -ppc-asm-full-reg-names \
+; RUN:      -verify-machineinstrs < %s | FileCheck %s
----------------
Any reason not adding a big endian test here? : )


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69168





More information about the llvm-commits mailing list