[PATCH] D103615: [Clang] Add option for vector compare compatibility.

Bardia Mahjour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 21 10:00:09 PDT 2021


bmahjour added a comment.

Sorry I didn't mention this in my earlier comment about the option name, but I think that all inconsistencies in handling vector bool/pixel types should be controlled by a single compatibility option. For example the current special handling of initialization (splat vs non-splat) for these types should also be option controlled. For that reason we should design and name the option in a more generic way. The same consideration should go into the wording of the deprecation warning.
Some suggestions:

rename `-vector-compare-compat` to `-altivec-compatibility` or `-altivec-compat` or  '-altivec-bool-pixel-compat` or `-vector-bool-pixel-compat`. (I prefer the last two)
reword the message to:
"Current handling of vector bool and vector pixel types in this context are deprecated. The default behaviour will soon change to that implied by the '-altivec-compat=xl' option"

Please also update the description section of this review.



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:7442
+  "pixel. Comparisons between vector bool/pixel types will soon return "
+  "a scalar value instead of a vector value by default">;
+
----------------
We need to add a new grouping (see `InGroup<...>`) for this, otherwise users won't be able to turn this warning off individually. There is also a clang LIT test that would fail if a warning message is added without a grouping specified. Please make sure check-all passes.


================
Comment at: clang/include/clang/Basic/LangOptions.def:130
+ENUM_LANGOPT(VectorCompareCompat, VectorCompareCompatKind, 2,
+             VectorCompareCompatKind::Mixed, "vector compare compatibility")
 LANGOPT(ConvergentFunctions, 1, 1, "Assume convergent functions")
----------------
`VectorCompareCompatKind::Mixed` -> `VectorCompareCompatKind::Default`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103615/new/

https://reviews.llvm.org/D103615



More information about the cfe-commits mailing list