diff options
| author | Wenju He <wenju.he@intel.com> | 2025-10-28 09:01:50 +0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-28 09:01:50 +0800 | 
| commit | 45b1bcfa26a40b189f34530eb3a2c8490c15965b (patch) | |
| tree | f089fdd9a1219bebeaf1fad3b20ec2d7f8c903c3 /llvm/unittests/DebugInfo/LogicalView/SelectElementsTest.cpp | |
| parent | 61e3c84f6c526ecadaceef3a40f8f5d1910544d4 (diff) | |
| download | llvm-45b1bcfa26a40b189f34530eb3a2c8490c15965b.zip llvm-45b1bcfa26a40b189f34530eb3a2c8490c15965b.tar.gz llvm-45b1bcfa26a40b189f34530eb3a2c8490c15965b.tar.bz2 | |
[Instcombine] Avoid widening trunc+sext to trunc+shl+ashr when not profitable (#160483)
Skip the transform that replaces:
  %a = trunc i64 %x to i16
  %b = sext i16 %a to i32
with
  %a = trunc i64 %x to i32
  %b = shl i32 %a, 16
  %c = ashr exact i32 %b, 16
when (pre-trunc) source type is wider than the final destination type.
Modern architectures typically have efficient sign-extend instruction.
It is preferable to preserve the sext for this case.
Resolves #116019
Also fold sext(trunc nsw) to trunc nsw when narrowing source.
Diffstat (limited to 'llvm/unittests/DebugInfo/LogicalView/SelectElementsTest.cpp')
0 files changed, 0 insertions, 0 deletions
