[llvm] [AMDGPU] Widen sub-dword constant loads with dword alignment to match SelectionDAG behavior (PR #184790)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 3 03:17:25 PDT 2026


================
@@ -517,20 +517,14 @@ bool AMDGPULateCodeGenPrepare::visitLoadInst(LoadInst &LI) {
   if (!isDWORDAligned(Base))
     return false;
----------------
arsenm wrote:

I think this function is kind of broken. It's not checking for dereferencability. This should be using isDereferenceableAndAlignedPointer instead of computeKnownBits for the alignment check. Can you add negative tests where the pointer isn't provably dereferenceable in the padding bytes 

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


More information about the llvm-commits mailing list