This is an archive of the discontinued LLVM Phabricator instance.

SLPVectorizer to handle GEP with differing constant index types
ClosedPublic

Authored by JesperAntonsson on May 26 2016, 9:12 AM.

Details

Summary

This is a solution to bug 27617.

Bug description: The SLPVectorizer asserts on encountering GEPs with different index types, such as i8 and i64.

The patch includes a simple relaxation of the assert to allow constants being of different types, along with a regression test that will provoke the unrelaxed assert.

Diff Detail

Event Timeline

JesperAntonsson retitled this revision from to SLPVectorizer to handle GEP with differing constant index types.
JesperAntonsson updated this object.
JesperAntonsson added reviewers: mzolotukhin, nadav.
JesperAntonsson added a subscriber: llvm-commits.

Thanks! This is my first contribution and I don't have commit rights. Could you help me commit, please?

BR, Jesper Antonsson

From: Nadav Rotem [mailto:nadav.rotem@me.com]
Sent: den 26 maj 2016 18:47
To: reviews+D20685+public+ad60c4dd8eb813ce@reviews.llvm.org; Jesper Antonsson
Cc: Jesper Antonsson; mzolotukhin@apple.com; nrotem@apple.com
Subject: Re: [PATCH] D20685: SLPVectorizer to handle GEP with differing constant index types

Looks good to me. Please commit.

mzolotukhin edited edge metadata.May 27 2016, 2:25 PM

Hi Jesper,

This test doesn't work to me. Could you please verify that this patch is for the current trunk?

Also, some more specific remarks inline.

Thanks,
Michael

test/Transforms/SLPVectorizer/X86/gep_mismatch.ll
2

We usually try to minimize number of passes running on a test. For instance, if the assertion happened in SLPVectorizer, we probably only need slp-vectorizer: -indvars and -O1 can be removed (i.e. you run opt -indvars on the test and the output is the new test that doesn't need -indvars in the command line).

7

I got LLVM ERROR: Unknown specifier in datalayout string on this. Could you please check if it's correct?

40

#3 means that we need attribute #3, but the test contains no attributes at all. Were they lost when you were reducing the test?

JesperAntonsson edited edge metadata.

Corrected test case in accordance to the review comments from Michael Zolotukhin. (Thanks Michael!)

mzolotukhin accepted this revision.Jun 8 2016, 3:45 PM
mzolotukhin edited edge metadata.
This revision is now accepted and ready to land.Jun 8 2016, 3:45 PM
mzolotukhin closed this revision.Jun 8 2016, 3:46 PM

Hi Jesper,

I committed your patch in rL272206, thank you for fixing it!

Michael