This is an archive of the discontinued LLVM Phabricator instance.

[DAG] SimplifyDemandedVectorElts Bugfix for X86ISD::VBROADCAST calculating wrong DemandedElts for its Operand
AbandonedPublic

Authored by yubing on May 31 2020, 8:05 PM.

Details

Summary

Assume we have:
t60: v4i32 = insert_vector_elt t29, t27, Constant:i64<2>
t63: v8i32 = X86ISD::VBROADCAST t60
if t60's DemandElts is 0b10110001, t63's DemandElts should be 0b1011 | 0b0001 = 0b1011, but current code will set t63's DemandElts to 0b0001

Simon, it seems very difficult to write a testcase, , do you have any suggestions for the testcase?

Diff Detail

Event Timeline

yubing created this revision.May 31 2020, 8:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2020, 8:05 PM
yubing edited the summary of this revision. (Show Details)May 31 2020, 8:07 PM

Broadcast should only demand the lowest element. The recursive call to SimplifyDemandedVectorElts call is supposed to ignore the incoming DemandedElts if the SDValue has more than one use.

Broadcast should only demand the lowest element. The recursive call to SimplifyDemandedVectorElts call is supposed to ignore the incoming DemandedElts if the SDValue has more than one use.

Hi, Craig. But it is X86ISD::VBroadcast, if its Operand is a vector, is that correct to demand the lowest element for its operand?

yubing abandoned this revision.May 31 2020, 9:33 PM