Page MenuHomePhabricator

[LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions.

Authored by mzolotukhin on Aug 20 2015, 1:50 PM.



Currently we drop nontemporal attribute when vectorizing instructions, and this
patch fixes it. It hasn't been a problem, because there weren't cases when we
needed to vectorize scalar instructions with nontemporal attribute. But I'm
working on adding language attribute 'attribute((nontemporal)' to front-end,
after which we'll encounter such cases.

This is similar to D12213, but for loop-vectorizer.

Diff Detail

Event Timeline

mzolotukhin retitled this revision from to [LoopVectorize] Propagate 'nontemporal' attribute into vectorized instructions..
mzolotukhin updated this object.
mzolotukhin added a subscriber: llvm-commits.
nadav edited edge metadata.Aug 20 2015, 1:51 PM
nadav added a subscriber: nadav.


Maybe in a future patch we should refactor this logic in the SLP vectorizer and LoopVectorizer into a single function that verifies the metadata kind? I assume that the list should be identical.

mzolotukhin accepted this revision.Aug 20 2015, 3:39 PM
mzolotukhin added a reviewer: mzolotukhin.

Thanks, Nadav! Yes, they are very identical, so I'll follow this up with some refactoring. The main difference between propagateMetadata in SLP and in LV is that for SLP we pass a vector of MD-nodes (corresponding to scalar load/stores to be merged), and for LV we only pass one MD-node (because there we replicate a single load/store several times). I think we can reuse the SLP version in loop-vectorizer, as it covers more general case.

This revision is now accepted and ready to land.Aug 20 2015, 3:39 PM

I committed this patch in r245632.

mzolotukhin closed this revision.Aug 20 2015, 3:41 PM