================
@@ -7011,37 +7011,46 @@ void llvm::copyModuleAttrToFunctions(Module &M) {
   }
 }
 
-// Old two-operand form: !{!"llvm.loop.distribute.enable", i1 X}. The new
-// single-operand form uses "llvm.loop.distribute.enable" for X = true and
-// "llvm.loop.distribute.disable" for X = false.
-static bool isOldDistributeEnable(const MDTuple *T) {
-  if (T->getNumOperands() != 2)
-    return false;
-  auto *Tag = dyn_cast_or_null<MDString>(T->getOperand(0));
-  if (!Tag || Tag->getString() != "llvm.loop.distribute.enable")
-    return false;
-  return mdconst::hasa<ConstantInt>(T->getOperand(1));
+namespace {
+// Single-operand tags replacing a removed two-operand form
+// !{!"<Enable>", i1 X}: X = true selects Enable, X = false selects Disable.
+struct BooleanLoopTags {
+  StringLiteral Enable;
+  StringLiteral Disable;
+};
+} // namespace
+
+static constexpr BooleanLoopTags OldBooleanLoopTags[] = {
+    {"llvm.loop.distribute.enable", "llvm.loop.distribute.disable"},
+    {"llvm.loop.vectorize.enable", "llvm.loop.vectorize.disable"},
+    {"llvm.loop.vectorize.predicate.enable",
+     "llvm.loop.vectorize.predicate.disable"}};
+
+// Return the replacement tags for the enable tag \p Name, or nullptr.
----------------
Meinersbur wrote:

```suggestion
/// Return the replacement tags for the enable tag \p Name, or nullptr.
```
[nit]

https://github.com/llvm/llvm-project/pull/213902
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to