[llvm-branch-commits] [llvm] [InstCombine] Enable select freeze poison folding when storing value (PR #129776)

2025-03-05 Thread John McIver via llvm-branch-commits
jmciver wrote: @dtcxzyw I was not aware I should be using a fuzzer. What tool would you recommend? >From a correctness standpoint the match is relatively narrow and I have >discussed with @nlopes extensively. The patch has been tested with bootstrap >build of LLVM running all regressions. Add

[llvm-branch-commits] [llvm] [InstCombine] Enable select freeze poison folding when storing value (PR #129776)

2025-03-05 Thread John McIver via llvm-branch-commits
@@ -4813,15 +4813,22 @@ Instruction *InstCombinerImpl::visitFreeze(FreezeInst &I) { // TODO: This could use getBinopAbsorber() / getBinopIdentity() to avoid // duplicating logic for binops at least. auto getUndefReplacement = [&I](Type *Ty) { -Constant *BestVal

[llvm-branch-commits] [llvm] [InstCombine] Enable select freeze poison folding when storing value (PR #129776)

2025-03-05 Thread John McIver via llvm-branch-commits
@@ -3124,6 +3124,19 @@ inline auto m_c_LogicalOp(const LHS &L, const RHS &R) { return m_LogicalOp(L, R); } +struct GuaranteedNotToBeUndefOrPoison_match { + template bool match(ITy *V) { +if (auto *AsValue = dyn_cast(V)) + return isGuaranteedNotToBeUndefOrPoison(As

[llvm-branch-commits] [llvm] [InstCombine] Enable select freeze poison folding when storing value (PR #129776)

2025-03-05 Thread John McIver via llvm-branch-commits
jmciver wrote: @nikic and @dtcxzyw thanks for the feedback. This patch does bypasses the need for freeze poison -> null canonicalization removal in InstCombine. To provide context I am seeing the lack of store of select freeze poison folding in uninitialized memory semantics work that I am do

[llvm-branch-commits] [llvm] [InstCombine] Enable select freeze poison folding when storing value (PR #129776)

2025-03-04 Thread John McIver via llvm-branch-commits
https://github.com/jmciver ready_for_review https://github.com/llvm/llvm-project/pull/129776 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits