[llvm] [llvm][CodeGen] Intrinsic `llvm.powi/ldexp.*` code gen for vector arguments (PR #118242)

Zhaoxin Yang via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 23:06:01 PST 2024


================
@@ -2572,6 +2572,9 @@ SDValue DAGTypeLegalizer::PromoteIntOp_FRAMERETURNADDR(SDNode *N) {
 }
 
 SDValue DAGTypeLegalizer::PromoteIntOp_ExpOp(SDNode *N) {
+  if (N->getValueType(0).isVector())
+    return DAG.UnrollVectorOp(N);
----------------
ylzsx wrote:

Thanks, I will move it into this `if` statement to ensure that it won't promote the second operand. Do you think it's reasonable?
```
  if (LC == RTLIB::UNKNOWN_LIBCALL || !TLI.getLibcallName(LC)) {
    if (N->getValueType(0).isVector())
      return DAG.UnrollVectorOp(N);
    SmallVector<SDValue, 3> NewOps(N->ops());
    NewOps[1 + OpOffset] = SExtPromotedInteger(N->getOperand(1 + OpOffset));
    return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
  }
```

https://github.com/llvm/llvm-project/pull/118242


More information about the llvm-commits mailing list