https://github.com/christiankissig updated
https://github.com/llvm/llvm-project/pull/67788
>From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001
From: Christian Kissig
Date: Tue, 26 Sep 2023 12:18:59 +
Subject: [PATCH 1/6] [Support] Add KnownBits::computeForSubBorrow
* Im
https://github.com/christiankissig updated
https://github.com/llvm/llvm-project/pull/67788
>From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001
From: Christian Kissig
Date: Tue, 26 Sep 2023 12:18:59 +
Subject: [PATCH 1/5] [Support] Add KnownBits::computeForSubBorrow
* Im
dlumma wrote:
It seems like this PR is ready to land. Any reason why it has not been
integrated @christiankissig ?
https://github.com/llvm/llvm-project/pull/67788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
@@ -85,6 +85,18 @@ KnownBits KnownBits::computeForAddSub(bool Add, bool NSW,
return KnownOut;
}
+KnownBits KnownBits::computeForSubBorrow(const KnownBits &LHS, KnownBits RHS,
+ const KnownBits &Borrow) {
+ assert(Borrow.getBitWidth()
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op,
const APInt &DemandedElts,
assert(Op.getResNo() == 0 &&
"We only compute knownbits for the difference here.");
-// TODO: Compute influence of the carry operand.
-if (Opcode ==
https://github.com/christiankissig updated
https://github.com/llvm/llvm-project/pull/67788
>From 5d86936c3a48c613460983c980271fcab8128b75 Mon Sep 17 00:00:00 2001
From: Christian Kissig
Date: Tue, 26 Sep 2023 12:18:59 +
Subject: [PATCH 1/5] [Support] Add KnownBits::computeForSubBorrow
* Im
christiankissig wrote:
> Might be nice to add a test where this actually shows up in CodeGen.
+1 Will look to add it with this change.
https://github.com/llvm/llvm-project/pull/67788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://list
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op,
const APInt &DemandedElts,
assert(Op.getResNo() == 0 &&
"We only compute knownbits for the difference here.");
-// TODO: Compute influence of the carry operand.
-if (Opcode ==
goldsteinn wrote:
Might be nice to add a test where this actually shows up in CodeGen.
https://github.com/llvm/llvm-project/pull/67788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3764,14 +3768,11 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op,
const APInt &DemandedElts,
if (Opcode == ISD::ADDE)
// Can't track carry from glue, set carry to unknown.
Carry.resetAll();
-else if (Opcode == ISD::UADDO_CARRY || Opcode == ISD::S
@@ -3764,14 +3768,11 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op,
const APInt &DemandedElts,
if (Opcode == ISD::ADDE)
// Can't track carry from glue, set carry to unknown.
Carry.resetAll();
-else if (Opcode == ISD::UADDO_CARRY || Opcode == ISD::S
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op,
const APInt &DemandedElts,
assert(Op.getResNo() == 0 &&
"We only compute knownbits for the difference here.");
-// TODO: Compute influence of the carry operand.
-if (Opcode ==
https://github.com/nikic edited https://github.com/llvm/llvm-project/pull/67788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nikic commented:
Looks fine to me.
https://github.com/llvm/llvm-project/pull/67788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3732,14 +3732,18 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op,
const APInt &DemandedElts,
assert(Op.getResNo() == 0 &&
"We only compute knownbits for the difference here.");
-// TODO: Compute influence of the carry operand.
-if (Opcode ==
@@ -213,6 +213,37 @@ TEST(KnownBitsTest, AddSubExhaustive) {
TestAddSubExhaustive(false);
}
+TEST(KnownBitsTest, SubBorrowExhaustive) {
+ unsigned Bits = 4;
+ ForeachKnownBits(Bits, [&](const KnownBits &Known1) {
+ForeachKnownBits(Bits, [&](const KnownBits &Known2) {
+
16 matches
Mail list logo