summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test/c-index-test.c
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-04-11 15:10:09 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-04-11 15:10:09 +0000
commita95f87494aaca67d2060a30eb47925fbbd129832 (patch)
tree66a55a498dddef1a18cae3a6e4a015fc503689e5 /clang/tools/c-index-test/c-index-test.c
parent0840082c0270aa7974d03c176554a15f477e1690 (diff)
downloadbcm5719-llvm-a95f87494aaca67d2060a30eb47925fbbd129832.tar.gz
bcm5719-llvm-a95f87494aaca67d2060a30eb47925fbbd129832.zip
Fix for wrong instcombine on vector insert/extract
When trying to collapse sequences of insertelement/extractelement instructions into single shuffle instructions, there is one specific case where the Instruction Combiner wrongly updates the resulting Mask of shuffle indexes. The problem is in function CollectShuffleElments. If we have a sequence of insert/extract element instructions like the one below: %tmp1 = extractelement <4 x float> %LHS, i32 0 %tmp2 = insertelement <4 x float> %RHS, float %tmp1, i32 1 %tmp3 = extractelement <4 x float> %RHS, i32 2 %tmp4 = insertelement <4 x float> %tmp2, float %tmp3, i32 3 Where: . %RHS will have a mask of [4,5,6,7] . %LHS will have a mask of [0,1,2,3] The Mask of shuffle indexes is wrongly computed to [4,1,6,7] instead of [4,0,6,7]. When analyzing %tmp2 in order to compute the Mask for the resulting shuffle instruction, the algorithm forgets to update the mask index at position 1 with the index associated to the element extracted from %LHS by instruction %tmp1. Patch by Andrea DiBiagio! llvm-svn: 179291
Diffstat (limited to 'clang/tools/c-index-test/c-index-test.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud