diff options
author | Rahul Joshi <rjoshi@nvidia.com> | 2024-10-11 05:26:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 05:26:03 -0700 |
commit | fa789dffb1e12c2aece0187aeacc48dfb1768340 (patch) | |
tree | cebfdc0d8b0111115cbefeb8d2927fe8c2cfbdfb /llvm/lib/Transforms/Utils/PredicateInfo.cpp | |
parent | 900ea21ffb38ba5b783b20f394c43c6c89d58086 (diff) | |
download | llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.zip llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.tar.gz llvm-fa789dffb1e12c2aece0187aeacc48dfb1768340.tar.bz2 |
[NFC] Rename `Intrinsic::getDeclaration` to `getOrInsertDeclaration` (#111752)
Rename the function to reflect its correct behavior and to be consistent
with `Module::getOrInsertFunction`. This is also in preparation of
adding a new `Intrinsic::getDeclaration` that will have behavior similar
to `Module::getFunction` (i.e, just lookup, no creation).
Diffstat (limited to 'llvm/lib/Transforms/Utils/PredicateInfo.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/PredicateInfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 186e17e..2415118 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -559,7 +559,7 @@ Value *PredicateInfoBuilder::materializeStack(unsigned int &Counter, if (isa<PredicateWithEdge>(ValInfo)) { IRBuilder<> B(getBranchTerminator(ValInfo)); auto NumDecls = F.getParent()->getNumNamedValues(); - Function *IF = Intrinsic::getDeclaration( + Function *IF = Intrinsic::getOrInsertDeclaration( F.getParent(), Intrinsic::ssa_copy, Op->getType()); if (NumDecls != F.getParent()->getNumNamedValues()) PI.CreatedDeclarations.insert(IF); @@ -575,7 +575,7 @@ Value *PredicateInfoBuilder::materializeStack(unsigned int &Counter, // directly before it, assume(i1 true) is not a useful fact. IRBuilder<> B(PAssume->AssumeInst->getNextNode()); auto NumDecls = F.getParent()->getNumNamedValues(); - Function *IF = Intrinsic::getDeclaration( + Function *IF = Intrinsic::getOrInsertDeclaration( F.getParent(), Intrinsic::ssa_copy, Op->getType()); if (NumDecls != F.getParent()->getNumNamedValues()) PI.CreatedDeclarations.insert(IF); |