aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-12-17 13:49:15 -0500
committerSanjay Patel <spatel@rotateright.com>2019-12-17 13:49:15 -0500
commit6a77e369755e59b92ac5b689a010bd0796810e35 (patch)
tree6cfd0f7bcdeb784036fff1f580171f5a1965395a /clang/lib/Frontend/CompilerInvocation.cpp
parent5b0251da1c7aeaa641955974e7961e1fb07af9e0 (diff)
downloadllvm-6a77e369755e59b92ac5b689a010bd0796810e35.zip
llvm-6a77e369755e59b92ac5b689a010bd0796810e35.tar.gz
llvm-6a77e369755e59b92ac5b689a010bd0796810e35.tar.bz2
[SDAG] adjust isNegatibleForFree calculation to avoid crashing
This is an alternate fix for the bug discussed in D70595. This also includes minimal tests for other in-tree targets to show the problem more generally. We check the number of uses as a predicate for whether some value is free to negate, but that use count can change as we rewrite the expression in getNegatedExpression(). So something that was marked free to negate during the cost evaluation phase becomes not free to negate during the rewrite phase (or the inverse - something that was not free becomes free). This can lead to a crash/assert because we expect that everything in an expression that is negatible to be handled in the corresponding code within getNegatedExpression(). This patch adds a hack to work-around the case where we probably no longer detect that either multiply operand of an FMA isNegatibleForFree which is assumed to be true when we started rewriting the expression. Differential Revision: https://reviews.llvm.org/D70975
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions