[llvm] c625b60 - Remove duplicate code from wouldInstructionBeTriviallyDead

Serge Pavlov via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 2 02:05:56 PDT 2022


Author: Serge Pavlov
Date: 2022-04-02T16:04:39+07:00
New Revision: c625b6051c2490a35c6204ac3b512f8ea02fd2b5

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

LOG: Remove duplicate code from wouldInstructionBeTriviallyDead

There is a similar check few lines above in this function.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Local.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 461b075b934a3..ed1fe6bdf8893 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -500,16 +500,6 @@ bool llvm::wouldInstructionBeTriviallyDead(Instruction *I,
     if (isMathLibCallNoop(Call, TLI))
       return true;
 
-  // To express possible interaction with floating point environment constrained
-  // intrinsics are described as if they access memory. So they look like having
-  // side effect but actually do not have it unless they raise floating point
-  // exception. If FP exceptions are ignored, the intrinsic may be deleted.
-  if (auto *CI = dyn_cast<ConstrainedFPIntrinsic>(I)) {
-    Optional<fp::ExceptionBehavior> EB = CI->getExceptionBehavior();
-    if (!EB || *EB == fp::ExceptionBehavior::ebIgnore)
-      return true;
-  }
-
   return false;
 }
 


        


More information about the llvm-commits mailing list