|
@@ -651,9 +651,24 @@ static void TranslatePreciseAttributeOnFunction(Function &F, Module &M) {
|
|
|
|
|
|
void DxilGenerationPass::TranslatePreciseAttribute() {
|
|
|
bool bIEEEStrict = m_pHLModule->GetHLOptions().bIEEEStrict;
|
|
|
- // If IEEE strict, everying is precise, don't need to mark it.
|
|
|
- if (bIEEEStrict)
|
|
|
+ if (bIEEEStrict) {
|
|
|
+ // mark precise on dxil operations.
|
|
|
+ Module &M = *m_pHLModule->GetModule();
|
|
|
+ for (Function &F : M) {
|
|
|
+ if (!hlsl::OP::IsDxilOpFunc(&F))
|
|
|
+ continue;
|
|
|
+ if (!F.getReturnType()->isFPOrFPVectorTy())
|
|
|
+ continue;
|
|
|
+ for (User *U : F.users()) {
|
|
|
+ Instruction *I = dyn_cast<Instruction>(U);
|
|
|
+ if (!I)
|
|
|
+ continue;
|
|
|
+ IRBuilder<> B(I);
|
|
|
+ HLModule::MarkPreciseAttributeOnValWithFunctionCall(I, B, M);
|
|
|
+ }
|
|
|
+ }
|
|
|
return;
|
|
|
+ }
|
|
|
|
|
|
Module &M = *m_pHLModule->GetModule();
|
|
|
// TODO: If not inline every function, for function has call site with precise
|