Skip to content

Commit ba06835

Browse files
sdolendersys_zuul
authored andcommitted
Sync-change
Change-Id: I1854687d1a310f319718f8195848a241d6d22925
1 parent 0318595 commit ba06835

File tree

5 files changed

+2
-54
lines changed

5 files changed

+2
-54
lines changed

IGC/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
7373

7474
# ================================================ Flags ===============================================
7575

76-
7776
# Escapes text for regular expressions.
7877
#
7978
# @param retValName Name of variable placeholder where result will be returned.

IGC/Compiler/CISACodeGen/DriverInfo.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ namespace IGC
252252
/// Allow aggressive vector value aliasing
253253
virtual bool EnableVecAliasing() const { return false; }
254254

255-
/// Prevent MAD optimization if result used in Floor
256-
virtual bool PreventMadforRound() const { return false; }
257-
258255

259256

260257
};

IGC/Compiler/CISACodeGen/PatternMatchPass.cpp

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ namespace IGC
17971797
return I.getType()->isFloatingPointTy();
17981798
};
17991799

1800-
if (isFpMad(I) && m_ctx->getModuleMetaData()->isPrecise)
1800+
if (isFpMad(I) && (m_ctx->getModuleMetaData()->isPrecise || m_ctx->getModuleMetaData()->compOpt.disableMathRefactoring))
18011801
{
18021802
return false;
18031803
}
@@ -1819,12 +1819,6 @@ namespace IGC
18191819
return false;
18201820
}
18211821

1822-
bool preventMadForRound = false;
1823-
if (IGC_IS_FLAG_ENABLED(EnableMadRoundDepCheck) || m_ctx->m_DriverInfo.PreventMadforRound())
1824-
{
1825-
preventMadForRound = true;
1826-
}
1827-
18281822
bool found = false;
18291823
llvm::Value* sources[3];
18301824
e_modifier src_mod[3];
@@ -1906,47 +1900,6 @@ namespace IGC
19061900
return false;
19071901
}
19081902

1909-
if (found && preventMadForRound)
1910-
{
1911-
/*=============================================================================
1912-
This checks for pattern
1913-
1914-
mul x a b
1915-
add y x c
1916-
floor z y
1917-
1918-
----or---
1919-
1920-
mul x a b
1921-
add y x c
1922-
floor z abs(y)
1923-
1924-
If the case falls in either of the two cases, Mad optimisation is skipped because
1925-
small precision difference between Mul+add and Mad can be extrapolated by floor
1926-
(currently just enabled for floor operation, if required add for ceiling in future)
1927-
=============================================================================*/
1928-
1929-
for (auto iter = I.user_begin(); iter != I.user_end(); iter++)
1930-
{
1931-
if (IntrinsicInst * source = dyn_cast<IntrinsicInst>(*iter))
1932-
{
1933-
if (source->getIntrinsicID() == Intrinsic::fabs)
1934-
{
1935-
for (auto it = source->user_begin(); it != source->user_end(); it++)
1936-
{
1937-
IntrinsicInst* source_fabs = dyn_cast<IntrinsicInst>(*it);
1938-
if (source_fabs && source_fabs->getIntrinsicID() == Intrinsic::floor)
1939-
return false;
1940-
}
1941-
}
1942-
if (source->getIntrinsicID() == Intrinsic::floor)
1943-
{
1944-
return false;
1945-
}
1946-
}
1947-
}
1948-
}
1949-
19501903
if (found)
19511904
{
19521905
MadPattern* pattern = new (m_allocator) MadPattern();

IGC/common/MDFrameWork.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ namespace IGC
201201
bool UniformWGS = false;
202202
bool disableVertexComponentPacking = false;
203203
bool PreferBindlessImages = false;
204+
bool disableMathRefactoring = false;
204205
};
205206

206207
struct ComputeShaderInfo

IGC/common/igc_flags.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ DECLARE_IGC_REGKEY(DWORD, RetryManagerFirstStateId, 0, "For debugging pu
188188
DECLARE_IGC_REGKEY(bool, DisableSendSrcDstOverlapWA, false, "Disable Send Source/destination overlap WA which is enabled for GEN10/GEN11 and whenever Wddm2Svm is set in WATable")
189189
DECLARE_IGC_REGKEY(debugString, DisablePassToggles, 0, "Disable each IGC pass by setting the bit. HEXADECIMAL ONLY!. Ex: C0 is to disable pass 6 and pass 7.")
190190
DECLARE_IGC_REGKEY(bool, ForceStatelessForQueueT, true, "In OCL, force to use stateless memory to hold queue_t*. This is a legacy feature to be removed.")
191-
DECLARE_IGC_REGKEY(bool, EnableMadRoundDepCheck, false, "Enable Floor Dependency on Mad Check, Check was added since the floor was extrapolating the mad precision difference.")
192-
193191

194192
DECLARE_IGC_GROUP("Shader dumping")
195193
DECLARE_IGC_REGKEY(bool, EnableCosDump, false, "Enable cos dump")

0 commit comments

Comments
 (0)