[llvm] [GlobalIsel] Canonicalize G_FCMP (PR #108891)
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 16 23:32:18 PDT 2024
aemerson wrote:
> I remember there was a discussion on this topic. IR is well formed and it should work as expected.
>
> const(i128) = G_ZEXT G_CONSTANT i64
>
> We have an i64 G_CONSTANT and zext it into the i128 const register.
Right but is that really what we want by default? What kind of guarantees does the GIConstant API promise about these cases? Naively a user would assume that if they give a VReg with a s64 type, they expect an APInt of 64bits to be returned if it's a constant, not a G_CONSTANT i8. You could imagine a scenario where the result of this is then used to build another constant of the wrong type resulting in crashes or worse.
https://github.com/llvm/llvm-project/pull/108891
More information about the llvm-commits
mailing list