[PATCH] [ARM64]Fix a bug when lowing shuffle vector to EXT instruction
Hao.Liu at arm.com
Thu Apr 24 22:18:52 PDT 2014
Hi Tim and other reviewers,
When lowing shuffle vector, there is a function called isEXTMask to check whether we can optimize it into a EXT. But that function misses on situation, as a result it will generate incorrect indexed EXT.
It considers about the mask starts with UNDEFs as following:
<-1, -1, 3, ...> means that an EXT must start at 3 - 2 = 1,
But if there are too many UNDEFs, such as <-1, -1, -1, 1, ...>, the index counter will be overflowed into a very large unsigned int (i.e. unsigned Imm = 1 - 3).
This patch fixes this bug. To make it looks more simpler, it also adjust the position of logic about operands traverse. Review please.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4222 bytes
Desc: not available
More information about the llvm-commits