[PATCH] D143578: [VP] Add vp.powi and a pass for expanding vp.powi before DAG.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 19:32:26 PST 2023
craig.topper added inline comments.
================
Comment at: llvm/lib/CodeGen/ExpandPowi.cpp:34
+
+// The expansioin is based on the c code of compiler-rt/__powidf2.c,
+// const int recip = b < 0;
----------------
expansion*
================
Comment at: llvm/lib/CodeGen/ExpandPowi.cpp:69
+ // Create phi of base.
+ Value *Base = Builder.CreatePHI(BaseTy, 2, "base");
+ cast<PHINode>(Base)->addIncoming(OrigBase, PreLoopBB);
----------------
CreatePHI returns a PHINode*, can we use that to avoid casts?
================
Comment at: llvm/lib/CodeGen/ExpandPowi.cpp:123
+ if (auto *II = dyn_cast<IntrinsicInst>(&I)) {
+ // TODO: Also suppot llvm.powi.
+ if (II->getIntrinsicID() == Intrinsic::vp_powi) {
----------------
support*
================
Comment at: llvm/lib/CodeGen/ExpandPowi.cpp:156
+ AU.addRequired<TargetPassConfig>();
+ AU.addPreserved<AAResultsWrapperPass>();
+ AU.addPreserved<GlobalsAAWrapperPass>();
----------------
Why does this require AA?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143578/new/
https://reviews.llvm.org/D143578
More information about the llvm-commits
mailing list