[PATCH] D139911: [InstCombine][WIP] Explicitly disable simplifyIntToPtrRoundTripCast for vectors.

Pirama Arumuga Nainar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 23:07:28 PST 2022


pirama added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:376
+  Type *CastTy = IntToPtr->getDestTy();
+  if (!CastTy->isVectorTy() && DL.getPointerTypeSizeInBits(CastTy) ==
+                                   DL.getTypeSizeInBits(IntToPtr->getSrcTy())) {
----------------
Would the control flow be clearer with:

```
if (CastTy->isVectorTy())
  return nullptr;
if (DL.get...)
```
?


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:377
+  if (!CastTy->isVectorTy() && DL.getPointerTypeSizeInBits(CastTy) ==
+                                   DL.getTypeSizeInBits(IntToPtr->getSrcTy())) {
     auto *PtrToInt = dyn_cast<PtrToIntInst>(IntToPtr->getOperand(0));
----------------
Is the `>>` a tab or misalignment?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139911/new/

https://reviews.llvm.org/D139911



More information about the llvm-commits mailing list