[PATCH] D45537: [CodeGenPrepare] Move Extension Instructions Through Logical And Shift Instructions

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 24 14:23:12 PDT 2018


Carrot added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:3246
   /// either using the operands of \p Inst or promoting \p Inst.
+  /// The extension insturction is \p ExtInst.
   /// The type of the extension is defined by \p IsSExt.
----------------
qcolombet wrote:
> typo: instruction
deleted.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:3257
+                            Type *ConsideredExtType, const TargetLowering &TLI,
                             const InstrToOrigTy &PromotedInsts, bool IsSExt);
 
----------------
qcolombet wrote:
> Both IsSExt and ConsideredExtType can be derived from ExtInst now.
> We should get rid of those parameters.
Parameter ExtInst is deleted.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:3370
 
+  if (!TLI.isExtFree(ExtInst)) {
+    // ext(and(opnd, cst)) --> and(ext(opnd), ext(cst))
----------------
qcolombet wrote:
> I believe this check does not belong here.
> All the cost checks are done later.
> Here we are just checking if it is semantically correct to move the extension up.
Removed. It directly makes parameter TLI unnecessary. Another use of ExtInst in pattern and(ext(shl(opnd, cst)), cst) can be found through its user since it must be the only user. So we can keep the interface unchanged.


https://reviews.llvm.org/D45537





More information about the llvm-commits mailing list