The test was using -O2, where -loop-vectorize will suffice.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
LGTM - but can you explain in the commit why you are doing this? In particular, can you state that the test case still fails without the fix that removed the warning?
@fpetrogalli sure!
The original patch was D89798, which fixed a TypeSize warning in loop vectorization legality. The test being modified in this patch defends against that warning. So:
- without D89798, a TypeSize warning will fire, so this test will fail.
- with D89798, a TypeSize warning will not fire, so this test will pass.
It turns out that -O2 is probably not the best flag for this test; the passes performed by -O2 are not guaranteed to remain consistent, so this test could fail if this changes in the future. Since the TypeSize warning arose in loop vectorization legality, it suffices to use -loop-vectorize here instead of -O2.
I have also tested this patch. It fails without D89798 applied, but passes with D89798 applied, so it is functionally equivalent to the old test but more future proof.