[llvm] Reland "[AArch64] AArch64TargetLowering::computeKnownBitsForTargetNode - add support for AArch64ISD::MOV/MVN constants" (PR #155696)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 27 14:17:26 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp llvm/unittests/Target/AArch64/AArch64SelectionDAGTest.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 726515429..9570156db 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -2623,15 +2623,13 @@ void AArch64TargetLowering::computeKnownBitsForTargetNode(
case AArch64ISD::MOVIshift: {
auto ShiftAmt = AArch64_AM::getShiftValue(Op->getConstantOperandVal(1));
Known = KnownBits::makeConstant(
- APInt(Known.getBitWidth(), Op->getConstantOperandVal(0)
- << ShiftAmt));
+ APInt(Known.getBitWidth(), Op->getConstantOperandVal(0) << ShiftAmt));
break;
}
case AArch64ISD::MOVImsl: {
auto ShiftAmt = AArch64_AM::getShiftValue(Op->getConstantOperandVal(1));
- Known = KnownBits::makeConstant(
- APInt(Known.getBitWidth(), ~(~Op->getConstantOperandVal(0)
- << ShiftAmt)));
+ Known = KnownBits::makeConstant(APInt(
+ Known.getBitWidth(), ~(~Op->getConstantOperandVal(0) << ShiftAmt)));
break;
}
case AArch64ISD::MOVIedit: {
@@ -2643,16 +2641,14 @@ void AArch64TargetLowering::computeKnownBitsForTargetNode(
case AArch64ISD::MVNIshift: {
auto ShiftAmt = AArch64_AM::getShiftValue(Op->getConstantOperandVal(1));
Known = KnownBits::makeConstant(
- APInt(Known.getBitWidth(),
- ~(Op->getConstantOperandVal(0) << ShiftAmt),
+ APInt(Known.getBitWidth(), ~(Op->getConstantOperandVal(0) << ShiftAmt),
/*isSigned*/ false, /*implicitTrunc*/ true));
break;
}
case AArch64ISD::MVNImsl: {
auto ShiftAmt = AArch64_AM::getShiftValue(Op->getConstantOperandVal(1));
Known = KnownBits::makeConstant(
- APInt(Known.getBitWidth(),
- (~Op->getConstantOperandVal(0) << ShiftAmt),
+ APInt(Known.getBitWidth(), (~Op->getConstantOperandVal(0) << ShiftAmt),
/*isSigned*/ false, /*implicitTrunc*/ true));
break;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/155696
More information about the llvm-commits
mailing list