Stepan Dyatkovskiy
2011-Oct-31 09:29 UTC
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
Hi, Please find the attached patch for review. -Stepan. John McCall wrote:> On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote: >> I found next code when switch instruction differs: >> >> Engine.logf("right switch has extra case %r")<< CaseValue; >> >> Where CaseValue is a ConstantInt object. Looking how logf works I found >> that it invokes DiffConsumer::printValue method for CaseValue. And here >> I found that CaseValue itself will never printed. On first look how >> DiffConsumer::printValue works it seems that for all constants "object >> numbering" should be printed: >> >> out<< '%'<< ctxt.RNumbering[V]; // V = CaseValue in our case. >> // RNumbering is instance of >> DenseMap<Value*,unsigned>. >> >> Then I look into DiffConsumer.cpp, ComputeNumbering method that fills >> RNumbering and LNumbering. Well, numbering computed for function >> arguments, basic blocks and instructions only. >> >> It means that for Constants "%0" will be printed always. If so, I >> propose to add case for constants in DiffConsumer::printValue method, >> that will print constant itself. > > Patches welcome! > > John.-------------- next part -------------- A non-text attachment was scrubbed... Name: diffeng.patch Type: text/x-patch Size: 957 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111031/d9301cc0/attachment.bin>
Stepan Dyatkovskiy
2011-Nov-03 06:20 UTC
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
ping. -Stepan. Stepan Dyatkovskiy wrote:> Hi, > > Please find the attached patch for review. > > -Stepan. > > John McCall wrote: >> On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote: >>> I found next code when switch instruction differs: >>> >>> Engine.logf("right switch has extra case %r")<< CaseValue; >>> >>> Where CaseValue is a ConstantInt object. Looking how logf works I found >>> that it invokes DiffConsumer::printValue method for CaseValue. And here >>> I found that CaseValue itself will never printed. On first look how >>> DiffConsumer::printValue works it seems that for all constants "object >>> numbering" should be printed: >>> >>> out<< '%'<< ctxt.RNumbering[V]; // V = CaseValue in our case. >>> // RNumbering is instance of >>> DenseMap<Value*,unsigned>. >>> >>> Then I look into DiffConsumer.cpp, ComputeNumbering method that fills >>> RNumbering and LNumbering. Well, numbering computed for function >>> arguments, basic blocks and instructions only. >>> >>> It means that for Constants "%0" will be printed always. If so, I >>> propose to add case for constants in DiffConsumer::printValue method, >>> that will print constant itself. >> >> Patches welcome! >> >> John. > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Stepan Dyatkovskiy
2011-Nov-07 11:37 UTC
[LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
ping. -Stepan. Stepan Dyatkovskiy wrote:> ping. > > -Stepan. > > Stepan Dyatkovskiy wrote: >> Hi, >> >> Please find the attached patch for review. >> >> -Stepan. >> >> John McCall wrote: >>> On Oct 28, 2011, at 2:00 AM, Stepan Dyatkovskiy wrote: >>>> I found next code when switch instruction differs: >>>> >>>> Engine.logf("right switch has extra case %r")<< CaseValue; >>>> >>>> Where CaseValue is a ConstantInt object. Looking how logf works I found >>>> that it invokes DiffConsumer::printValue method for CaseValue. And here >>>> I found that CaseValue itself will never printed. On first look how >>>> DiffConsumer::printValue works it seems that for all constants "object >>>> numbering" should be printed: >>>> >>>> out<< '%'<< ctxt.RNumbering[V]; // V = CaseValue in our case. >>>> // RNumbering is instance of >>>> DenseMap<Value*,unsigned>. >>>> >>>> Then I look into DiffConsumer.cpp, ComputeNumbering method that fills >>>> RNumbering and LNumbering. Well, numbering computed for function >>>> arguments, basic blocks and instructions only. >>>> >>>> It means that for Constants "%0" will be printed always. If so, I >>>> propose to add case for constants in DiffConsumer::printValue method, >>>> that will print constant itself. >>> >>> Patches welcome! >>> >>> John. >> >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reasonably Related Threads
- [LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
- [LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
- [LLVMdev] [LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue
- printing reals from C with digits -- once more
- Port of R header files to Delphi