This patch adds support for noundef arguments.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Has little impact on compilation time on average:
(unit:sec.) +-----------------------------------------------+---------+---------+----------+-------+---------+----------+ | | compile | | | link | | | +-----------------------------------------------+---------+---------+----------+-------+---------+----------+ | | base | noundef | slowdown | base | noundef | slowdown | | CTMark/7zip/7zip-benchmark.test | 89.55 | 89.45 | -0.11% | 46.86 | 46.87 | 0.04% | | CTMark/Bullet/bullet.test | 63.06 | 62.84 | -0.35% | 9.97 | 9.69 | -2.73% | | CTMark/ClamAV/clamscan.test | 26.89 | 26.88 | -0.05% | 24.91 | 25.01 | 0.40% | | CTMark/SPASS/SPASS.test | 26.17 | 26.08 | -0.36% | 19.68 | 19.70 | 0.10% | | CTMark/consumer-typeset/consumer-typeset.test | 19.69 | 19.63 | -0.28% | 18.44 | 18.56 | 0.63% | | CTMark/kimwitu++/kc.test | 26.48 | 26.50 | 0.06% | 14.59 | 14.34 | -1.76% | | CTMark/lencod/lencod.test | 34.46 | 34.42 | -0.13% | 38.37 | 38.63 | 0.67% | | CTMark/mafft/pairlocalalign.test | 16.20 | 16.17 | -0.18% | 8.65 | 8.64 | -0.11% | | CTMark/sqlite3/sqlite3.test | 24.59 | 24.51 | -0.33% | 24.52 | 24.52 | -0.02% | | CTMark/tramp3d-v4/tramp3d-v4.test | 49.26 | 49.16 | -0.21% | 35.74 | 35.71 | -0.09% | +-----------------------------------------------+---------+---------+----------+-------+---------+----------+
llvm/include/llvm/Analysis/ValueTracking.h | ||
---|---|---|
610 ↗ | (On Diff #277698) | Why do we need this parameter? Padding only matters for the stored representation of a struct. For SSA struct values, the padding cannot be accessed. |
llvm/lib/Analysis/ValueTracking.cpp | ||
4813 | Why are some of these checked outside the dyn_cast<Operator>(V) below? |
After this patch is accepted, I'll make a separate commit for tests so only diffs are updated.
llvm/include/llvm/Analysis/ValueTracking.h | ||
---|---|---|
610 ↗ | (On Diff #277698) | It is because freeze can take an aggregate value. |
This patch adds support for noundef arguments and looking through more operations.
Maybe make it multiple patches then?
llvm/include/llvm/Analysis/ValueTracking.h | ||
---|---|---|
610 ↗ | (On Diff #277698) | I don't think something like this can work under current IR semantics. Even if we take a simpler example like %v = freeze(load i1 %p); store %v, %q, the freeze will only freeze the i1 value, it does not do anything to the remaining 7 bits that are present in the store representation. It does make sure that a subsequent load i1 will not see undef/poison, but not that a load i8 won't. For the aggregate case, similarly, it does make sure that loading the same aggregate type will not have undef/poison (because padding does not matter for the SSA value), but does not make sure that loading an appropriately sized iN at the same location will not have undef/poison. |
Will split this patch into (1) noundef patch (2) use operator patch
llvm/include/llvm/Analysis/ValueTracking.h | ||
---|---|---|
610 ↗ | (On Diff #277698) | Okay, that makes sense. There is no way to remove the 7-bit undef value when storing i1 value. |
LG
llvm/lib/Analysis/ValueTracking.cpp | ||
---|---|---|
4770 | This comment seems a bit out of context now that the IgnorePadding flag is gone. |
This comment seems a bit out of context now that the IgnorePadding flag is gone.