Hi all,
After a recent upstream merge into our downstream sources we are suddenly encountering the freeze instruction in LLVM IR for div/rem pairs. This seems to be related to [1].
Our downstream target is GlobalISel only and unfortunately GlobalISel doesn't support this instruction yet, so most of our internal test-suite is now breaking due to GlobalISel not being able to translate this instruction to MIR. We would like to add support for that, but it seems that it is not yet clear how this freeze instruction is supposed to look like in MIR.
In [2], which introduced the FREEZE node to SelectionDAG, there was a lengthier discussion which concluded that for now proper handling was only added to SelDAG and the MIR related patches would be left for a follow up. We would like to accelerate this follow up, because we obviously want to get our downstream backend working again.
One part of this discussion concerned how freeze should behave on MIR level. Especially if there needs to be a MIR FREEZE instruction and whether the semantics of IMPLICIT_DEF need to be changed.
In SelectionDAG, FREEZE is currently handled as a simple COPY. This seems to me like SelectionDAG ignores the semantics of FREEZE, since COPY has other semantics? Also, would this be acceptable for the GlobalISel IRTranslator (even if only as a first step)?
Best regards,
Dominik
[1] ⚙ D76483 [DivRemPairs] Freeze operands if they can be undef values
[2] https://reviews.llvm.org/D29014
P.S.: is there really no way to disable a single pass from command line? We would like to disable the DivRemPairs pass as a first workaround.