cdl-saarland / rv

RV: A Unified Region Vectorizer for LLVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keep address spaces in pointer casts

simoll opened this issue · comments

The RV backend currently resets the address spaces to zero when casting pointers (see below). This issue shows up in Chapel generated IR (thanks to @mppf for reporting).

  %179 = getelementptr inbounds i64, i64 addrspace(100)* %53, i128 %178
  %180 = bitcast i64 addrspace(100)* %179 to <2 x i64> addrspace(100)*
  %vec_cast = addrspacecast <2 x i64> addrspace(100)* %180 to <2 x i64>*
  %cont_load = load <2 x i64>, <2 x i64>* %vec_cast, align 8
  %181 = getelementptr inbounds i64, i64* %51, i64 %i.0C361
  %vec_cast362 = bitcast i64* %181 to <2 x i64>*
  store <2 x i64> %cont_load, <2 x i64>* %vec_cast362, align 8