HomePhabricator

[NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV…

Authored by lebedev.ri on Feb 26 2021, 5:48 AM.

Description

[NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions

These intrinsics, not the icmp+select are the canonical form nowadays,
so we might as well directly emit them.

This should not cause any regressions, but if it does,
then then they would needed to be fixed regardless.

Note that this doesn't deal with SCEVExpander::isHighCostExpansion(),
but that is a pessimization, not a correctness issue.

Additionally, the non-intrinsic form has issues with undef,
see https://reviews.llvm.org/D88287#2587863

Details

Committed
lebedev.riMar 6 2021, 10:52 AM
Parents
rGf0904a62085a: [PowePC][AIX] Handle variadic vector call operands.
Branches
Unknown
Tags
Unknown

Event Timeline

xbolva00 added a subscriber: xbolva00.EditedMar 6 2021, 12:10 PM

These intrinsics, not the icmp+select are the canonical form nowadays

Only true yet for abs, no?

@nikic @spatel

nikic added a comment.EditedMar 7 2021, 1:59 PM

These intrinsics, not the icmp+select are the canonical form nowadays

Only true yet for abs, no?

@nikic @spatel

Yes, the min/max intrinsics are not canonical yet. I've opened D98152 to show the current state and which folds we're missing.

This commit may cause multiple CI failures on TensorFlow/NVPTX backend. See https://github.com/tensorflow/tensorflow/commit/b1758bd553dfc2ebbfd07eec01d1e3254eda25b8#commitcomment-48080097.

I am trying to find a minimal reproducible test case here.