OSDN Git Service

[LoopVectorizer] Use two step casting for float to pointer types.
authorManoj Gupta <manojgupta@google.com>
Fri, 1 Sep 2017 15:36:00 +0000 (15:36 +0000)
committerManoj Gupta <manojgupta@google.com>
Fri, 1 Sep 2017 15:36:00 +0000 (15:36 +0000)
commit5d292d77f56dfa221128912f8ce694214e6dad9e
tree6f44c8042320146f34982244b4e5344b3d1b85d4
parent3b88873b054cd2c541797062d653707c5689c265
[LoopVectorizer] Use two step casting for float to pointer types.

Summary:
LoopVectorizer is creating casts between vec<ptr> and vec<float> types
on ARM when compiling OpenCV. Since, tIs is illegal to directly cast a
floating point type to a pointer type even if the types have same size
causing a crash. Fix the crash using a two-step casting by bitcasting
to integer and integer to pointer/float.
Fixes PR33804.

Reviewers: mkuper, Ayal, dlj, rengolin, srhines

Reviewed By: rengolin

Subscribers: aemerson, kristof.beyls, mkazantsev, Meinersbur, rengolin, mzolotukhin, llvm-commits

Differential Revision: https://reviews.llvm.org/D35498

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312331 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/CodeGen/AArch64/loopvectorize_pr33804_double.ll [new file with mode: 0644]
test/CodeGen/ARM/loopvectorize_pr33804.ll [new file with mode: 0644]