[PATCH] D32203: [SROA] Add support for non-integral pointers

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 20:50:45 PDT 2017


chandlerc requested changes to this revision.
chandlerc added a comment.
This revision now requires changes to proceed.

relatively minor stuff here



================
Comment at: lib/Transforms/Scalar/SROA.cpp:1640-1641
+
+    return (NewTy->isIntegerTy() && !DL.isNonIntegralPointerType(OldTy)) ||
+           (OldTy->isIntegerTy() && !DL.isNonIntegralPointerType(NewTy));
   }
----------------
I think these need to be in separate tests with comments, otherwise its too confusing. I thought at first this was a bug because we did *`NewTy`*`->isIntegerTy()` and `isNonIntegralPointerType(`*`OldTy`*`)`... But I think that is actually correct?

A comment here saying "if we can convert from pointer to integer" and then "the reverse conversion from integer to pointer" on two separate tests would be easier to read I think.


================
Comment at: test/Transforms/SROA/non-integral-pointers.ll:1-4
+; RUN: opt -sroa -S < %s | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128-ni:4"
+target triple = "x86_64-unknown-linux-gnu"
----------------
Comment to help the reader out by explaining what this is testing and where this shows up in the datalayout?


https://reviews.llvm.org/D32203





More information about the llvm-commits mailing list