XCore target: disable vectorization

Robert Lytton robert at xmos.com
Mon Sep 9 10:49:51 PDT 2013

Hi Arnold,

In my mind there seems to be two changes needed.

1) llvm to check the number of vector registers - as per the direction of this thread.
Will I also need something similar in BBVectorize? (see below).
I need to create some tests for the changes - not so straight forward!
When done, I'll post to llvm-commit and cc folk for comment.

2) clang not to set the '-vectorize-loops' & '-vectorize-slp' flags.
Thus the original patch (with corrected function name) would seem reasonable.
If others agree, I will resubmit the changes.


--- a/lib/Transforms/Vectorize/BBVectorize.cpp
+++ b/lib/Transforms/Vectorize/BBVectorize.cpp
@@ -397,6 +397,12 @@ namespace {
       DEBUG(if (TTI) dbgs() << "BBV: using target information\n");
       bool changed = false;
+      // If the target claims to have no vector registers don't attempt
+      // vectorization.
+      if (TTI && !TTI->getNumberOfRegisters(true))
+        return false;
       // Iterate a sufficient number of times to merge types of size 1 bit,

More information about the cfe-commits mailing list