[PATCH] D51988: [PowerPC] Folding XForm to DForm loads requires alignment for some DForm loads.
    Qing Shan Zhang via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 12 18:49:08 PDT 2018
    
    
  
steven.zhang added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3069
+  if (ImmMO->isGlobal() && ImmMO->getGlobal()->getAlignment() < 4)
+    return false;
+
----------------
isImmElgibleForForwarding() will check if the ImmMO is elgible for forwarding. And it will check the alignment there according to the restriction with different instructions.
For your case, if the ImmMO is Global, isImmElgibleForForwarding() will return false if it is not the operand of ADDItocL. It covers your case.  This missing part is that, if it is global, we still need to check the alignment restriction. 
https://reviews.llvm.org/D51988
    
    
More information about the llvm-commits
mailing list