[llvm] [SandboxVectorizer] Add container class to track and manage SeedBundles (PR #112048)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 14:00:01 PDT 2024


================
@@ -54,6 +54,10 @@ class SeedBundle {
     NumUnusedBits += Utils::getNumBits(I);
   }
 
+  virtual void insert(Instruction *I, ScalarEvolution &SE) {
+    assert("Subclasses must override this function.");
+  }
+
----------------
Sterling-Augustine wrote:

I don't think that would solve the problem. Right now `insert` isn't pure virtual so that the tests for SeedBundle (which has a fair amount of code) can test an actual SeedBundle. If SeedBundleBase has a pure virtual function, it would have the same untestable problem--and all the useful code would be inside it. That's basically just renaming the class. There needs to be a stub somewhere so it can be tested independently.

I suppose I'll make it pure virtual, and then make the test itself locally instantiate a "SeedBundleForTest" with the function overridden to a stub that looks exactly like the one now. I personally don't think that is appreciably better than an error, but whatever.

https://github.com/llvm/llvm-project/pull/112048


More information about the llvm-commits mailing list