[PATCH] D90760: [InstCombiner] Make LibCallSimplifier add extension attribute to ldexp arg.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 9 09:27:40 PST 2020


jonpa added a comment.

In D90760#2383035 <https://reviews.llvm.org/D90760#2383035>, @lebedev.ri wrote:

> In D90760#2383015 <https://reviews.llvm.org/D90760#2383015>, @jonpa wrote:
>
>>> So, can you try if the miscompile goes away if you manually annotate the @ldexp declaration in IR with said signext?
>>
>> It seems that it is enough to have either the signext on the call operand or in the declaration, for the extension to be emitted by the SystemZ backend.
>
> Great.
> So back to my original idea - can we simply annotate the `LibFunc_ldexp*`'s argument with `signext` attribute?
> @xbolva00 might be able to help.

Are we sure that this is generally acceptable despite the fact that clang emits the signext attribute in both places?

If so, I suppose we should do something like what is done in insertSinCosCall(), i.e. calling M->getOrInsertFunction() and build the call instead of calling emitBinaryFloatFnCall()? That doesn't seem simpler to me though than the current patch...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90760/new/

https://reviews.llvm.org/D90760



More information about the llvm-commits mailing list