aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Basic/FileManagerTest.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-09-01 12:11:37 -0700
committerCraig Topper <craig.topper@sifive.com>2021-09-01 12:37:52 -0700
commitccbb4c8b4ffd00588f0c21c7e5208bf210b26a53 (patch)
tree8033a131e4ccf421cd6079ed92be5e8febcb7987 /clang/unittests/Basic/FileManagerTest.cpp
parentb0fdbadf9f099e42bd2185ed32211b2d73cb2f58 (diff)
downloadllvm-ccbb4c8b4ffd00588f0c21c7e5208bf210b26a53.zip
llvm-ccbb4c8b4ffd00588f0c21c7e5208bf210b26a53.tar.gz
llvm-ccbb4c8b4ffd00588f0c21c7e5208bf210b26a53.tar.bz2
[RISCV] Fold (RISCVISD::SELECT_CC X, Y, CC, Z, Z) -> Z.
If the true and false values are the same, we don't need a SELECT_CC. This would normally be folded before a select is legalized to select_cc. The test case exploits the late legalization of vscale to trigger a case where they become identical after legalization. This works around an issue found on a test case in D107957. In that case the true/false values were both eventually 0 and the select was used by a vector AVL operand. The select_cc got expanded to control flow and a phi, but the phi inputs were both copies from X0. MachineIR optimizations simplified this to a single copy from X0 going into the vector instruction. This became the input of a vsetvli after vsetvli insertion. Then register coalescing folded the copy into the vsetvli. X0 as the source of a vsetvli is a special encoding and should not be created by coalesing. We need to fix our vsetvli handling to make sure this can never happen any other way, but removing the unneeded select is still a worthwhile optimization.
Diffstat (limited to 'clang/unittests/Basic/FileManagerTest.cpp')
0 files changed, 0 insertions, 0 deletions