[PATCH] D45576: [RFC] Allow target to handle STRICT floating-point nodes

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 23 10:44:53 PDT 2018


hfinkel added a comment.

In https://reviews.llvm.org/D45576#1109764, @uweigand wrote:

> In https://reviews.llvm.org/D45576#1109697, @hfinkel wrote:
>
> > >> Ah, okay. That doesn't seem so bad. The fact that the number of times they're called can't be observable means, I think, that we only need to model the trapping behavior as writing (and not reading) inaccessible memory. This can't be removed or speculated, but otherwise shouldn't have undo optimization implications.
> > > 
> > > Correction: I mean writing to memory (the trap handler might write memory other than inaccessible memory (e.g., some global variable)). Anything that's escaped (trivially including globals) is fair game.
> >
> > I suppose that they also get to read memory (so long as they're not using it to keep ordering/count information). So the trap handlers are modeled as reading/writing arbitrary escaped memory. That, plus register dependencies, seems like it should be sufficient.
>
>
> So if I understand you correctly, you're suggesting (at the MI level) to mark trapping FP operations as mayLoad and mayStore instead of hasSideEffects (as the patch does originally)?
>
> That's probably OK, I think.  But this would still restrict the optimization possibilities quite a bit compared to now, so you still wouldn't want to enable it by default in non-strict FP mode, right?  In that case we're back to the question whether we need to duplicate all FP patterns or not.


That's correct. And, yes, we only want to do this in modes where we must.

To take a hint from the suggestion you relayed from Chris, how about we just add MMOs to these instructions, and then let mayLoad/mayStore look at optional MMOs when returning their answer? Maybe this lets us do what we want without duplicating all of the patterns?


Repository:
  rL LLVM

https://reviews.llvm.org/D45576





More information about the llvm-commits mailing list