[llvm] [DXIL] Implement pow lowering (PR #86733)
Joshua Batista via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 15:32:05 PDT 2024
================
@@ -197,6 +198,26 @@ static bool expandLog10Intrinsic(CallInst *Orig) {
return expandLogIntrinsic(Orig, numbers::ln2f / numbers::ln10f);
}
+static bool expandPowIntrinsic(CallInst *Orig) {
+
+ Value *X = Orig->getOperand(0);
+ Value *Y = Orig->getOperand(1);
+ Type *Ty = X->getType();
+ IRBuilder<> Builder(Orig->getParent());
+ Builder.SetInsertPoint(Orig);
+
+ auto *Log2Call =
----------------
bob80905 wrote:
This is an excellent, informative answer! Didn't know about constant propagation or strength reduction, very helpful resources :)
Presumably the optimization passes that would account for a 0 base would occur before this lowering occurs. If that's the case, LGTM
https://github.com/llvm/llvm-project/pull/86733
More information about the llvm-commits
mailing list