================
@@ -411,6 +412,13 @@ static Instruction 
*convertNvvmIntrinsicToLlvm(InstCombiner &IC,
     }
     return nullptr;
   }
+  case SPC_Fabs: {
+    if (!II->getType()->isDoubleTy())
+      return nullptr;
+    auto *Fabs = Intrinsic::getOrInsertDeclaration(
+        II->getModule(), Intrinsic::fabs, II->getType());
+    return CallInst::Create(Fabs, II->getArgOperand(0));
----------------
Artem-B wrote:

Nit: the early return does not help us much here. A positive `if 
(II->getType()->isDoubleTy()) { return  stuff}` followed by `return nullptr` 
would make more sense, IMO. Bonus points that we would not need `{}` around the 
whole `case` expression.

https://github.com/llvm/llvm-project/pull/135644
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to