This is an archive of the discontinued LLVM Phabricator instance.

InstSimplify: Add constant folding/simplify for ldexp intrinsic
ClosedPublic

Authored by arsenm on May 21 2020, 10:33 AM.

Details

Summary

Not sure about the policy on target intrinsics in InstructionSimplify
since there don't seem to be any others. However we do in
ConstantFolding and instcombine already. Some of the existing AMDGPU
intrinsic simplifications are in instcombine that really belong here
since they don't introduce new instructions.

I also noticed we seem to now be interpreting strictfp attributes on intrinsic call sites,
so try to handle that.

Diff Detail

Event Timeline

arsenm created this revision.May 21 2020, 10:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2020, 10:33 AM

There was general agreement that even the blob in instcombine is a mistake:
http://lists.llvm.org/pipermail/llvm-dev/2016-July/102317.html
...but the proposed cleanup has not happened yet. cc @bogner @compnerd @mehdi_amini @echristo

So I think it would be better to keep all of this in instcombine for now. At least that way the mess is not spread across multiple passes any more than now.

arsenm updated this revision to Diff 265651.May 21 2020, 5:31 PM

Move InstSimplify part to InstCombine

foad accepted this revision.May 22 2020, 2:59 AM
This revision is now accepted and ready to land.May 22 2020, 2:59 AM