Revert "ac: reassociate FP expressions for inexact instructions for radeonsi"

This reverts commit cf2f3c2753.

It breaks shadows in Unigine Superposition.

Fixes: cf2f3c2753

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4837>
This commit is contained in:
Marek Olšák
2020-04-30 03:57:50 -04:00
parent 5f01869f74
commit b97cc41aa2
-9
View File
@@ -101,11 +101,6 @@ LLVMBuilderRef ac_create_builder(LLVMContextRef ctx,
*/
flags.setAllowContract(); /* contract */
/* Allow reassociation transformations for floating-point
* instructions. This may dramatically change results.
*/
flags.setAllowReassoc(); /* reassoc */
llvm::unwrap(builder)->setFastMathFlags(flags);
break;
}
@@ -118,13 +113,11 @@ bool ac_disable_inexact_math(LLVMBuilderRef builder)
{
auto *b = llvm::unwrap(builder);
llvm::FastMathFlags flags = b->getFastMathFlags();
assert(flags.allowContract() == flags.allowReassoc());
if (!flags.allowContract())
return false;
flags.setAllowContract(false);
flags.setAllowReassoc(false);
b->setFastMathFlags(flags);
return true;
}
@@ -133,13 +126,11 @@ void ac_restore_inexact_math(LLVMBuilderRef builder, bool value)
{
auto *b = llvm::unwrap(builder);
llvm::FastMathFlags flags = b->getFastMathFlags();
assert(flags.allowContract() == flags.allowReassoc());
if (flags.allowContract() == value)
return;
flags.setAllowContract(value);
flags.setAllowReassoc(value);
b->setFastMathFlags(flags);
}