Skip to content

[DirectX] Pow optomized to Powi in frotend causes the backend to have an intrinsic it can't lower #135221

@farzonl

Description

@farzonl

The DirectX backend knows how to lower Intrinsic::pow. It does not know how to lower Intrinsic::powi

This optimization replaces Intrinsic::pow with Intrinsic::powi.

// powf(x, itofp(y)) -> powi(x, y)
if (AllowApprox && (isa<SIToFPInst>(Expo) || isa<UIToFPInst>(Expo))) {
if (Value *ExpoI = getIntToFPVal(Expo, B, TLI->getIntSize()))
return copyFlags(*Pow, createPowWithIntegerExponent(Base, ExpoI, M, B));
}

We need a change in the backend to handle Intrinsic::powi so we can legalize it to the right thing.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions