[PATCH] D52293: [TLI][X86][AArch64] Generalize isDesirableToCommuteWithShift() hook and enable for X86

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 07:21:01 PDT 2018


lebedev.ri updated this revision to Diff 166650.
lebedev.ri retitled this revision from "[DagCombine][X86][AArch64] Try to unfold  (X >> C1) & (C2 << C3)  as  ((X >> (C1 + C3)) & C2) << C3 (PR38938)" to "[TLI][X86][AArch64] Generalize isDesirableToCommuteWithShift() hook and enable for X86".
lebedev.ri added a comment.

Ok, so the fix for the *given* problem is so much simpler.

AArch64 already overrode `isDesirableToCommuteWithShift()` with this very pattern.
But we clearly want to do the same for x86.
So just generalize it.

FIXME: i'm not sure if `isBitFieldExtractPattern()` should be a virtual function?


Repository:
  rL LLVM

https://reviews.llvm.org/D52293

Files:
  include/llvm/CodeGen/TargetLowering.h
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/AArch64/AArch64ISelLowering.h
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/extract-bits.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52293.166650.patch
Type: text/x-patch
Size: 8620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180924/088b6b1f/attachment.bin>


More information about the llvm-commits mailing list