[llvm] [NFC][RemoveDIs] Switch ConstantExpr::getAsInstruction to not insert (PR #84737)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 02:57:17 PDT 2024
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 5b5c21d772d20320fd876edddfc204cca93fae0f d6dbf782d157bc0d05c42d1b11e0eaee6f6e9c5e -- llvm/include/llvm/IR/Constants.h llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp llvm/lib/IR/Constants.cpp llvm/lib/IR/ReplaceConstant.cpp llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 111f6bc54b..07b5bced96 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -3333,8 +3333,8 @@ Instruction *ConstantExpr::getAsInstruction() const {
case Instruction::GetElementPtr: {
const auto *GO = cast<GEPOperator>(this);
if (GO->isInBounds())
- return GetElementPtrInst::CreateInBounds(
- GO->getSourceElementType(), Ops[0], Ops.slice(1), "");
+ return GetElementPtrInst::CreateInBounds(GO->getSourceElementType(),
+ Ops[0], Ops.slice(1), "");
return GetElementPtrInst::Create(GO->getSourceElementType(), Ops[0],
Ops.slice(1), "");
}
diff --git a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
index 0386e3cb9c..5e91cce106 100644
--- a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
+++ b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
@@ -88,7 +88,8 @@ static bool replaceConstantExprOp(ConstantExpr *CE, Pass *P) {
BasicBlock *PredBB = PN->getIncomingBlock(I);
if (PredBB->getTerminator()->getNumSuccessors() > 1)
PredBB = SplitEdge(PredBB, PN->getParent());
- BasicBlock::iterator InsertPos = PredBB->getTerminator()->getIterator();
+ BasicBlock::iterator InsertPos =
+ PredBB->getTerminator()->getIterator();
Instruction *NewInst = CE->getAsInstruction();
NewInst->insertBefore(*PredBB, InsertPos);
PN->setOperand(I, NewInst);
``````````
</details>
https://github.com/llvm/llvm-project/pull/84737
More information about the llvm-commits
mailing list