Remove unnecessary bitvector clear.
Diff Detail
- Build Status
Buildable 5402 Build 5402: arc lint + arc unit
Event Timeline
Can you add an assertion that the bitmap is empty/has no bits set at the beginning of the function?
My understanding is only 1 class DeadMachineInstructionElim object will be constructed and used for all the functions in the module by the pass manager. However the LivePhysRegs is re-assigned at the beginning of the runOnMachineFunction for every basic block. So the LivePhysRegs.clear() is really unnecessary.
Although this is correct, I don't think that is useful. We could add functionalities to this pass that would make use of that information (e.g., a dump method that we could call from the debugger anywhere in the program) and having the state being clean, seems like a good thing to me.
Unless I am mistaken, this shouldn't have any performance implication, so the clean state seems worth it.
Am I missing something?
I agree that the performance implication is small. I am not sure where you want to check for whether the state is clean or not.
Sorry, that one slipped through!
I agree that the performance implication is small. I am not sure where you want to check for whether the state is clean or not.
In the debugger for instance. Nevertheless, having a clean state at the end of a pass does not seem a bad thing to me.