[PATCH] D60532: [X86] Teach foldMaskedShiftToScaledMask to look throw an any_extend from i32 to i64 between the and & shl

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 10 12:28:15 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.
craig.topper updated this revision to Diff 194569.
craig.topper added a comment.

Upload the right patch. The other was partial


foldMaskedShiftToScaledMask tries to reorder and & shl to enable the shl to fold into an LEA. But if there is an any_extend between them it doesn't work.

This patch modifies the code to look through any_extend from i32 to i64 when the and mask only uses bits that weren't from the extended part.

This will prevent a regression from D60358 <https://reviews.llvm.org/D60358> caused by 64-bit SHL being narrowed to 32-bits when their upper bits aren't demanded.


https://reviews.llvm.org/D60532

Files:
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/test/CodeGen/X86/fold-and-shift-x86_64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60532.194569.patch
Type: text/x-patch
Size: 4895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190410/a4e3f0e7/attachment.bin>


More information about the llvm-commits mailing list