[PATCH] D45204: [X86][MIPS][ARM] New machine instruction property 'isMoveReg'

Nikola Prica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 14 07:23:46 PDT 2018


NikolaPrica added a comment.



> A general pointer you might have missed. We already track copy like instructions through isRegSequenceLike, isExtractSubRegLike and so on. These are more complicated than just plain copies though (e.g., VMOVRRD should already be supported).

Yes. I've missed that. Thanks for that! As you can see I left VMOVRRD ARM instruction as FIXME since it is more complicated copy. I'm not quite sure whether I should consolidate  //getRegSequenceInputs// and //getExtractSubregInputs// into //isCopyInstr// or just use them as they are? Or maybe just rename //isCopyInstr// into //isSimpleCopyInstr//?

> - you may want to teach the peephole optimizer how to use that information to eliminate more copies.

I could check that. But I suppose that it would be better to upgrade it with separate patch since I've already have one patch on the stack that depends on this functionality?

> - why can't you do your analysis before the instructions are lowered (i.e., when all that stuff are still copies).

I've considered such approach but this information is needed to perform data flow analysis inside of each basic block in order to conclude in which registers is a variable kept. Such analysis could be performed only during or after the LiveDebugValues which is one of the latest passes. In this pass we propagate certain DBG_VALUE pseudo instructions (whose range in which it is valid is its basic block) in successors blocks that should also contain proper DBG_VALUE instruction. It is the place where we should know which register from each basic block might hold which variable in order to propagate valid variable DBG_VALUE. All DBG_VALUE analysis are performed on basic block level but only at this pass existing DBG_VALUEs are propagated to other blocks.


https://reviews.llvm.org/D45204





More information about the llvm-commits mailing list