[PATCH] D157068: [Attributor] New attribute to identify what byte ranges are alive for an allocation

Vidhush Singhal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 08:25:48 PDT 2023


vidsinghal added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:12489-12495
+    if (BinSize > 1)
+      return indicatePessimisticFixpoint();
+
+    const auto &It = State.begin();
+
+    if (It == State.end())
+      return indicatePessimisticFixpoint();
----------------
jdoerfert wrote:
> This is basically BinSize != 1, return, no?
umm, I think BinSize == 0


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:12508
+    if (OffsetEnd == AllocationSize)
+      return indicatePessimisticFixpoint();
+
----------------
jdoerfert wrote:
> Why does this not trigger for the ptr/i64 case? Is one of them in bytes the other in bits?
if its a **ptr**
```
public: std::optional<TypeSize> getAllocationSize(const DataLayout &DL) 
```

returns a size of 0 which is why that if condition is not triggered. 
At the LLVM IR level, I think the size of pointer is just 0.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157068



More information about the llvm-commits mailing list