Allow hoisting code in if-conversion.
When doing if-conversion, we do not currently move code out of the side nodes. The reason for this is that it can increase the number of instructions that get executed because both side nods will have to be executed now. In this commit, we add code to move an instruction, and all of the instructions it depends on, out of a side node and into the header of the selection construct. However to keep the cost down, we only do it when the two values in the OpPhi node compute the same value. This way we have to move only one of the instructions and the other becomes unused most of the time. So no real extra cost. Makes the value number table an alalysis in the ir context. Added more opcodes to list of code motion safe opcodes. Fixes #1526.
Loading
Please register or sign in to comment