[PATCH] D135572: [Attributes] Support int attributes with zero value

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 01:36:09 PDT 2022


nikic added inline comments.


================
Comment at: llvm/lib/IR/Attributes.cpp:1667
 Optional<unsigned> AttrBuilder::getVScaleRangeMax() const {
-  return unpackVScaleRangeArgs(getRawIntAttr(Attribute::VScaleRange)).second;
+  return unpackVScaleRangeArgs(
+             getRawIntAttr(Attribute::VScaleRange).value_or(0))
----------------
serge-sans-paille wrote:
> Based on the implementation of `unpackVScaleRangeArgs` I think you can early return `None` if the original Attr is None here
I just realized that these methods aren't used at all, so I went ahead and just removed them entirely: https://github.com/llvm/llvm-project/commit/24b1340ff96434c272a2a4abd3e70609be577e8a




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

https://reviews.llvm.org/D135572



More information about the llvm-commits mailing list