Skip to content

Commit 8bafeb4

Browse files
committed
Remove getPrev... entirely.
1 parent b0c8ec6 commit 8bafeb4

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

llvm/include/llvm/IR/Instruction.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -898,16 +898,6 @@ class Instruction : public User,
898898
/// Return true if the instruction is a DbgInfoIntrinsic or PseudoProbeInst.
899899
LLVM_ABI bool isDebugOrPseudoInst() const LLVM_READONLY;
900900

901-
/// Return a pointer to the previous non-debug instruction in the same basic
902-
/// block as 'this', or nullptr if no such instruction exists. Skip any pseudo
903-
/// operations if \c SkipPseudoOp is true.
904-
LLVM_ABI const Instruction *
905-
getPrevNonPseudoOpInstruction() const;
906-
Instruction *getPrevNonPseudoOpInstruction() {
907-
return const_cast<Instruction *>(
908-
static_cast<const Instruction *>(this)->getPrevNonPseudoOpInstruction());
909-
}
910-
911901
/// Create a copy of 'this' instruction that is identical in all ways except
912902
/// the following:
913903
/// * The instruction has no parent

llvm/lib/CodeGen/CodeGenPrepare.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3015,7 +3015,7 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB,
30153015
// %phi = phi ptr [ %0, %bb0 ], [ %2, %entry ]
30163016
if (PredBB && PredBB->getSingleSuccessor() == BB)
30173017
CI = dyn_cast_or_null<CallInst>(
3018-
PredBB->getTerminator()->getPrevNonPseudoOpInstruction());
3018+
PredBB->getTerminator()->getPrevNode());
30193019

30203020
if (CI && CI->use_empty() &&
30213021
isIntrinsicOrLFToBeTailCalled(TLInfo, CI) &&
@@ -3032,7 +3032,7 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB,
30323032
for (BasicBlock *Pred : predecessors(BB)) {
30333033
if (!VisitedBBs.insert(Pred).second)
30343034
continue;
3035-
if (Instruction *I = Pred->rbegin()->getPrevNonPseudoOpInstruction()) {
3035+
if (Instruction *I = Pred->rbegin()->getPrevNode()) {
30363036
CallInst *CI = dyn_cast<CallInst>(I);
30373037
if (CI && CI->use_empty() && TLI->mayBeEmittedAsTailCall(CI) &&
30383038
attributesPermitTailCall(F, CI, RetI, *TLI)) {

llvm/lib/IR/Instruction.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,14 +1235,6 @@ bool Instruction::isDebugOrPseudoInst() const {
12351235
return isa<DbgInfoIntrinsic>(this) || isa<PseudoProbeInst>(this);
12361236
}
12371237

1238-
const Instruction *
1239-
Instruction::getPrevNonPseudoOpInstruction() const {
1240-
for (const Instruction *I = getPrevNode(); I; I = I->getPrevNode())
1241-
if (!isa<PseudoProbeInst>(I))
1242-
return I;
1243-
return nullptr;
1244-
}
1245-
12461238
const DebugLoc &Instruction::getStableDebugLoc() const {
12471239
return getDebugLoc();
12481240
}

llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2737,7 +2737,7 @@ TEST_P(OpenMPIRBuilderTestWithParams, DynamicWorkShareLoop) {
27372737
EXPECT_EQ(OrigStride->getValue(), 1);
27382738

27392739
CallInst *FiniCall = dyn_cast<CallInst>(
2740-
&*(LatchBlock->getTerminator()->getPrevNonPseudoOpInstruction()));
2740+
&*(LatchBlock->getTerminator()->getPrevNode()));
27412741
EXPECT_EQ(FiniCall, nullptr);
27422742

27432743
// The original loop iterator should only be used in the condition, in the
@@ -2841,7 +2841,7 @@ TEST_F(OpenMPIRBuilderTest, DynamicWorkShareLoopOrdered) {
28412841
static_cast<uint64_t>(OMPScheduleType::OrderedStaticChunked));
28422842

28432843
CallInst *FiniCall = dyn_cast<CallInst>(
2844-
&*(LatchBlock->getTerminator()->getPrevNonPseudoOpInstruction()));
2844+
&*(LatchBlock->getTerminator()->getPrevNode()));
28452845
ASSERT_NE(FiniCall, nullptr);
28462846
EXPECT_EQ(FiniCall->getCalledFunction()->getName(),
28472847
"__kmpc_dispatch_fini_4u");

0 commit comments

Comments
 (0)