[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 18:03:59 PDT 2017


rampitec added a comment.

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

> What does it look like immediately after SeparateConstOffsetFromGEP? Does one of the other passes break this somehow?


This is after SeparateConstOffsetFromGEP:

  %408 = zext i32 %407 to i64
  %409 = getelementptr inbounds float, float addrspace(1)* %1, i64 %408
  %410 = bitcast float addrspace(1)* %409 to i32 addrspace(1)*
  %411 = load i32, i32 addrspace(1)* %410, align 4, !tbaa !10
  %412 = or i32 %407, 1
  %413 = zext i32 %412 to i64
  %414 = getelementptr inbounds float, float addrspace(1)* %1, i64 %413
  %415 = bitcast float addrspace(1)* %414 to i32 addrspace(1)*
  %416 = load i32, i32 addrspace(1)* %415, align 4, !tbaa !10
  %417 = or i32 %407, 2
  %418 = zext i32 %417 to i64
  %419 = getelementptr inbounds float, float addrspace(1)* %1, i64 %418
  %420 = bitcast float addrspace(1)* %419 to i32 addrspace(1)*
  %421 = load i32, i32 addrspace(1)* %420, align 4, !tbaa !10
  %422 = or i32 %407, 3
  %423 = zext i32 %422 to i64
  %424 = getelementptr inbounds float, float addrspace(1)* %1, i64 %423
  %425 = bitcast float addrspace(1)* %424 to i32 addrspace(1)*
  %426 = load i32, i32 addrspace(1)* %425, align 4, !tbaa !10

Bitcasts are there plus we have or's instead of adds.


Repository:
  rL LLVM

https://reviews.llvm.org/D32101





More information about the llvm-commits mailing list