[llvm] [CHERI] Refine LoopIdiomRecognize handling of non-integral pointers. (PR #189402)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 12:11:31 PDT 2026
================
@@ -472,9 +472,10 @@ LoopIdiomRecognize::isLegalStore(StoreInst *SI) {
Value *StorePtr = SI->getPointerOperand();
// Don't convert stores of non-integral pointer types to memsets (which stores
- // integers).
- if (DL->isNonIntegralPointerType(StoredVal->getType()->getScalarType()))
- return LegalStoreKind::None;
+ // integers), except for null pointers which are an exception.
+ bool NonIntegralPtrStore =
+ DL->isNonIntegralPointerType(StoredVal->getType()->getScalarType()) &&
----------------
nikic wrote:
We should also replace the isNonIntegralPointerType() check with one for external state. Pointers with (non-external) metadata bits should be completely fine for these transforms.
https://github.com/llvm/llvm-project/pull/189402
More information about the llvm-commits
mailing list