-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[llvm] using wrapper llvm::sort(nfc) #151000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-support @llvm/pr-subscribers-llvm-ir Author: Austin (Zhenhang1213) Changesusing wrapper llvm::sort(nfc) Full diff: https://github.com/llvm/llvm-project/pull/151000.diff 3 Files Affected:
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index e7ff772fc815a..3de289c6cfdeb 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -609,7 +609,7 @@ class IndexBitcodeWriter : public BitcodeWriterBase {
std::vector<StringRef> ModulePaths;
for (auto &[ModPath, _] : Index.modulePaths())
ModulePaths.push_back(ModPath);
- llvm::sort(ModulePaths.begin(), ModulePaths.end());
+ llvm::sort(ModulePaths);
for (auto &ModPath : ModulePaths)
Callback(*Index.modulePaths().find(ModPath));
}
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index b21f4347f34d3..d1cd0c1c780d4 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1160,7 +1160,7 @@ int SlotTracker::processIndex() {
std::vector<StringRef> ModulePaths;
for (auto &[ModPath, _] : TheIndex->modulePaths())
ModulePaths.push_back(ModPath);
- llvm::sort(ModulePaths.begin(), ModulePaths.end());
+ llvm::sort(ModulePaths);
for (auto &ModPath : ModulePaths)
CreateModulePathSlot(ModPath);
diff --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
index 52fa678a600e9..613048be52a2f 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp
@@ -1987,7 +1987,7 @@ SmallVector<uint32_t, 8> HvxSelector::getPerfectCompletions(ShuffleMask SM,
// times). In such cases it will be impossible to complete this to a
// perfect shuffle.
SmallVector<uint32_t, 8> Sorted(Worklist);
- llvm::sort(Sorted.begin(), Sorted.end());
+ llvm::sort(Sorted);
for (unsigned I = 0, E = Sorted.size(); I != E;) {
unsigned P = Sorted[I], Count = 1;
|
Please change the sort with a comparator, such as: llvm-project/llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp Lines 239 to 241 in 7162f19
And the code below can be replaced with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
559bfd4
to
d33d707
Compare
d33d707
to
7b7c83e
Compare
OK |
7b7c83e
to
cd76133
Compare
And llvm-project/llvm/lib/CodeGen/MIRPrinter.cpp Lines 555 to 560 in d3f500f
|
cd76133
to
95e19a5
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
using wrapper llvm::sort(nfc)
95e19a5
to
63b0434
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
using wrapper llvm::sort(nfc)