[llvm] 9b8c3c6 - [InstSimplify] Use poison instead of undef for unreachable inst

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 07:28:45 PDT 2024


Author: Nikita Popov
Date: 2024-06-24T16:25:40+02:00
New Revision: 9b8c3c687163931eee69c718c9d83a7fe6bc6f57

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

LOG: [InstSimplify] Use poison instead of undef for unreachable inst

Added: 
    

Modified: 
    llvm/lib/Analysis/InstructionSimplify.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 132dd1cc7396e..00ce0e264906e 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -7155,7 +7155,7 @@ Value *llvm::simplifyInstruction(Instruction *I, const SimplifyQuery &SQ) {
   /// If called on unreachable code, the instruction may simplify to itself.
   /// Make life easier for users by detecting that case here, and returning a
   /// safe value instead.
-  return Result == I ? UndefValue::get(I->getType()) : Result;
+  return Result == I ? PoisonValue::get(I->getType()) : Result;
 }
 
 /// Implementation of recursive simplification through an instruction's


        


More information about the llvm-commits mailing list