[PATCH] Optimize sext/zext insertion algorithm in back-end
Jiangning Liu
liujiangning1 at gmail.com
Sun Sep 14 22:01:41 PDT 2014
Hi majnemer,
All feedbacks are accepted and patch is updated.
Thanks,
-Jiangning
================
Comment at: lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp:68
@@ +67,3 @@
+ ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
+ unsigned int NumOfSigned = 0, NumOfUnsigned = 0;
+ for (const User *U : V->users()) {
----------------
majnemer wrote:
> `int` is redundant.
OK.
================
Comment at: lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp:70
@@ +69,3 @@
+ for (const User *U : V->users()) {
+ if (const CmpInst *CI = dyn_cast<CmpInst>(U)) {
+ NumOfSigned += CI->isSigned();
----------------
majnemer wrote:
> `CmpInst` is redundant with the `dyn_cast`, `auto` would be more concise.
OK.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:867-868
@@ +866,4 @@
+
+ OpL = GetPromotedInteger(NewLHS);
+ OpR = GetPromotedInteger(NewRHS);
+
----------------
majnemer wrote:
> You'd save some space by declaring `OpL` and `OpR` while defining them.
OK.
http://reviews.llvm.org/D5257
More information about the llvm-commits
mailing list