[PATCH] D32101: Skip bitcasts while looking for GEP in LoadStoreVectorizer

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 16:27:42 PDT 2017


rampitec added a comment.

In https://reviews.llvm.org/D32101#727681, @arsenm wrote:

> I don't think this should be needed? Is this representative of the case where you saw this as a problem? If I run this testcase through-separate-const-offset-from-gep first it handles it. This and other cases are expected to be cleaned up by that first


It is quite representative. Here is the real piece of code from app, right as it comes to the vectorizer:

  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds float, float addrspace(1)* %1, i64 %97
  %99 = bitcast float addrspace(1)* %98 to i32 addrspace(1)*
  %100 = load i32, i32 addrspace(1)* %99, align 4, !tbaa !10
  %101 = add i32 %96, 1
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds float, float addrspace(1)* %1, i64 %102
  %104 = bitcast float addrspace(1)* %103 to i32 addrspace(1)*
  %105 = load i32, i32 addrspace(1)* %104, align 4, !tbaa !10
  %106 = add i32 %96, 2
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds float, float addrspace(1)* %1, i64 %107
  %109 = bitcast float addrspace(1)* %108 to i32 addrspace(1)*
  %110 = load i32, i32 addrspace(1)* %109, align 4, !tbaa !10
  %111 = add i32 %96, 3
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds float, float addrspace(1)* %1, i64 %112
  %114 = bitcast float addrspace(1)* %113 to i32 addrspace(1)*
  %115 = load i32, i32 addrspace(1)* %114, align 4, !tbaa !10


Repository:
  rL LLVM

https://reviews.llvm.org/D32101





More information about the llvm-commits mailing list