================
@@ -1427,8 +1429,20 @@ static void AddParamAndFnBasicAttributes(const CallBase 
&CB,
               ValidExactParamAttrs[ArgNo].getAlignment().valueOrOne())
             AL = AL.removeParamAttribute(Context, I, Attribute::Alignment);
 
+          auto ExistingRange = AL.getParamRange(I);
           AL = AL.addParamAttributes(Context, I, ValidExactParamAttrs[ArgNo]);
 
+          // For range we use the exact intersection.
+          if (ExistingRange.has_value()) {
+            if (auto NewRange = ValidExactParamAttrs[ArgNo].getRange()) {
+              auto CombinedRange = 
ExistingRange->exactIntersectWith(*NewRange);
----------------
andjo403 wrote:

But is it an empty range? if eg the ranges is [30, 20) and [10, 40) values in 
the ranges [10,20) and [30,40) are not poison but exactIntersectWith will 
return nullopt. I Think that it is possible to get ranges like that.

https://github.com/llvm/llvm-project/pull/91101
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to