[llvm] 6170272 - [AArch64][GlobalISel] Disallow vectors in convertPtrAddToAdd.

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 14:51:08 PST 2020


Author: Amara Emerson
Date: 2020-01-30T14:50:44-08:00
New Revision: 6170272ab9aeb4dee1cb212b88e74f0c2e4dad60

URL: https://github.com/llvm/llvm-project/commit/6170272ab9aeb4dee1cb212b88e74f0c2e4dad60
DIFF: https://github.com/llvm/llvm-project/commit/6170272ab9aeb4dee1cb212b88e74f0c2e4dad60.diff

LOG: [AArch64][GlobalISel] Disallow vectors in convertPtrAddToAdd.

Found by inspection, but there's no test for this yet because G_PTR_ADD is
currently illegal for vectors. I'll add the test at a later time when the
legalizer support has landed.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
index cf6ffcc753fa..cf3dc78ff505 100644
--- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
@@ -1399,6 +1399,10 @@ bool AArch64InstructionSelector::convertPtrAddToAdd(
   if (PtrTy.getAddressSpace() != 0)
     return false;
 
+  // Only do this for scalars for now.
+  if (PtrTy.isVector())
+    return false;
+
   MachineIRBuilder MIB(I);
   const LLT s64 = LLT::scalar(64);
   auto PtrToInt = MIB.buildPtrToInt(s64, AddOp1Reg);


        


More information about the llvm-commits mailing list