[PATCH] merge consecutive stores of extracted vector elements (PR21711)
hfinkel at anl.gov
hfinkel at anl.gov
Tue Jan 6 19:20:07 PST 2015
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9791
@@ +9790,3 @@
+ // (in other words some of the stored values are constants or loads).
+ if (StoredVal.getOpcode() != ISD::EXTRACT_VECTOR_ELT)
+ return false;
----------------
spatel wrote:
> hfinkel wrote:
> > How does this cause a crash if you remove this check?
> >
> For code like the second test case, we merge the stores and later during legalization get an error like this for the vector load:
> Operand not processed?
> 0x5c4c770: v2i64,ch = load 0x5c4ac60, 0x5c4c660, 0x5c45850<LD16[%sunkaddr115](tbaa=<0x5b6c2a8>)> [ORD=61] [ID=1]
>
> I haven't figured out exactly what happens to cause that.
Is that load supposed to be dead? What did you do with users of the load's chain result (which I assume might include at least one of the stores you're merging).
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:9850
@@ +9849,3 @@
+ while (!St->use_empty())
+ DAG.ReplaceAllUsesWith(SDValue(St, 0), St->getChain());
+ deleteAndRecombine(St);
----------------
Maybe if the load appeared in the chain in between these stores somewhere, you'll cause a cycle?
http://reviews.llvm.org/D6850
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list