mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Generalize @llvm.ctlz, @llvm.cttz, and @llvm.ctpop to work on vectors of integers, and fix the one optimization pass that I'm aware of that needs updating for this. At least one current target, ARM NEON, can implement these operations on vectors directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -355,7 +355,9 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
case Intrinsic::cttz: {
|
||||
// If all bits below the first known one are known zero,
|
||||
// this value is constant.
|
||||
const IntegerType *IT = cast<IntegerType>(II->getArgOperand(0)->getType());
|
||||
const IntegerType *IT = dyn_cast<IntegerType>(II->getArgOperand(0)->getType());
|
||||
// FIXME: Try to simplify vectors of integers.
|
||||
if (!IT) break;
|
||||
uint32_t BitWidth = IT->getBitWidth();
|
||||
APInt KnownZero(BitWidth, 0);
|
||||
APInt KnownOne(BitWidth, 0);
|
||||
@@ -372,7 +374,9 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
case Intrinsic::ctlz: {
|
||||
// If all bits above the first known one are known zero,
|
||||
// this value is constant.
|
||||
const IntegerType *IT = cast<IntegerType>(II->getArgOperand(0)->getType());
|
||||
const IntegerType *IT = dyn_cast<IntegerType>(II->getArgOperand(0)->getType());
|
||||
// FIXME: Try to simplify vectors of integers.
|
||||
if (!IT) break;
|
||||
uint32_t BitWidth = IT->getBitWidth();
|
||||
APInt KnownZero(BitWidth, 0);
|
||||
APInt KnownOne(BitWidth, 0);
|
||||
|
Reference in New Issue
Block a user