[PATCH] [ARM64]Fix a bug when lowing shuffle vector to EXT instruction

Hao Liu Hao.Liu at arm.com
Thu Apr 24 22:18:52 PDT 2014


Hi t.p.northover,

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.

Thanks,
-Hao

http://reviews.llvm.org/D3500

Files:
  lib/Target/ARM64/ARM64ISelLowering.cpp
  test/CodeGen/ARM64/ext.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3500.8827.patch
Type: text/x-patch
Size: 4222 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140425/2f69bbd5/attachment.bin>


More information about the llvm-commits mailing list