Page MenuHomePhabricator

[DAGCombiner][X86] Don't peek through ANDs on the shift amount in matchRotateSub when called from MatchFunnelPosNeg.
ClosedPublic

Authored by craig.topper on Feb 28 2021, 11:30 AM.

Details

Summary

Peeking through AND is only valid if the input to both shifts is
the same. If the inputs are different, then the original pattern
ORs the two values when the masked shift amount is 0. This is ok
if the values are the same since the OR would be a NOP which is
why its ok for rotate.

Fixes PR49365 and reverts PR34641

Diff Detail

Unit TestsFailed

TimeTest
40 msx64 debian > Flang.Semantics::resolve102.f90
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/flang/test/Semantics/test_errors.sh /mnt/disks/ssd0/agent/llvm-project/flang/test/Semantics/resolve102.f90 /mnt/disks/ssd0/agent/llvm-project/build/tools/flang/test/Semantics/Output/resolve102.f90.tmp /mnt/disks/ssd0/agent/llvm-project/build/bin/f18 -intrinsic-module-directory /mnt/disks/ssd0/agent/llvm-project/build/tools/flang/include/flang

Event Timeline

craig.topper created this revision.Feb 28 2021, 11:30 AM
craig.topper requested review of this revision.Feb 28 2021, 11:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2021, 11:30 AM
lebedev.ri accepted this revision.Feb 28 2021, 11:44 AM
lebedev.ri added a subscriber: lebedev.ri.

Hm, i recall viewing the original patch back then, not sure why i didn't catch that :/
LGTM

llvm/test/CodeGen/X86/shift-double.ll
487
This revision is now accepted and ready to land.Feb 28 2021, 11:44 AM
RKSimon accepted this revision.Feb 28 2021, 12:34 PM

LGTM

llvm/test/CodeGen/X86/shift-double.ll
487

probably not "safe" then......

This revision was landed with ongoing or failed builds.Feb 28 2021, 1:01 PM
This revision was automatically updated to reflect the committed changes.