[X86] Fix non-determinism in LowerVectorAllZeroTest
authorAdam Nemet <anemet@apple.com>
Mon, 24 Mar 2014 16:52:08 +0000 (16:52 +0000)
committerAdam Nemet <anemet@apple.com>
Mon, 24 Mar 2014 16:52:08 +0000 (16:52 +0000)
commita1b54dd1ffff68195ecfe106dceeb73e351dd6c9
treec043fd91caec0339a525e63a5b7e187c44bd4626
parent8ce101ed106b8da645eba8b98ee736cd19cd3543
[X86] Fix non-determinism in LowerVectorAllZeroTest

This can be observed with the old testcase of CodeGen/X86/pr12312.ll:

47c47
<       vorps   %ymm0, %ymm1, %ymm0
---
>       vorps   %ymm1, %ymm0, %ymm0
97c97
<       vorps   %ymm1, %ymm0, %ymm0
---
>       vorps   %ymm0, %ymm1, %ymm0

The vector VecIns is populated with all the values from VecInMap. This is done
while iterating VecInMap.  VecInMap uses a hash of pointer values so the
resulting order can vary depending on the memory layout.

The fix is to populate the vector VecIns earlier as VecInMap is populated.
This is done in DAG traversal order.

Fixes <rdar://problem/16398806>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204623 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp