Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent InvalidBitWidth Errors #963

Merged
merged 17 commits into from
Feb 6, 2025
Merged
2 changes: 1 addition & 1 deletion llvm_passes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ add_library(LLVMHipPasses MODULE HipPasses.cpp
HipPrintf.cpp HipGlobalVariables.cpp HipTextureLowering.cpp HipAbort.cpp
HipEmitLoweredNames.cpp HipWarps.cpp HipKernelArgSpiller.cpp
HipLowerZeroLengthArrays.cpp HipSanityChecks.cpp HipLowerSwitch.cpp
HipLowerMemset.cpp HipIGBADetector.cpp ${EXTRA_OBJS})
HipLowerMemset.cpp HipIGBADetector.cpp HipPromoteInts.cpp ${EXTRA_OBJS})

# If trying to recompile with LLVM unloaded, the inlcude path is not found
target_compile_options(LLVMHipDynMem PRIVATE -I/${LLVM_INCLUDE_DIRS})
Expand Down
4 changes: 4 additions & 0 deletions llvm_passes/HipPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "HipLowerSwitch.h"
#include "HipLowerMemset.h"
#include "HipIGBADetector.h"
#include "HipPromoteInts.h"

#include "llvm/IR/Module.h"
#include "llvm/Passes/PassBuilder.h"
Expand Down Expand Up @@ -99,6 +100,9 @@ class HipFixOpenCLMDPass : public PassInfoMixin<HipFixOpenCLMDPass> {
static void addFullLinkTimePasses(ModulePassManager &MPM) {
MPM.addPass(HipSanityChecksPass());

// Fix InvalidBitWidth errors due to non-standard integer types
MPM.addPass(HipPromoteIntsPass());

/// For extracting name expression to lowered name expressions (hiprtc).
MPM.addPass(HipEmitLoweredNamesPass());

Expand Down
Loading