Skip to content
Commit 61f31cbc authored by Craig Topper's avatar Craig Topper
Browse files

[X86] Teach foldMaskedShiftToScaledMask to look through an any_extend from i32...

[X86] Teach foldMaskedShiftToScaledMask to look through an any_extend from i32 to i64 between the and & shl

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 caused by 64-bit SHL being narrowed to 32-bits when their upper bits aren't demanded.

Differential Revision: https://reviews.llvm.org/D60532

llvm-svn: 358139
parent 4a32ce39
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment