[llvm] Remove redundant calls to std::unique_ptr<T>::get (NFC)#113415
Merged
kazutakahirata merged 1 commit intollvm:mainfrom Oct 23, 2024
Merged
[llvm] Remove redundant calls to std::unique_ptr<T>::get (NFC)#113415kazutakahirata merged 1 commit intollvm:mainfrom
kazutakahirata merged 1 commit intollvm:mainfrom
Conversation
Member
|
@llvm/pr-subscribers-backend-amdgpu @llvm/pr-subscribers-llvm-ir Author: Kazu Hirata (kazutakahirata) ChangesFull diff: https://github.com/llvm/llvm-project/pull/113415.diff 5 Files Affected:
diff --git a/llvm/lib/CGData/CodeGenData.cpp b/llvm/lib/CGData/CodeGenData.cpp
index c56a8b77a52319..2a3a74c8bc37af 100644
--- a/llvm/lib/CGData/CodeGenData.cpp
+++ b/llvm/lib/CGData/CodeGenData.cpp
@@ -165,7 +165,7 @@ CodeGenData &CodeGenData::getInstance() {
Instance->publishOutlinedHashTree(Reader->releaseOutlinedHashTree());
}
});
- return *(Instance.get());
+ return *Instance;
}
namespace IndexedCGData {
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index 6006ea7be806b2..2ae6b4f2c64c9b 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -1370,7 +1370,7 @@ void MachineOutliner::emitOutlinedHashTree(Module &M) {
Triple TT(M.getTargetTriple());
embedBufferInModule(
- M, *Buffer.get(),
+ M, *Buffer,
getCodeGenDataSectionName(CG_outline, TT.getObjectFormat()));
}
}
diff --git a/llvm/lib/Support/TimeProfiler.cpp b/llvm/lib/Support/TimeProfiler.cpp
index 29c1c97ddf3c52..865a663115e1ed 100644
--- a/llvm/lib/Support/TimeProfiler.cpp
+++ b/llvm/lib/Support/TimeProfiler.cpp
@@ -160,7 +160,7 @@ struct llvm::TimeTraceProfiler {
if (Stack.empty())
return;
- Stack.back().get()->InstantEvents.emplace_back(TimeTraceProfilerEntry(
+ Stack.back()->InstantEvents.emplace_back(TimeTraceProfilerEntry(
ClockType::now(), TimePointType(), std::move(Name), Detail(),
TimeTraceEventType::InstantEvent));
}
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
index a367db70627748..e4e1412d7def9b 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
@@ -191,7 +191,7 @@ class SchedGroup {
bool allowedByRules(const SUnit *SU,
SmallVectorImpl<SchedGroup> &SyncPipe) const {
for (auto &Rule : Rules) {
- if (!Rule.get()->apply(SU, Collection, SyncPipe))
+ if (!Rule->apply(SU, Collection, SyncPipe))
return false;
}
return true;
diff --git a/llvm/unittests/IR/DroppedVariableStatsTest.cpp b/llvm/unittests/IR/DroppedVariableStatsTest.cpp
index 63b7b4de1937cb..61f3a87bb355e0 100644
--- a/llvm/unittests/IR/DroppedVariableStatsTest.cpp
+++ b/llvm/unittests/IR/DroppedVariableStatsTest.cpp
@@ -84,7 +84,7 @@ TEST(DroppedVariableStats, BothDeleted) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
I.eraseFromParent();
@@ -141,7 +141,7 @@ TEST(DroppedVariableStats, DbgValLost) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
break;
@@ -198,7 +198,7 @@ TEST(DroppedVariableStats, UnrelatedScopes) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
break;
@@ -255,7 +255,7 @@ TEST(DroppedVariableStats, ChildScopes) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
break;
@@ -313,7 +313,7 @@ TEST(DroppedVariableStats, InlinedAt) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
break;
@@ -371,7 +371,7 @@ TEST(DroppedVariableStats, InlinedAtShared) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
break;
@@ -430,7 +430,7 @@ TEST(DroppedVariableStats, InlinedAtChild) {
llvm::Any(const_cast<const llvm::Module *>(M.get())));
// This loop simulates an IR pass that drops debug information.
- for (auto &F : *M.get()) {
+ for (auto &F : *M) {
for (auto &I : instructions(&F)) {
I.dropDbgRecords();
break;
|
MaskRay
approved these changes
Oct 23, 2024
03c7f87 to
451f28a
Compare
Closed
NoumanAmir657
pushed a commit
to NoumanAmir657/llvm-project
that referenced
this pull request
Nov 4, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.