DAGCompiler::MergeConsecutiveStores Question

In DAGCombiner::MergeConsecutiveStores, there is this check:

     if (Index->getAlignment() != St->getAlignment())
       break;

Apparently this check ensures that all of the stores have the same
alignment. Why is that necessary? This seems very overly restrictive
to me.

                            -David

Hi David,

You are right. This check is overly restrictive. We can replace this check with code that uses the alignment of the first store.

Thanks,
Nadav

Hi David,

You are right. This check is overly restrictive. We can replace this check with code that uses the alignment of the first store.

Except for cases where the alignment is zero, which is the natural alignment of the type. :slight_smile: