================
@@ -58,6 +58,55 @@ void SPIRVCombinerHelper::applySPIRVDistance(MachineInstr 
&MI) const {
   MI.eraseFromParent();
 }
 
+/// This match is part of a combine that
+/// rewrites X / length(X) to normalize(X)
+///   (vXf32 (g_fdiv
+///             (vXf32 X)
+///             (vXf32 splat
+///                    (f32 (g_intrinsic length (vXf32 X))))))
+/// ->
+///   (vXf32 (g_intrinsic normalize (vXf32 X)))
+///
+bool SPIRVCombinerHelper::matchFDivToNormalize(MachineInstr &MI) const {
----------------
bob80905 wrote:

Question, why would we want to do this?
The header implementation takes any normalize call and breaks it down into X / 
length(X). Isn't this just doing the opposite of what the header did for us 
already?

https://github.com/llvm/llvm-project/pull/216228
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to