[PATCH] D91753: [GlobalISel] Add an isExtendedTrueVal helper.
Amara Emerson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 20 12:05:53 PST 2020
aemerson added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/Utils.cpp:746
+ if (ExtTy == S1)
+ return Val == 1;
+ switch (TLI.getBooleanContents(ExtTy.isVector(), IsFP)) {
----------------
paquette wrote:
> aemerson wrote:
> > Not saying this is wrong, but what's the rationale here for Val needing to be exactly 1 for s1? If The type is s1 then isn't either -1 or 1 equivalently true?
> I think that's very philosophical, but I guess I'm fine either way?
>
> I could believe that there's no meaningful distinction between 1 and -1 in 1-bit world.
I guess it depends on what the contract is for this function when the type size is < 64 bits. I know that if you get the constant value from a G_CONSTANT i1 true then it ends up as a -1 int64_t, so passing to this function would return false. Maybe we should mask off the upper bits on entry?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91753/new/
https://reviews.llvm.org/D91753
More information about the llvm-commits
mailing list