[llvm] [TLI] Add isLegalNTStore/Load hook (PR #177936)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 10 01:14:26 PST 2026


================
@@ -477,6 +477,16 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
     return getTLI()->isLegalAddressingMode(DL, AM, Ty, AddrSpace, I);
   }
 
+  bool isLegalNTStore(Type *DataType, Align Alignment) const override {
+    const DataLayout &DL = this->getDataLayout();
+    return getTLI()->isLegalNTStore(DataType, Alignment, DL);
+  }
+
+  bool isLegalNTLoad(Type *DataType, Align Alignment) const override {
+    const DataLayout &DL = this->getDataLayout();
+    return getTLI()->isLegalNTLoad(DataType, Alignment, DL);
+  }
+
----------------
fhahn wrote:

Looking again at https://github.com/llvm/llvm-project/pull/177938, this is only isolated to AArch64. Do we still need to add a general TLI hook? Would it be sufficient to provide an overload `AArch64TargetTransformInfo::isLegalNTLoad` + separate `AArch64TargetLoweringInfo::isLegalNTLoad` without adding it to `llvm/include/llvm/CodeGen/TargetLowering.h`? 

https://github.com/llvm/llvm-project/pull/177936


More information about the llvm-commits mailing list