[llvm] r256305 - [RS4GC] Fix base pair printing for constants.
Manuel Jacob via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 22 16:19:46 PST 2015
Author: mjacob
Date: Tue Dec 22 18:19:45 2015
New Revision: 256305
URL: http://llvm.org/viewvc/llvm-project?rev=256305&view=rev
Log:
[RS4GC] Fix base pair printing for constants.
Previously, "%" + name of the value was printed for each derived and base
pointer. This is correct for instructions, but wrong for e.g. globals.
Modified:
llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=256305&r1=256304&r2=256305&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Tue Dec 22 18:19:45 2015
@@ -1208,8 +1208,11 @@ static void findBasePointers(DominatorTr
std::sort(Temp.begin(), Temp.end(), order_by_name);
for (Value *Ptr : Temp) {
Value *Base = PointerToBase[Ptr];
- errs() << " derived %" << Ptr->getName() << " base %" << Base->getName()
- << "\n";
+ errs() << " derived ";
+ Ptr->printAsOperand(errs(), false);
+ errs() << " base ";
+ Base->printAsOperand(errs(), false);
+ errs() << "\n";;
}
}
@@ -2378,9 +2381,13 @@ static bool insertParsePoints(Function &
if (PrintBasePointers) {
for (auto &Info : Records) {
errs() << "Base Pairs: (w/Relocation)\n";
- for (auto Pair : Info.PointerToBase)
- errs() << " derived %" << Pair.first->getName() << " base %"
- << Pair.second->getName() << "\n";
+ for (auto Pair : Info.PointerToBase) {
+ errs() << " derived ";
+ Pair.first->printAsOperand(errs(), false);
+ errs() << " base ";
+ Pair.second->printAsOperand(errs(), false);
+ errs() << "\n";
+ }
}
}
Modified: llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll?rev=256305&r1=256304&r2=256305&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-12.ll Tue Dec 22 18:19:45 2015
@@ -1,6 +1,6 @@
; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
-; CHECK: derived %select base %global
+; CHECK: derived %select base @global
@global = external addrspace(1) global i8
Modified: llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll?rev=256305&r1=256304&r2=256305&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/base-pointers-13.ll Tue Dec 22 18:19:45 2015
@@ -1,6 +1,6 @@
; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
-; CHECK: derived %derived base %global
+; CHECK: derived %derived base @global
@global = external addrspace(1) global i8
More information about the llvm-commits
mailing list