[PATCH] D48149: Expand constrained FP POWI

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 15:44:40 PDT 2018


cameron.mcinally marked 10 inline comments as done.
cameron.mcinally added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1154
                                  EltVT, Op.getOperand(j), Idx);
       Opers.push_back(Oper);
     }
----------------
cameron.mcinally wrote:
> craig.topper wrote:
> > Why couldn't we just detect that the type of Op.getOperand(j) is a scalar type and skip the extract? Then you could handle POWI in in this code without the separate function. Maybe with some asserts to ensure that type is vector everything but the last operand of POWI.
> Good call. I was hung up on checking the FPOWI opcode and missed the obvious...
I made this change, but purposefully did not add an ASSERT checking for POWI. I suspect the fix I made is general enough. And, we might possibly see similar arguments when we get to the CMP/CVT/etc intrinsics. Okay with you, Craig?


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp:1192
+
+    Opers.push_back(Chain);
+    Opers.push_back(Base);
----------------
craig.topper wrote:
> There's no reason for Opers to be a SmallVector.
> 
> You could just do
> 
> ```
> SDValue Opers[] = { Chain, Base, Power };
> ```
This whole function was removed.


https://reviews.llvm.org/D48149





More information about the llvm-commits mailing list