[llvm] [IR] Remove support for lshr/ashr constant expressions (PR #71955)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 08:35:36 PST 2023
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 cf1e3420b0141d84770869205cfdb546609014dd 6e900400baaf34bd8984c0598a6ae72876dc1194 -- llvm/bindings/ocaml/llvm/llvm_ocaml.c llvm/include/llvm-c/Core.h llvm/include/llvm/IR/Constants.h llvm/lib/AsmParser/LLParser.cpp llvm/lib/IR/ConstantFold.cpp llvm/lib/IR/Constants.cpp llvm/lib/IR/Core.cpp llvm/unittests/IR/ConstantsTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index f9df70fb6fc0..d565918f24ea 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -3944,7 +3944,8 @@ bool LLParser::parseValID(ValID &ID, PerFunctionState *PFS, Type *ExpectedTy) {
"constexpr requires integer or integer vector operands");
unsigned Flags = 0;
if (NUW) Flags |= OverflowingBinaryOperator::NoUnsignedWrap;
- if (NSW) Flags |= OverflowingBinaryOperator::NoSignedWrap;
+ if (NSW)
+ Flags |= OverflowingBinaryOperator::NoSignedWrap;
ID.ConstantVal = ConstantExpr::get(Opc, Val0, Val1, Flags);
ID.Kind = ValID::t_Constant;
return false;
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 25f7ac22e3ab..4e28e9af24af 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -154,7 +154,8 @@ static Constant *ExtractConstantBytes(Constant *C, unsigned ByteStart,
if (!CE) return nullptr;
switch (CE->getOpcode()) {
- default: return nullptr;
+ default:
+ return nullptr;
case Instruction::Shl: {
ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1));
if (!Amt)
``````````
</details>
https://github.com/llvm/llvm-project/pull/71955
More information about the llvm-commits
mailing list