Comments inside patch show the details. Please review, thanks.
Details
Diff Detail
Event Timeline
Hi Kevin,
Isn't this patch just hiding the backend issue? Enhancing isBuildVectorAllZeros like that seems like a good idea, but I can't see any guarantee that the problematic DAG can't still emerge by some other means (not that my quick tests have managed to produce it).
Cheers.
Tim.
Hi Tim,
Thanks for your review. I enhanced isBuildVectorAllZeros() according to isBuildVectorAllones() which is just above it. I think it's meaningful to get it as robust as its brother function. For the word "problematic DAG", my understanding is you're referring to the constant larger than 16 bit width which is used to build a v4i16 vector. From my point of view, I'm not sure whether it's a "problematic DAG", because after legalization, DAG combiner may generate this kind of node in many paths. It's hard to avoid generating it unless we capture all paths that may create constant folding and guarantee those foldings only happen before legalization. I can do this for the path I observed, but I can't guarantee this kind of node won't be generated from other DAG combine path. So my suggestion is don't treat that node problematic, we should get our backend correctly handle that node as well.
Regards,
Kevin Qin
Hi Kevin,
So my suggestion is don't treat that node problematic, we should get our backend correctly handle that node as well.
Agreed. That's exactly what I meant. It could come up via some other route so we need to be able to handle it.
Cheers.
Tim.
Hi Kevin,
It's committed in r211567. Cheers.
That seems to be just the generic CodeGen improvement. What about the
actual AArch64 issue?
Cheers.
Tim.
Sorry for following up this issue late. This patch is to normalize all constants building a vector. The value of constant nodes will be truncated to fit element width.