[PATCH] D120586: [Attributor] Add AAAddressSpaceInfo to deduce address spaces

Shilei Tian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 22:17:04 PDT 2023


tianshilei1992 marked 7 inline comments as done.
tianshilei1992 added inline comments.


================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:5971
+  /// the associated value is dead.
+  virtual int32_t getAddressSpace() const = 0;
+
----------------
tschuett wrote:
> jdoerfert wrote:
> > no null opt anymore
> Could you instead return an optional to handle invalid and unknown states?
I could do it but we can also assume this function should not be called if the AA is invalid, which is what is being used right now. I suppose users have to check the state of the AA before query the AS.


================
Comment at: llvm/test/Transforms/Attributor/address_space_info.ll:88
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr [[P]], align 4
+; CHECK-NEXT:    [[TMP1:%.*]] = addrspacecast ptr addrspacecast (ptr addrspace(1) @dst to ptr) to ptr addrspace(1)
+; CHECK-NEXT:    store i32 [[TMP0]], ptr addrspace(1) [[TMP1]], align 4
----------------
This looks so twisted. Have to fix it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120586



More information about the llvm-commits mailing list