File tree Expand file tree Collapse file tree 2 files changed +436
-0
lines changed
test/Transforms/HardwareLoops Expand file tree Collapse file tree 2 files changed +436
-0
lines changed Original file line number Diff line number Diff line change @@ -503,6 +503,8 @@ Value *HardwareLoop::InitLoopCount() {
503
503
504
504
Value* HardwareLoop::InsertIterationSetup (Value *LoopCountInit) {
505
505
IRBuilder<> Builder (BeginBB->getTerminator ());
506
+ if (BeginBB->getParent ()->getAttributes ().hasFnAttr (Attribute::StrictFP))
507
+ Builder.setIsFPConstrained (true );
506
508
Type *Ty = LoopCountInit->getType ();
507
509
bool UsePhi = UsePHICounter || Opts.ForcePhi ;
508
510
Intrinsic::ID ID = UseLoopGuard
@@ -535,6 +537,9 @@ Value* HardwareLoop::InsertIterationSetup(Value *LoopCountInit) {
535
537
536
538
void HardwareLoop::InsertLoopDec () {
537
539
IRBuilder<> CondBuilder (ExitBranch);
540
+ if (ExitBranch->getParent ()->getParent ()->getAttributes ().hasFnAttr (
541
+ Attribute::StrictFP))
542
+ CondBuilder.setIsFPConstrained (true );
538
543
539
544
Function *DecFunc =
540
545
Intrinsic::getDeclaration (M, Intrinsic::loop_decrement,
@@ -557,6 +562,9 @@ void HardwareLoop::InsertLoopDec() {
557
562
558
563
Instruction* HardwareLoop::InsertLoopRegDec (Value *EltsRem) {
559
564
IRBuilder<> CondBuilder (ExitBranch);
565
+ if (ExitBranch->getParent ()->getParent ()->getAttributes ().hasFnAttr (
566
+ Attribute::StrictFP))
567
+ CondBuilder.setIsFPConstrained (true );
560
568
561
569
Function *DecFunc =
562
570
Intrinsic::getDeclaration (M, Intrinsic::loop_decrement_reg,
You can’t perform that action at this time.
0 commit comments