[PATCH] D110461: Add salvageDebugInfo support for ptrtoint / inttoptr with trunc/ext behavior

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 10:59:49 PDT 2021


aprantl added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:1924
+    unsigned FromTypeBitSize = FromType->getScalarSizeInBits();
     unsigned ToTypeBitSize = Type->getScalarSizeInBits();
 
----------------
myhsu wrote:
> (nit) Should we bail out if FromTypeBitSize and ToTypeBitSize are the same? Usually these two values are different for sext/zext/trunc but for inttoptr/ptrtoint it's pretty common that they have the same value.
Interestingly, no! If the size is the same `CI->isNoopCast(DL)` will return true, even for ptrtoint/inttoptr.


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

https://reviews.llvm.org/D110461



More information about the llvm-commits mailing list