[PATCH] D17429: Don't mark convergent instructions as trivially rematerializable.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 13:33:36 PST 2016


jlebar added a comment.

Thank you for your comments.

>   /// Return true if the instruction is trivially rematerializable, meaning it

>   /// has no side effects and requires no operands that aren't always available.

>   /// This means the only allowed uses are constants and unallocatable physical

>   /// registers so that the instructions result is independent of the place

>   /// in the function.

>   bool isTriviallyReMaterializable(const MachineInstr *MI


AIUI, this means our hypothetical  f32reduce x, y is not trivially rematerializable, since its operands aren't always available.

I'm having difficulty imagining an op that has no side effects and requires no operands but which would nonetheless be unsafe to run while some threads are disabled (so is convergent).  But would this putative instruction's result be independent of its place in the function?  It seems not, since by assumption there is something different about running it while some threads are disabled vs when all threads are enabled.

Maybe I'm misunderstanding what it means when it says it requires no operands; I see LiveRangeEdit looking at the rematerializable instruction's inputs to check that they're available at the point to which it wants to move the instruction.  But the issue of moving the instruction anywhere in a function -- not just elsewhere in a BB -- remains.


http://reviews.llvm.org/D17429





More information about the llvm-commits mailing list