================
@@ -1655,6 +1655,19 @@ static AttrBuilder 
IdentifyValidPoisonGeneratingAttributes(CallBase &CB) {
   return Valid;
 }
 
+// Preserve a no-infinity return constraint when the original call disappears.
+static void preserveNoInfReturn(CallBase &CB, ArrayRef<ReturnInst *> Returns) {
+  if ((CB.getRetNoFPClass() & fcInf) != fcInf)
+    return;
+
+  for (ReturnInst *RI : Returns) {
+    auto *SI = dyn_cast_if_present<SelectInst>(RI->getReturnValue());
+    if (SI && SI->getType()->isFloatingPointTy() && SI->hasOneUse() &&
----------------
arsenm wrote:

```suggestion
    auto *SI = dyn_cast<SelectInst>(RI->getReturnValue());
    if (SI && SI->hasOneUse() &&
```

This is implied by the return attribute 

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

Reply via email to