Small improvements to debug info printing in opt.cpp

This commit is contained in:
Matt Pharr
2012-03-19 11:32:08 -07:00
parent ee437193fb
commit 74a031a759

28
opt.cpp
View File

@@ -1139,6 +1139,11 @@ lExtractFromInserts(llvm::Value *v, unsigned int index) {
static llvm::Value * static llvm::Value *
lGetBasePtrAndOffsets(llvm::Value *ptrs, llvm::Value **offsets, lGetBasePtrAndOffsets(llvm::Value *ptrs, llvm::Value **offsets,
llvm::Instruction *insertBefore) { llvm::Instruction *insertBefore) {
if (g->debugPrint) {
fprintf(stderr, "lGetBasePtrAndOffsets\n");
LLVMDumpValue(ptrs);
}
llvm::Value *base = lGetBasePointer(ptrs); llvm::Value *base = lGetBasePointer(ptrs);
if (base != NULL) { if (base != NULL) {
// We have a straight up varying pointer with no indexing that's // We have a straight up varying pointer with no indexing that's
@@ -3854,28 +3859,28 @@ GatherCoalescePass::runOnBasicBlock(llvm::BasicBlock &bb) {
bool ok = lGetSourcePosFromMetadata(fwdCall, &fwdPos); bool ok = lGetSourcePosFromMetadata(fwdCall, &fwdPos);
Assert(ok); Assert(ok);
#if 0 if (g->debugPrint) {
if (base != fwdCall->getArgOperand(0)) { if (base != fwdCall->getArgOperand(0)) {
Debug(fwdPos, "base pointers mismatch"); Debug(fwdPos, "base pointers mismatch");
base->dump(); LLVMDumpValue(base);
fwdCall->getArgOperand(0)->dump(); LLVMDumpValue(fwdCall->getArgOperand(0));
} }
if (variableOffsets != fwdCall->getArgOperand(1)) { if (variableOffsets != fwdCall->getArgOperand(1)) {
Debug(fwdPos, "varying offsets mismatch"); Debug(fwdPos, "varying offsets mismatch");
variableOffsets->dump(); LLVMDumpValue(variableOffsets);
fwdCall->getArgOperand(1)->dump(); LLVMDumpValue(fwdCall->getArgOperand(1));
} }
if (offsetScale != fwdCall->getArgOperand(2)) { if (offsetScale != fwdCall->getArgOperand(2)) {
Debug(fwdPos, "offset scales mismatch"); Debug(fwdPos, "offset scales mismatch");
offsetScale->dump(); LLVMDumpValue(offsetScale);
fwdCall->getArgOperand(2)->dump(); LLVMDumpValue(fwdCall->getArgOperand(2));
} }
if (mask != fwdCall->getArgOperand(4)) { if (mask != fwdCall->getArgOperand(4)) {
Debug(fwdPos, "masks mismatch"); Debug(fwdPos, "masks mismatch");
mask->dump(); LLVMDumpValue(mask);
fwdCall->getArgOperand(4)->dump(); LLVMDumpValue(fwdCall->getArgOperand(4));
}
} }
#endif
if (base == fwdCall->getArgOperand(0) && if (base == fwdCall->getArgOperand(0) &&
variableOffsets == fwdCall->getArgOperand(1) && variableOffsets == fwdCall->getArgOperand(1) &&
@@ -3905,9 +3910,6 @@ GatherCoalescePass::runOnBasicBlock(llvm::BasicBlock &bb) {
} }
} }
//CO if (modifiedAny)
//CO bb.dump();
return modifiedAny; return modifiedAny;
} }