[llvm] 6d63bf9 - [IR] Use UnaryOperator::CreateFNeg in NoFolder::createFNeg

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 11:08:53 PDT 2019


Author: Craig Topper
Date: 2019-10-28T11:08:28-07:00
New Revision: 6d63bf919489608cb1c687046f79facfe23240d4

URL: https://github.com/llvm/llvm-project/commit/6d63bf919489608cb1c687046f79facfe23240d4
DIFF: https://github.com/llvm/llvm-project/commit/6d63bf919489608cb1c687046f79facfe23240d4.diff

LOG: [IR] Use UnaryOperator::CreateFNeg in NoFolder::createFNeg

If IRBuilder is constructed using the NoFolder constant folder, we should use the Unary FNeg to match the non-constant part of IRBuilder.

Differential Revision: https://reviews.llvm.org/D69396

Added: 
    

Modified: 
    llvm/include/llvm/IR/NoFolder.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/NoFolder.h b/llvm/include/llvm/IR/NoFolder.h
index 0e3c19f4947f..835236b1eac0 100644
--- a/llvm/include/llvm/IR/NoFolder.h
+++ b/llvm/include/llvm/IR/NoFolder.h
@@ -196,7 +196,7 @@ class NoFolder {
   }
 
   Instruction *CreateFNeg(Constant *C) const {
-    return BinaryOperator::CreateFNeg(C);
+    return UnaryOperator::CreateFNeg(C);
   }
 
   Instruction *CreateNot(Constant *C) const {


        


More information about the llvm-commits mailing list