[PATCH] D105341: [SVE] Fix ShuffleVector cast<FixedVectorType> in truncateToMinimalBitwidths

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 5 04:59:53 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/test/Transforms/LoopVectorize/scalable-trunc-min-bitwidth.ll:4
+define void @func(i8* %p, i8 %arg1, i64 %len) {
+; CHECK-LABEL: @func(
+; CHECK-NEXT:  entry:
----------------
david-arm wrote:
> 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.
> 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.


================
Comment at: llvm/test/Transforms/LoopVectorize/scalable-trunc-min-bitwidth.ll:73
+for.body:                                         ; preds = %entry
+  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+  %arrayidx = getelementptr inbounds i8, i8* %p, i64 %indvars.iv
----------------
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
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105341/new/

https://reviews.llvm.org/D105341



More information about the llvm-commits mailing list