[PowerPC] Fixing buildbod failure ppc64le-lld-multistage-test
authorMasoud Ataei <msd.ataei@gmail.com>
Wed, 2 Feb 2022 18:29:22 +0000 (10:29 -0800)
committerMasoud Ataei <msd.ataei@gmail.com>
Wed, 2 Feb 2022 18:29:22 +0000 (10:29 -0800)
llvm/lib/Target/PowerPC/PPCGenScalarMASSEntries.cpp

index 93b6d0f..00931b1 100644 (file)
@@ -62,12 +62,20 @@ private:
 // Returns true if 'afn' flag exists on the call instruction with the math
 // function
 bool PPCGenScalarMASSEntries::isCandidateSafeToLower(const CallInst &CI) const {
+  // skip functions with no scalar or vector FP type (like cosisin)
+  if (!isa<FPMathOperator>(CI))
+    return false;
+
   return CI.hasApproxFunc();
 }
 
 // Returns true if 'nnan', 'ninf' and 'nsz' flags exist on the call instruction
 // with the math function
 bool PPCGenScalarMASSEntries::isFiniteCallSafe(const CallInst &CI) const {
+  // skip functions with no scalar or vector FP type (like cosisin)
+  if (!isa<FPMathOperator>(CI))
+    return false;
+
   // FIXME: no-errno and trapping-math need to be set for MASS converstion
   // but they don't have IR representation.
   return CI.hasNoNaNs() && CI.hasNoInfs() && CI.hasNoSignedZeros();