[llvm] [GlobalISel][AArch64][AMDGPU] Expand FPOWI into series of multiplication (PR #95217)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 21 11:11:31 PDT 2024


================
@@ -7356,6 +7356,38 @@ void CombinerHelper::applyBuildFnMO(const MachineOperand &MO,
   Root->eraseFromParent();
 }
 
+void CombinerHelper::applyExpandFPowI(MachineInstr &MI) {
+  auto [Dst, Base, Exp] = MI.getFirst3Regs();
+  LLT Ty = MRI.getType(Dst);
+
+  std::optional<int64_t> ConstantExpValue = getIConstantVRegSExtVal(Exp, MRI);
----------------
arsenm wrote:

Can you avoid the lookup again? Already matched the immediate in the pattern 

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


More information about the llvm-commits mailing list