[llvm] [InstCombine] Handle trunc to i1 in align assume. (PR #122949)
Andreas Jonson via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 22:55:23 PST 2025
================
@@ -3253,12 +3253,13 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
// call void @llvm.assume(i1 %D)
// into
// call void @llvm.assume(i1 true) [ "align"(i32* [[A]], i64 Constant + 1)]
- uint64_t AlignMask;
+ uint64_t AlignMask = 1;
if (EnableKnowledgeRetention &&
- match(IIOperand,
- m_SpecificICmp(ICmpInst::ICMP_EQ,
- m_And(m_Value(A), m_ConstantInt(AlignMask)),
- m_Zero()))) {
+ (match(IIOperand,
+ m_SpecificICmp(ICmpInst::ICMP_EQ,
+ m_And(m_Value(A), m_ConstantInt(AlignMask)),
+ m_Zero())) ||
+ match(IIOperand, m_Not(m_Trunc(m_Value(A)))))) {
----------------
andjo403 wrote:
fixed
https://github.com/llvm/llvm-project/pull/122949
More information about the llvm-commits
mailing list