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

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 14:43:18 PDT 2018


Carrot added inline comments.


================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:3254
   /// \p PromotedInsts maps the instructions to their type before promotion.
-  static bool canGetThrough(const Instruction *Inst, Type *ConsideredExtType,
+  static bool canGetThrough(const Instruction *Inst, const Instruction *ExtInst,
+                            Type *ConsideredExtType, const TargetLowering &TLI,
----------------
qcolombet wrote:
> Could you add comments explaining what the new parameters are and their use?
The new parameters are used to check:
    1. if the extension is free.
    2. if the following transformation is doable

      and(ext(shl(opnd, cst)), cst) --> and(shl(ext(opnd), ext(cst)), cst) 


https://reviews.llvm.org/D45537





More information about the llvm-commits mailing list