[PATCH] D112142: [InstCombine][ConstantFolding] Make ConstantFoldLoadThroughBitcast TypeSize-aware

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 20 09:02:09 PDT 2021


david-arm added a comment.

Hi @peterwaller-arm, the patch looks good to me! I wonder if it's worth renaming the test to `vscale_load.ll` so that it's less specific? That way we can potentially more load related fold tests here in future as well.



================
Comment at: llvm/test/Transforms/InstCombine/vscale_load_bitcast.ll:6
+; CHECK-LABEL: @constprop_load_bitcast(
+; CHECK-NEXT:    ret <8 x i8> zeroinitializer
+;
----------------
I guess this fold is happening because effectively i1 is being promoted to i8? Otherwise the minimum size of <vscale x 16 x i1> would be just 2 bytes, i.e. less than than <8 x i8>.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112142



More information about the llvm-commits mailing list