[PATCH] D73200: GlobalISel: Add computeKnownBitsForTargetInstr
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 23 02:10:43 PDT 2020
foad added inline comments.
================
Comment at: llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp:500-507
+ // Okay, we know that the sign bit in Mask is set. Use CLZ to determine
+ // the number of identical bits in the top of the input value.
+ Mask = ~Mask;
+ Mask <<= Mask.getBitWidth() - TyBits;
- // TODO: Handle target instructions
- // TODO: Fall back to known bits
- return 1;
+ // Return # leading zeros. We use 'min' here in case Val was zero before
+ // shifting. We don't want to return '64' as for an i32 "0".
----------------
I've simplified the SelectionDAG version of this code a bit in 7cdbf1ed4b94259a3aad2a7575e928fa61b0e57e.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73200/new/
https://reviews.llvm.org/D73200
More information about the llvm-commits
mailing list