Skip to content

Commit

Permalink
Accept 128 generation as accepted for now
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelesko committed Jan 23, 2025
1 parent 445ae1d commit d0fe9e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions llvm_passes/HipPromoteInts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
using namespace llvm;

bool HipPromoteIntsPass::isStandardBitWidth(unsigned BitWidth) {
return BitWidth == 1 || BitWidth == 8 || BitWidth == 16 || BitWidth == 32 || BitWidth == 64;
// TODO: 128 is not a standard bit width, will handle later as it's more complex than simply promoting
return BitWidth == 1 || BitWidth == 8 || BitWidth == 16 || BitWidth == 32 || BitWidth == 64 || BitWidth == 128;
}

unsigned HipPromoteIntsPass::getPromotedBitWidth(unsigned Original) {
Expand Down Expand Up @@ -250,7 +251,8 @@ PreservedAnalyses HipPromoteIntsPass::run(Module &M, ModuleAnalysisManager &AM)

if (auto *IntTy = dyn_cast<IntegerType>(I->getType())) {
if (!isStandardBitWidth(IntTy->getBitWidth())) {
Type *PromotedType = Type::getInt64Ty(M.getContext());
unsigned PromotedBitWidth = getPromotedBitWidth(IntTy->getBitWidth());
Type *PromotedType = Type::getIntNTy(M.getContext(), PromotedBitWidth);

SmallVector<Replacement, 16> Replacements;
SmallDenseMap<Value*, Value*> PromotedValues;
Expand Down

0 comments on commit d0fe9e6

Please sign in to comment.