This is an archive of the discontinued LLVM Phabricator instance.

[SVE] Fix ShuffleVector cast<FixedVectorType> in truncateToMinimalBitwidths
ClosedPublic

Authored by DylanFleming-arm on Jul 2 2021, 3:35 AM.

Diff Detail

Event Timeline

DylanFleming-arm requested review of this revision.Jul 2 2021, 3:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2021, 3:35 AM
david-arm added inline comments.Jul 5 2021, 12:48 AM
llvm/test/Transforms/LoopVectorize/scalable-trunc-min-bitwidth.ll
4

I wonder if all these CHECK lines are needed here? For example, I'm not sure if it's necessary for this simple loop to show the blocks after vector.body?

Also, it looks like you have created the CHECK lines using this tool:

llvm/utils/update_test_checks.py

which is absolutely fine! This is just for information really, but normally if we leave the CHECK lines unmodified we also leave in the comment at the top:

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py

That way it tells anyone who has to change this file that they can just re-run that script again.

Cleaned up CHECK lines
Added autogenerated line

sdesmalen added inline comments.Jul 5 2021, 4:59 AM
llvm/test/Transforms/LoopVectorize/scalable-trunc-min-bitwidth.ll
4

but normally if we leave the CHECK lines unmodified we also leave in the comment at the top:

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py

It is actually the script itself that does that. I agree with @david-arm that this should not be removed.

73

You can reduce this test a bit further, as some of the operations are unnecessary to reproduce the failure:

define void @func(i8* %p, i32 %arg1, i64 %len) {
entry:
  br label %for.body

for.body:                                         ; preds = %entry
  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
  %arrayidx = getelementptr inbounds i8, i8* %p, i64 %indvars.iv
  %0 = load i8, i8* %arrayidx
  %conv = zext i8 %0 to i32
  %conv17 = xor i32 %conv, %arg1
  %mul18 = mul nuw nsw i32 %conv17, %conv
  %conv19 = trunc i32 %mul18 to i8
  store i8 %conv19, i8* %arrayidx
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond = icmp eq i64 %indvars.iv.next, %len
  br i1 %exitcond, label %for.exit, label %for.body, !llvm.loop !0

for.exit:                                 ; preds = %for.body
  ret void
}

Removed excess LLVMIR from test

This revision is now accepted and ready to land.Jul 6 2021, 3:16 AM
This revision was landed with ongoing or failed builds.Jul 7 2021, 7:30 AM
This revision was automatically updated to reflect the committed changes.