[llvm] [DXIL] Implement pow lowering (PR #86733)

Joshua Batista via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 14:05:57 PDT 2024


================
@@ -197,6 +198,26 @@ static bool expandLog10Intrinsic(CallInst *Orig) {
   return expandLogIntrinsic(Orig, numbers::ln2f / numbers::ln10f);
 }
 
+static bool expandPowIntrinsic(CallInst *Orig) {
----------------
bob80905 wrote:

Agreed, in terms of aesthetics, it would look bad. However, (this may not be the PR to make this change), maybe this could be considered:

switch (F.getIntrinsicID()) {
  case <a pre-existing case>:
     expand<whatever function>(...);
     break;
  ....
  default:
     return false;
  }
  return true;

There would be break statements in each case, but that could be an improvement? This is a bit pedantic but it feels slightly icky to have a function return a boolean unconditionally.

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


More information about the llvm-commits mailing list