This patch enables debug info salvaging for truncating/extending ptr int conversions. The testcase uncovered a bug in adce, which is addressed separately.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This patch seems reasonable to me
llvm/lib/Transforms/Utils/Local.cpp | ||
---|---|---|
1924 | (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. |
llvm/lib/Transforms/Utils/Local.cpp | ||
---|---|---|
1924 | Interestingly, no! If the size is the same CI->isNoopCast(DL) will return true, even for ptrtoint/inttoptr. |
llvm/lib/Transforms/Utils/Local.cpp | ||
---|---|---|
1924 | Ahh i see, good catch! |
(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.