[PATCH] D84942: [ConstantFolding] fold abs intrinsic

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 09:23:53 PDT 2020


aqjune accepted this revision.
aqjune added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/test/Analysis/ConstantFolding/abs.ll:46
-; CHECK-NEXT:    [[R:%.*]] = call <8 x i8> @llvm.abs.v8i8(<8 x i8> <i8 -127, i8 -126, i8 -42, i8 -1, i8 0, i8 1, i8 42, i8 127>, i1 true)
-; CHECK-NEXT:    ret <8 x i8> [[R]]
 ;
----------------
spatel wrote:
> aqjune wrote:
> > (a silly question) abs with a vector input is optimized here, but this patch is about non-vector integers; do you have any idea which part of ConstantFolding.cpp is responsible for this?
> Not silly - I used the vector test to reduce the number of tests needed, and it's not obvious from just this patch how that works. :)
> I put an inline comment at the place where vectors get expanded. So this test is sequentially calling into the scalar code 8 times (once for each element of the vector).
Thank you for the kind explanation! :)


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

https://reviews.llvm.org/D84942



More information about the llvm-commits mailing list