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

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 16:04:27 PDT 2018


qcolombet 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.
----------------
typo: instruction


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


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:3370
 
+  if (!TLI.isExtFree(ExtInst)) {
+    // ext(and(opnd, cst)) --> and(ext(opnd), ext(cst))
----------------
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.


https://reviews.llvm.org/D45537





More information about the llvm-commits mailing list