This is an archive of the discontinued LLVM Phabricator instance.

Fixed : rL251291: Loop Vectorizer - skipping "bitcast" before GEP
ClosedPublic

Authored by delena on Oct 27 2015, 4:03 AM.

Details

Summary

As Michael Zolotukhin noticed, skipping bitcast is not always correct.
The 'bitcast' may be skipped when the size of the pointee is the same.

Bitcast between GEP and load can not be skipped, and the load can not be vectorized in the following case:

%arrayidx = getelementptr inbounds double*, double** %in, i64 %indvars.iv
%tmp53 = bitcast double** %arrayidx to i8*
%tmp54 = load i8, i8* %tmp53, align 1

Skipping 'bitcast' in this case allows to vectorize load:

%arrayidx = getelementptr inbounds double*, double** %in, i64 %indvars.iv
%tmp53 = bitcast double** %arrayidx to i64*
%tmp54 = load i64, i64* %tmp53, align 8

Diff Detail

Repository
rL LLVM

Event Timeline

delena updated this revision to Diff 38523.Oct 27 2015, 4:03 AM
delena retitled this revision from to Fixed : rL251291: Loop Vectorizer - skipping "bitcast" before GEP.
delena updated this object.
delena added reviewers: mzolotukhin, jmolloy.
delena set the repository for this revision to rL LLVM.
delena added a subscriber: llvm-commits.
hfinkel accepted this revision.Oct 27 2015, 11:36 AM
hfinkel added a reviewer: hfinkel.
hfinkel added a subscriber: hfinkel.

LGTM.

This revision is now accepted and ready to land.Oct 27 2015, 11:36 AM
delena closed this revision.Apr 25 2016, 11:00 PM