aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2022-08-05 12:08:03 -0700
committerPhilip Reames <listmail@philipreames.com>2022-08-05 12:13:08 -0700
commit9a9848f4b95895ad97d3dc117f0a94773dc1607f (patch)
tree90a2243c732c5e15dd6f26df353173010c12dc3b /clang/lib/Basic/FileManager.cpp
parent99e50e583867ac35ace36f5da50b3a3ff7c51d2e (diff)
downloadllvm-9a9848f4b95895ad97d3dc117f0a94773dc1607f.zip
llvm-9a9848f4b95895ad97d3dc117f0a94773dc1607f.tar.gz
llvm-9a9848f4b95895ad97d3dc117f0a94773dc1607f.tar.bz2
[RISCVInsertVSETVLI] Remove an unsound optimization
This fixes a bug reported privately by @craig.topper. Here's an example which illustrates the problem: vsetivli a1, a0, e32, m1, ta, mu # both DefInfo and PrevInfo vsetivli a2, a1, e32, m4, ta, mu With the unsound result being: vsetivli a1, a0, e32, m1, ta, mu vsetivli a2, a0, e32, m4, ta, mu Consider the case where this is running on a machine with VLEN=512,. For this case, the VLMAXs are 16 and 64 respectively. Consider for a0 = 33. The correct result is: a1 = 16, and a2 = 16 After the unsound optimization: a1 = 16 and a2 = 33 This particular example used VLMAXs which differed by more than a power of two. With a difference of only one power of two, there's another form of this bug which involves the AVL < 2 x VLMAX special case, but that ones more complicated to construct as many examples turn out accidentally sound. This patch takes the approach of simply removing the unsound optimization, but there are multiple sound sub-cases of it. I plan to return to at least a couple of them, but figured it was cleaner to remove the unsound optimization (for ease of backporting), and then review the new optimizations on their own. Differential Revision: https://reviews.llvm.org/D131264
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
0 files changed, 0 insertions, 0 deletions