[PATCH] D114075: [IR] Split vscale_range interface

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 3 09:03:04 PST 2021


paulwalker-arm added inline comments.


================
Comment at: llvm/include/llvm/IR/Attributes.h:223-224
+
+  /// Returns the maximum value for the vscale_range attribute or None for
+  /// unbounded (0).
+  Optional<unsigned> getVScaleRangeMax() const;
----------------
Up to you but I think "or None when unknown." is simpler.


================
Comment at: llvm/include/llvm/IR/Attributes.h:1064
+
+  /// Retrieve the maximum value of 'vscale_range' or None for unbounded (0).
+  Optional<unsigned> getVScaleRangeMax() const;
----------------
As above.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5655-5656
+    Attribute Attr = TheFunction->getFnAttribute(Attribute::VScaleRange);
+    if (Optional<unsigned> VScaleMax = Attr.getVScaleRangeMax())
+      MaxVScale = VScaleMax.getValue();
   }
----------------
Is this if statement required? MaxVScale is an optional so I think `MaxVScale = Attr.getVScaleRangeMax();` just works?


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

https://reviews.llvm.org/D114075



More information about the llvm-commits mailing list