[llvm] a578883 - [IR] Rename dropUndefImplying to dropUBImplying (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 03:16:31 PDT 2023
Author: Nikita Popov
Date: 2023-03-22T11:16:22+01:00
New Revision: a5788836b92c3e1721eaef668bf5fb6920497d5d
URL: https://github.com/llvm/llvm-project/commit/a5788836b92c3e1721eaef668bf5fb6920497d5d
DIFF: https://github.com/llvm/llvm-project/commit/a5788836b92c3e1721eaef668bf5fb6920497d5d.diff
LOG: [IR] Rename dropUndefImplying to dropUBImplying (NFC)
Clarify that this is only about immediate undefined behavior,
not about undef or poison.
Added:
Modified:
llvm/include/llvm/IR/Instruction.h
llvm/lib/IR/Instruction.cpp
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Instruction.h b/llvm/include/llvm/IR/Instruction.h
index 03873eb4094cc..8818925f78610 100644
--- a/llvm/include/llvm/IR/Instruction.h
+++ b/llvm/include/llvm/IR/Instruction.h
@@ -320,7 +320,7 @@ class Instruction : public User,
/// @{
/// Passes are required to drop metadata they don't understand. This is a
/// convenience method for passes to do so.
- /// dropUndefImplyingAttrsAndUnknownMetadata should be used instead of
+ /// dropUBImplyingAttrsAndUnknownMetadata should be used instead of
/// this API if the Instruction being modified is a call.
void dropUnknownNonDebugMetadata(ArrayRef<unsigned> KnownIDs);
void dropUnknownNonDebugMetadata() {
@@ -404,8 +404,7 @@ class Instruction : public User,
/// dropUnknownNonDebugMetadata). For calls, it also drops parameter and
/// return attributes that can cause undefined behaviour. Both of these should
/// be done by passes which move instructions in IR.
- void
- dropUndefImplyingAttrsAndUnknownMetadata(ArrayRef<unsigned> KnownIDs = {});
+ void dropUBImplyingAttrsAndUnknownMetadata(ArrayRef<unsigned> KnownIDs = {});
/// Determine whether the exact flag is set.
bool isExact() const LLVM_READONLY;
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index 38cce828b9baf..dd79fbe4dbdfc 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -224,7 +224,7 @@ void Instruction::dropPoisonGeneratingMetadata() {
eraseMetadata(LLVMContext::MD_align);
}
-void Instruction::dropUndefImplyingAttrsAndUnknownMetadata(
+void Instruction::dropUBImplyingAttrsAndUnknownMetadata(
ArrayRef<unsigned> KnownIDs) {
dropUnknownNonDebugMetadata(KnownIDs);
auto *CB = dyn_cast<CallBase>(this);
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index d74e8fb4fa24a..dfd17ff3d760c 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -1744,7 +1744,7 @@ static void hoist(Instruction &I, const DominatorTree *DT, const Loop *CurLoop,
// time in isGuaranteedToExecute if we don't actually have anything to
// drop. It is a compile time optimization, not required for correctness.
!SafetyInfo->isGuaranteedToExecute(I, DT, CurLoop))
- I.dropUndefImplyingAttrsAndUnknownMetadata();
+ I.dropUBImplyingAttrsAndUnknownMetadata();
if (isa<PHINode>(I))
// Move the new node to the end of the phi list in the destination block.
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 3f486147564ee..5c1fd6e9ae4a4 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -2994,7 +2994,7 @@ void llvm::hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt,
for (BasicBlock::iterator II = BB->begin(), IE = BB->end(); II != IE;) {
Instruction *I = &*II;
- I->dropUndefImplyingAttrsAndUnknownMetadata();
+ I->dropUBImplyingAttrsAndUnknownMetadata();
if (I->isUsedByMetadata())
dropDebugUsers(*I);
if (I->isDebugOrPseudoInst()) {
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 187f11a0a0897..10d7f96c56f14 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1125,7 +1125,7 @@ static void CloneInstructionsIntoPredecessorBlockAndUpdateSSAUses(
// it is tied to the instruction itself, not the value or position.
// Similarly strip attributes on call parameters that may cause UB in
// location the call is moved to.
- NewBonusInst->dropUndefImplyingAttrsAndUnknownMetadata(
+ NewBonusInst->dropUBImplyingAttrsAndUnknownMetadata(
LLVMContext::MD_annotation);
NewBonusInst->insertInto(PredBlock, PTI->getIterator());
@@ -3021,7 +3021,7 @@ bool SimplifyCFGOpt::SpeculativelyExecuteBB(BranchInst *BI, BasicBlock *ThenBB,
if (!isa<DbgAssignIntrinsic>(&I))
I.setDebugLoc(DebugLoc());
}
- I.dropUndefImplyingAttrsAndUnknownMetadata();
+ I.dropUBImplyingAttrsAndUnknownMetadata();
// Drop ephemeral values.
if (EphTracker.contains(&I)) {
More information about the llvm-commits
mailing list