[llvm-commits] patch for printing machine instrs after a specified pass

Bob Wilson bob.wilson at apple.com
Tue May 29 17:19:49 PDT 2012


I've committed this in svn r157655.

Please note that there were still 3 places where you were missing a blank space between a closing paren and opening curly bracket.  You also had several cases of trailing whitespace.  Please watch out for those in future patches.

On May 29, 2012, at 11:29 AM, Bin Zeng <bzeng at apple.com> wrote:

> Thank you all very much for the helpful comments and suggestions! 
> This is a new version with all of your comments incorporated. <patch.print-machineinstrs-0.9>
> On May 29, 2012, at 10:46 AM, Bin Zeng wrote:
> 
>> 
>> On May 29, 2012, at 9:32 AM, Chad Rosier wrote:
>> 
>>> Bin,
>>> For this test case:
>>> +; RUN: llc < %s -O3 -print-machineinstrs=branch-folder -o /dev/null |& FileCheck %s
>>> 
>>> What is the associated CHECK for this test?  I think you could add a more complex check to ensure the machine instrs is being printed directly after the branch folder pass.  It probably involves using the -debug-pass=Structure option.
>>> 
>> 
>> That is much better. I added a couple more checks to make sure that machine instrs are printed after the specified pass such as branch-folder. For the case when machine instrs are printed after all the passes, it seems not easy to check that. 
>> 
>>> +static cl::opt<std::string>
>>> +PrintMachineInstrs("print-machineinstrs",
>>> +                   cl::ValueOptional,
>>> +                   cl::desc("Print machine instrs"),
>>> +                   cl::value_desc("pass-name"),
>>> +                   cl::init("option-unspecified"));
>>> 
>>> Please maximize the horizontal space by only starting a new line when necessary (i.e., to prevent an 80-column violation).
>>> 
>> 
>> Thanks. The indentation has been changed. 
>> 
>>> +  else if (!StringRef(PrintMachineInstrs.getValue()).equals("option-unspecified")){
>>> 
>>> 80-column violation.  There should also be a space between the right most parentheses and the left brace.
>>> 
>>> Chad
>>> 
>> 
>> Thanks! Good eyes! A space has been added between ) and { and added a line to the .emacs file so that it highlights the lines with 
>> 80-column violation in case I missed them.
>> 
>>> 
>>> On May 25, 2012, at 5:51 PM, Bin Zeng wrote:
>>> 
>>>> Hi all,
>>>> 
>>>> My name is Bin Zeng and an intern working on a project to serialize MachineInstrs 
>>>> in the backend. This patch adds a insertPass API to insert a pass before each instance
>>>> of another pass and enhances the existing -print-machineinstrs so that the MachineInstrs
>>>> after a specific pass can be printed. For instance, to print the MachineInstrs after branch-folder
>>>> pass, you can do: $llc -O3 -print-machineinstrs=branch-folder filename.bc -o filename.s 
>>>> Also, the command line option is back compatible. You can dump MachineInstrs after all
>>>> the passes. 
>>>> 
>>>> <patch-0.8>
>>>> 
>>>> Thanks for reading. 
>>>> -Bin
>>> 
>> 
> 




More information about the llvm-commits mailing list