[llvm] dd54432 - [InstNamer] use 'i' for Instructions, not 'tmp'
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 1 08:11:44 PDT 2020
Author: Sanjay Patel
Date: 2020-06-01T11:11:14-04:00
New Revision: dd54432a0f5a6f042fa4d2db3094c6f02e5ad275
URL: https://github.com/llvm/llvm-project/commit/dd54432a0f5a6f042fa4d2db3094c6f02e5ad275
DIFF: https://github.com/llvm/llvm-project/commit/dd54432a0f5a6f042fa4d2db3094c6f02e5ad275.diff
LOG: [InstNamer] use 'i' for Instructions, not 'tmp'
As discussed in https://bugs.llvm.org/show_bug.cgi?id=45951 and
D80584, the name 'tmp' is almost always a bad choice, but we have
a legacy of regression tests with that name because it was baked
into utils/update_test_checks.py.
This change makes -instnamer more consistent (already using "arg"
and "bb", the common LLVM shorthand). And it avoids the conflict
in telling users of the FileCheck script to run "-instnamer" to
create a better regression test and having that cause a warn/fail
in update_test_checks.py.
Added:
Modified:
llvm/lib/Transforms/Utils/InstructionNamer.cpp
llvm/test/Transforms/InstNamer/basic.ll
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/InstructionNamer.cpp b/llvm/lib/Transforms/Utils/InstructionNamer.cpp
index aac0b55801c4..8e339fe46d45 100644
--- a/llvm/lib/Transforms/Utils/InstructionNamer.cpp
+++ b/llvm/lib/Transforms/Utils/InstructionNamer.cpp
@@ -42,7 +42,7 @@ namespace {
for (Instruction &I : BB)
if (!I.hasName() && !I.getType()->isVoidTy())
- I.setName("tmp");
+ I.setName("i");
}
return true;
}
diff --git a/llvm/test/Transforms/InstNamer/basic.ll b/llvm/test/Transforms/InstNamer/basic.ll
index 4c819246b90b..5fbcfca96a4f 100644
--- a/llvm/test/Transforms/InstNamer/basic.ll
+++ b/llvm/test/Transforms/InstNamer/basic.ll
@@ -6,10 +6,10 @@ target triple = "x86_64-unknown-linux-gnu"
define i32 @f_0(i32) {
; CHECK-LABEL: @f_0(
; CHECK: bb:
-; CHECK-NEXT: %tmp = add i32 %arg, 2
+; CHECK-NEXT: %i = add i32 %arg, 2
; CHECK-NEXT: br label %bb1
; CHECK: bb1:
-; CHECK-NEXT: ret i32 %tmp
+; CHECK-NEXT: ret i32 %i
%2 = add i32 %0, 2
br label %3
More information about the llvm-commits
mailing list