[PATCH] [X86] Fix pattern match for 32-to-64-bit zext in the presence of AssertSext

Michael Kuperstein michael.m.kuperstein at intel.com
Wed Nov 5 11:49:27 PST 2014


Yes, you need two basic blocks - the bug happens when you have a CopyFromReg -> AssertSext -> Zext chain, so trivially merging the basic blocks would make the issue go away.
Is there a simpler way to generate a CopyFromReg?

Regarding the mov - the resulting assembly is basically this:

orq     $-2, %rcx
movl    %ecx, %eax
imulq    $7, %rax
shrq    $32, %rax
retq

I can match the dest of the movl going into the imulq. 
Would that be better?

http://reviews.llvm.org/D6128






More information about the llvm-commits mailing list