LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 38439 - MIR's -run-pass together with -verify-machineinstrs has strange behavior with function properties
Summary: MIR's -run-pass together with -verify-machineinstrs has strange behavior with...
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Common Code Generator Code (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-03 08:34 PDT by Francis Visoiu Mistrih
Modified: 2018-08-03 08:35 PDT (History)
4 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Visoiu Mistrih 2018-08-03 08:34:36 PDT
Assuming you have this test case:

body:
  $rax = TARGET_PSEUDO

then the MIR parser will add NoPHIs, IsSSA and NoVRegs function properties.

If you run llc -run-pass expand-isel-pseudos -verify-machineinstrs, where expand-isel-pseudos will expand TARGET_PSEUDO by adding either PHIs or vregs, the machine verifier will complain about the function not respecting the NoPHIs and NoVRegs properties.

I am not sure what the correct behavior should be here, but we should be able to somehow force it in the MIR file so that we don't have to add actual PHI MIs to the test.

A few possibilities:

* Properly implement getClearedProperties/getSetProperties/getRequiredProperties for all the passes. One issue here is that in the case of passes that call into backends, we don't know the hooks will insert, so we'll end up clearing most of the properties in many cases.
* Set/reset the properties from every pass including all the backend hooks.
* Add MIR keys that force the properties for the whole file.