[all-commits] [llvm/llvm-project] 154c03: [X86] combineX86GatherScatter - only fold scale if...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Oct 29 03:48:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 154c036ebb9ba788f4025fa15c8896cb1f13e066
      https://github.com/llvm/llvm-project/commit/154c036ebb9ba788f4025fa15c8896cb1f13e066
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-10-29 (Fri, 29 Oct 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/masked_gather_scatter.ll

  Log Message:
  -----------
  [X86] combineX86GatherScatter - only fold scale if the index isn't extended

As mentioned on D108539, when the gather indices are smaller than the pointer size, they are sign-extended BEFORE scale is applied, making the general fold unsafe.

If the index have sufficient sign-bits then folding the scale could be safe - I'll investigate this.




More information about the All-commits mailing list