[llvm] [InstCombine] Support well-defined recurrences in isGuaranteedNotToBeUndefOrPoison (PR #150420)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 29 01:17:10 PDT 2025
================
@@ -4933,7 +4933,8 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
// poison.
Value *MaybePoisonOperand = nullptr;
for (Value *V : OrigOpInst->operands()) {
- if (isa<MetadataAsValue>(V) || isGuaranteedNotToBeUndefOrPoison(V) ||
+ if (isa<MetadataAsValue>(V) ||
+ isGuaranteedNotToBeUndefOrPoison(V, &AC, &OrigFI, &DT) ||
----------------
david-arm wrote:
Given this is now passing in the assumption cache we should be able to remove freeze in more places if there is an assume instruction associated with one of the operands. It would be good to add a test for this I think.
https://github.com/llvm/llvm-project/pull/150420
More information about the llvm-commits
mailing list