Closed Quuxplusone closed 4 years ago
Attached main.f.ll
(2519 bytes, text/plain): reduced test case (main with inlined functions)
(In reply to Jonas Paulsson from comment #0)
> (*) adjustSubwordCmp() is converting this to a zext load. I suspect this
> check to not be sufficient:
>
> if (uint64_t(SignedValue) + (uint64_t(1) << (NumBits - 1)) > Mask)
> return;
>
> NumBits is 8, but the load is sign-extending from i1.
>
> I tried commenting out adjustSubwordCmp() but the sign extension of the i1
> by the load is still altered and lost. Not sure exactly what is going wrong
> here...
So, first of all, you're right that adjustSubwordCmp should not handle i1 loads
at all. There is never any benefit of using CLI or the like for booleans.
NumBits is 8 because it uses getStoreSizeInBits. This probably should check
getValueSizeInBits instead (or in addition) to ensure the routine doesn't do
anything for i1 loads.
But of course commenting out should have the same effect, so I guess the next
step would be to figure out what code is now replacing the load instead. What
I would have expected an i1 load and test to be converted to is a TM.
Patch at https://reviews.llvm.org/D78187.
036242b
main.f.ll
(2519 bytes, text/plain)