[llvm] [llvm][ARM]Add widen strings pass (PR #107120)
Nashe Mncube via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 2 06:21:42 PDT 2024
================
@@ -2029,6 +2031,109 @@ OptimizeFunctions(Module &M,
return Changed;
}
+static bool IsCharArray(Type *T) {
+ const unsigned int CHAR_BIT_SIZE = 8;
+ return T && T->isArrayTy() && T->getArrayElementType()->isIntegerTy() &&
+ T->getArrayElementType()->getIntegerBitWidth() == CHAR_BIT_SIZE;
----------------
nasherm wrote:
Yup. I've made the solution generic enough that it can theoretically pad any non-byte array. For ARM it will only attempt padding for arrays of integers. I think this *could* work for more complex types like structs but that might be out of the scope of the PR.
https://github.com/llvm/llvm-project/pull/107120
More information about the llvm-commits
mailing list