[llvm] 8d2bae8 - [InstSimplify] Clarify simplifyWithOpReplaced() refinement requirement (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 02:52:11 PDT 2023


Author: Nikita Popov
Date: 2023-05-16T11:50:29+02:00
New Revision: 8d2bae8c227debdcd0632ce364c58883bd12ad84

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

LOG: [InstSimplify] Clarify simplifyWithOpReplaced() refinement requirement (NFC)

In order to justify some of the special cases we have, we need to
assume that Op/RepOp are non-poison. For the places where this
function is used, if one of these is poison, then the select result
is poison anyway.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/InstructionSimplify.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/InstructionSimplify.h b/llvm/include/llvm/Analysis/InstructionSimplify.h
index 761ed2eec03f..0d65041f2217 100644
--- a/llvm/include/llvm/Analysis/InstructionSimplify.h
+++ b/llvm/include/llvm/Analysis/InstructionSimplify.h
@@ -336,6 +336,7 @@ simplifyInstructionWithOperands(Instruction *I, ArrayRef<Value *> NewOps,
 /// return null.
 /// AllowRefinement specifies whether the simplification can be a refinement
 /// (e.g. 0 instead of poison), or whether it needs to be strictly identical.
+/// Op and RepOp can be assumed to not be poison when determining refinement.
 Value *simplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
                               const SimplifyQuery &Q, bool AllowRefinement);
 


        


More information about the llvm-commits mailing list