https://github.com/goldsteinn closed
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From 686eff52ac0878fa9545481eaf32b47350c68be8 Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/7] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -6411,6 +6411,44 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
@@ -978,8 +1031,10 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value
*V, APInt DemandedMask,
}
// If the client is only demanding bits that we know, return the known
- // constant.
- if (DemandedMask.isSubsetOf(Known.Zero|Known.One))
+ // constant. We can't dir
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From 686eff52ac0878fa9545481eaf32b47350c68be8 Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/7] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From 686eff52ac0878fa9545481eaf32b47350c68be8 Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/8] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
goldsteinn wrote:
> The InstCombine/ptrmask.ll test is failing in CI.
Bah, forgot to rebase the instcombine ptrmask tests ontop of simplication fix.
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.or
nikic wrote:
The InstCombine/ptrmask.ll test is failing in CI.
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/arichardson commented:
All my comments have been resolved, thank you very much!
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/c
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From 24c65907e7e6792e2d5395102992ce3cdb42fb6d Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/7] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -6411,6 +6411,40 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
@@ -6411,6 +6411,40 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From ddc443b6af4708a37317c9f9133bb1bbe460ecba Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/7] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -6411,6 +6411,40 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
@@ -984,7 +1041,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
// If the client is only demanding bits that we know, return the known
// constant.
- if (DemandedMask.isSubsetOf(Known.Zero|Known.One))
+ if (MaySimplifyAsConstant && De
https://github.com/arichardson edited
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6411,6 +6411,40 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
@@ -984,7 +1041,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
// If the client is only demanding bits that we know, return the known
// constant.
- if (DemandedMask.isSubsetOf(Known.Zero|Known.One))
+ if (MaySimplifyAsConstant && De
@@ -984,7 +1041,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
// If the client is only demanding bits that we know, return the known
// constant.
- if (DemandedMask.isSubsetOf(Known.Zero|Known.One))
+ if (MaySimplifyAsConstant && De
@@ -143,7 +155,7 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
return SimplifyMultipleUseDemandedBits(I, DemandedMask, Known, Depth,
CxtI);
KnownBits LHSKnown(BitWidth), RHSKnown(BitWidth);
-
+ bool MaySimplifyAsConstant = true;
---
@@ -1973,6 +1978,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
*II, Builder.CreateIntrinsic(InnerPtr->getType(), Intrinsic::ptrmask,
{InnerPtr, NewMask}));
}
+bool Changed = false;
+// See if we
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
goldsteinn wrote:
Rebased ontop of nikic's patch
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6411,6 +6411,41 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From 9f9f1d20759f6a9d71f9131baa656bfb7d459095 Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/6] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -6411,6 +6411,41 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
goldsteinn wrote:
> > > We should update LangRef and require that the integer arg has the size of
> > > the pointer index type
> >
> >
> > As in disallow say `ptrmask.p0.i32` on typical systems with 64-bit pointer
> > index? (So a lot of the current usages). Or something else?
>
> Yes, exact
nikic wrote:
> > We should update LangRef and require that the integer arg has the size of
> > the pointer index type
>
> As in disallow say `ptrmask.p0.i32` on typical systems with 64-bit pointer
> index? (So a lot of the current usages). Or something else?
Yes, exactly. I've started working
goldsteinn wrote:
> We should update LangRef and require that the integer arg has the size of the
> pointer index type
As in disallow say `ptrmask.p0.i32` on typical systems with 64-bit
pointer/index?
> (with current GEP semantics implying a 1-extend to pointer type width),
> implement a Ver
nikic wrote:
We should update LangRef and require that the integer arg has the size of the
pointer index type (with current GEP semantics implying a 1-extend to pointer
type width), implement a Verifier check for that, and add an assert in SDAG
lowering that the index type size is the pointer
arichardson wrote:
> > Since the langref definition is based on GEP, can we use index width
> > instead of pointer width? If you disagree with this, it would still be good
> > if you could add a test where the datalayout has index width < pointer
> > width to show the current semantics.
>
> A
goldsteinn wrote:
ping.
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6397,6 +6397,41 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
goldsteinn wrote:
> Since the langref definition is based on GEP, can we use index width instead
> of pointer width? If you disagree with this, it would still be good if you
> could add a test where the datalayout has index width < pointer width to show
> the current semantics.
Any target inm
@@ -6397,6 +6397,41 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+if (isa(Op0) || isa(Op1))
+ return PoisonValue::get(Op0->getType());
+
+
goldsteinn wrote:
> Since the langref definition is based on GEP, can we use index width instead
> of pointer width? If you disagree with this, it would still be good if you
> could add a test where the datalayout has index width < pointer width to show
> the current semantics.
I think thats
arichardson wrote:
Since the langref definition is based on GEP, can we use index width instead of
pointer width? If you disagree with this, it would still be good if you could
add a test where the datalayout has index width < pointer width to show the
current semantics.
https://github.com/ll
goldsteinn wrote:
ping.
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/goldsteinn edited
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
goldsteinn wrote:
Okay, rebased ontop of your vec support patches + added vec support/tests.
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From f405167577470a3e53fdd9a52fbe90710e5899e4 Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/9] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/goldsteinn edited
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/arichardson resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/arichardson edited
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/nikic resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nikic resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -898,6 +910,53 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
}
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// Likely not much needs to be changed here to
https://github.com/nikic resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/nikic resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
https://github.com/dtcxzyw resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/dtcxzyw resolved
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From a2e343dab6e698621a9121c767d2dca285d27b5d Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/9] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -1984,10 +1984,30 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
//-> (ptrmask p, (and A, B))
if (match(Op0, m_OneUse(m_Intrinsic(
m_Value(InnerPtr), m_Value(InnerMask) {
+ // See if combining the two masks is fre
@@ -898,6 +910,53 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
}
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// Likely not much needs to be changed here to
@@ -898,6 +910,53 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
}
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// Likely not much needs to be changed here to
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -898,6 +910,53 @@ Value *InstCombinerImpl::SimplifyDemandedUseBits(Value *V,
APInt DemandedMask,
}
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// Likely not much needs to be changed here to
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
{InnerPtr, NewMask}));
}
}
+bool Changed = false;
+KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II);
+// See if we can deduce no
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
{InnerPtr, NewMask}));
}
}
+bool Changed = false;
+KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II);
+// See if we can deduce no
@@ -1985,6 +1985,28 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
{InnerPtr, NewMask}));
}
}
+bool Changed = false;
+KnownBits Known = computeKnownBits(II, /*Depth*/ 0, II);
+// See if we can deduce no
@@ -1984,10 +1984,30 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
//-> (ptrmask p, (and A, B))
if (match(Op0, m_OneUse(m_Intrinsic(
m_Value(InnerPtr), m_Value(InnerMask) {
+ // See if combining the two masks is fre
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -6397,6 +6397,48 @@ static Value *simplifyBinaryIntrinsic(Function *F, Value
*Op0, Value *Op1,
return Constant::getNullValue(ReturnType);
break;
}
+ case Intrinsic::ptrmask: {
+// Fail loudly in case this is ever changed.
+// TODO: If vector types are s
@@ -1964,18 +1964,78 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst
&CI) {
break;
}
case Intrinsic::ptrmask: {
+KnownBits Known(DL.getPointerTypeSizeInBits(II->getType()));
+if (SimplifyDemandedInstructionBits(*II, Known))
+ return II;
+
+Val
https://github.com/goldsteinn updated
https://github.com/llvm/llvm-project/pull/67166
>From 3982b40f82c6cb91c9bec407cea6b7a4cdc4220e Mon Sep 17 00:00:00 2001
From: Noah Goldstein
Date: Fri, 22 Sep 2023 08:21:21 -0500
Subject: [PATCH 1/9] [InstSimplify] Add tests for simplify `llvm.ptrmask`; NFC
@@ -183,8 +183,7 @@ define <16 x i8> @ptrmask_align8_ptr_align1(ptr align 1
%ptr) {
; TODO: Should be able to drop the ptrmask
fhahn wrote:
remove TODO now?
https://github.com/llvm/llvm-project/pull/67166
___
cfe-com
@@ -196,8 +195,7 @@ define <16 x i8> @ptrmask_align8_ptr_align8(ptr align 8
%ptr) {
; TODO: Should be able to drop the ptrmask
fhahn wrote:
remove TODO now
https://github.com/llvm/llvm-project/pull/67166
___
cfe-comm
https://github.com/goldsteinn edited
https://github.com/llvm/llvm-project/pull/67166
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
80 matches
Mail list logo