[llvm] [RegAlloc] Remove default restriction on non-trivial rematerialization (PR #159211)

Alexander Kornienko via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 08:48:41 PDT 2025


alexfh wrote:

> Thanks for reporting this @alexfh, a reproducer would definitely be much appreciated. In the meantime you can probably work around it in your target's `isRematerializableImpl` by appending something like
> 
> ```
> for (auto &MO : MI.uses())
>   if (MO.isReg() && MO.getReg() && MO.getReg().isVirtual())
>     return false;
> ```
> 
> Which should restore the previous behaviour.

Would it be possible to add a flag for this? We need a way to disable the new behavior for individual files without resorting to patching Clang.

> @preames Should we revert this now or wait until we get a reproducer first? I will be travelling tomorrow but feel free to go ahead and revert on my behalf if needed.

I'm not asking for a revert. I don't see a ton of evidence that this commit is problematic across the board. So far it was just a single file from a huge codebase.

https://github.com/llvm/llvm-project/pull/159211


More information about the llvm-commits mailing list