diff options
author | Craig Topper <craig.topper@sifive.com> | 2025-02-17 20:26:05 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-17 20:26:05 -0800 |
commit | ef9f0b3c414a5d55e694829514d7b2ff8736d3c3 (patch) | |
tree | 21d8f77aa8905e1787345b4d357989b5794684f5 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | c5def84ca4a1aa08333a0428bc453ea901139eca (diff) | |
download | llvm-ef9f0b3c414a5d55e694829514d7b2ff8736d3c3.zip llvm-ef9f0b3c414a5d55e694829514d7b2ff8736d3c3.tar.gz llvm-ef9f0b3c414a5d55e694829514d7b2ff8736d3c3.tar.bz2 |
[DAGCombiner] Don't peek through truncates of shift amounts in takeInexpensiveLog2. (#126957)
Shift amounts in SelectionDAG don't have to match the result type
of the shift. SelectionDAGBuilder will aggressively truncate shift
amounts to the target's preferred type. This may result in a zero extend
that existed in IR being removed.
If we look through a truncate here, we can't guarantee the upper bits
of the truncate input are zero. There may have been a zext that was
removed. Unfortunately, this regresses tests where no truncate was
involved. The only way I can think to fix this is to add an assertzext
when SelectionDAGBuilder truncates a shift amount or remove the
early truncation of shift amounts from SelectionDAGBuilder all together.
Fixes #126889.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions