[llvm] [InstSimplify] Do not simplify a multi-use freeze in `simplifyWithOpReplaced` (PR #91215)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon May 6 18:24:53 PDT 2024
================
@@ -4312,6 +4312,10 @@ static Value *simplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
if (match(I, m_Intrinsic<Intrinsic::is_constant>()))
return nullptr;
+ // Don't simplify a use of a multi-use freeze.
+ if (isa<FreezeInst>(I) && !I->hasOneUse())
----------------
nikic wrote:
We cannot check uses in InstSimplify. There could be multi-use down-stream and not all of them replaced, or similar. We should just skip freeze entirely.
https://github.com/llvm/llvm-project/pull/91215
More information about the llvm-commits
mailing list