[FPEnv] Add some comments to IRBuilder.h
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 14 Jan 2020 13:19:02 +0000 (14:19 +0100)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 14 Jan 2020 13:21:17 +0000 (14:21 +0100)
As requested via post-commit comment for D71467, this adds comments
documenting CreateFCmp vs. CreateFCmpS to the header file.

llvm/include/llvm/IR/IRBuilder.h

index 9035336..a6252b2 100644 (file)
@@ -2361,6 +2361,9 @@ public:
     return Insert(new ICmpInst(P, LHS, RHS), Name);
   }
 
+  // Create a quiet floating-point comparison (i.e. one that raises an FP
+  // exception only in the case where an input is a signaling NaN).
+  // Note that this differs from CreateFCmpS only if IsFPConstrained is true.
   Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
                     const Twine &Name = "", MDNode *FPMathTag = nullptr) {
     if (IsFPConstrained)
@@ -2373,6 +2376,9 @@ public:
     return Insert(setFPAttrs(new FCmpInst(P, LHS, RHS), FPMathTag, FMF), Name);
   }
 
+  // Create a signaling floating-point comparison (i.e. one that raises an FP
+  // exception whenever an input is any NaN, signaling or quiet).
+  // Note that this differs from CreateFCmp only if IsFPConstrained is true.
   Value *CreateFCmpS(CmpInst::Predicate P, Value *LHS, Value *RHS,
                      const Twine &Name = "", MDNode *FPMathTag = nullptr) {
     if (IsFPConstrained)