================ @@ -0,0 +1,40 @@ +; RUN: opt -assume-default-is-flat-addrspace -print-module-scope -print-after-all -S -disable-output -passes=infer-address-spaces <%s 2>&1 | FileCheck %s + +; CHECK: IR Dump After InferAddressSpacesPass on f2 + +; Check that after running infer-address-spaces on f2, the redundant addrspace cast %x1 in f2 is gone. +; CHECK-LABEL: define spir_func void @f2() +; CHECK: [[X:%.*]] = addrspacecast ptr addrspace(1) @x to ptr +; CHECK-NEXT: call spir_func void @f1(ptr noundef [[X]]) + +; But it should not affect f3. +; CHECK-LABEL: define spir_func void @f3() +; CHECK: %x1 = addrspacecast ptr addrspacecast (ptr addrspace(1) @x to ptr) to ptr addrspace(1) +; CHECK-NEXT: %x2 = addrspacecast ptr addrspace(1) %x1 to ptr +; CHECK-NEXT: call spir_func void @f1(ptr noundef %x2) + +; Ensure that the pass hasn't run on f3 yet. +; CHECK: IR Dump After InferAddressSpacesPass on f3 ---------------- wenju-he wrote:
done https://github.com/llvm/llvm-project/pull/70611 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits