[PATCH] D11583: LowerBitSets: Add debugging output.
Peter Collingbourne
peter at pcc.me.uk
Wed Jul 29 11:13:04 PDT 2015
This revision was automatically updated to reflect the committed changes.
Closed by commit rL243546: LowerBitSets: Add debugging output. (authored by pcc).
Changed prior to commit:
http://reviews.llvm.org/D11583?vs=30869&id=30925#toc
Repository:
rL LLVM
http://reviews.llvm.org/D11583
Files:
llvm/trunk/include/llvm/Transforms/IPO/LowerBitSets.h
llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
Index: llvm/trunk/include/llvm/Transforms/IPO/LowerBitSets.h
===================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/LowerBitSets.h
+++ llvm/trunk/include/llvm/Transforms/IPO/LowerBitSets.h
@@ -28,6 +28,7 @@
class DataLayout;
class GlobalVariable;
class Value;
+class raw_ostream;
struct BitSetInfo {
// The indices of the set bits in the bitset.
@@ -57,6 +58,8 @@
bool containsValue(const DataLayout &DL,
const DenseMap<GlobalVariable *, uint64_t> &GlobalLayout,
Value *V, uint64_t COffset = 0) const;
+
+ void print(raw_ostream &OS) const;
};
struct BitSetBuilder {
Index: llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
+++ llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
@@ -26,6 +26,8 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/Pass.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
using namespace llvm;
@@ -90,6 +92,22 @@
return false;
}
+void BitSetInfo::print(raw_ostream &OS) const {
+ OS << "offset " << ByteOffset << " size " << BitSize << " align "
+ << (1 << AlignLog2);
+
+ if (isAllOnes()) {
+ OS << " all-ones\n";
+ return;
+ }
+
+ OS << " { ";
+ for (uint64_t B : Bits)
+ OS << B << ' ';
+ OS << "}\n";
+ return;
+}
+
BitSetInfo BitSetBuilder::build() {
if (Min > Max)
Min = 0;
@@ -532,6 +550,10 @@
for (MDString *BS : BitSets) {
// Build the bitset.
BitSetInfo BSI = buildBitSet(BS, GlobalLayout);
+ DEBUG({
+ dbgs() << BS->getString() << ": ";
+ BSI.print(dbgs());
+ });
ByteArrayInfo *BAI = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11583.30925.patch
Type: text/x-patch
Size: 1837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150729/da4fa95a/attachment.bin>
More information about the llvm-commits
mailing list