aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2024-03-13 13:15:09 +0100
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2024-04-26 13:41:21 +0200
commit73472c5996716cda0dbb3ddb788304e0e7e6a323 (patch)
tree4eed6e28ab47252592ea7250fd3447a11f9ee2a3 /llvm/lib/Transforms/Utils/CloneFunction.cpp
parent431be8626696da6059eee26b9a14e1dc9fc0c37f (diff)
downloadllvm-73472c5996716cda0dbb3ddb788304e0e7e6a323.zip
llvm-73472c5996716cda0dbb3ddb788304e0e7e6a323.tar.gz
llvm-73472c5996716cda0dbb3ddb788304e0e7e6a323.tar.bz2
[SelectionDAG] Treat CopyFromReg as freezing the value (#85932)
The description of CopyFromReg in ISDOpcodes.h says that the input valus is defined outside the scope of the current SelectionDAG. I think that means that we basically can treat it as a FREEZE in the sense that it can be seen as neither being undef nor poison. Being able to fold freeze(CopyFromReg) into CopyFromReg seems useful to avoid regressions if we start to introduce freeze instruction in DAGCombiner/foldBoolSelectToLogic, e.g. to solve https://github.com/llvm/llvm-project/issues/84653 Things _not_ dealt with in this patch: - Depending on calling convention an input argument can be passed also on the stack and not in a register. If it is allowed to treat an argument received in a register as not being poison, then I think we want to treat arguments received on the stack the same way. But then we need to attribute load instructions, or add explicit FREEZE when lowering formal arguments. - A common pattern is that there is an AssertZext or AssertSext just after CopyFromReg. I think that if we treat CopyFromReg as never being poison, then it should be allowed to fold (freeze(AssertZext(CopyFromReg))) -> AssertZext(CopyFromReg))
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
0 files changed, 0 insertions, 0 deletions