[PATCH] D122220: [InlineAsm] Add support for address operands ("p").
Xiang Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 00:29:01 PDT 2022
xiangzhangllvm added a comment.
In my eye, the reason we need the "p" is Front End miss handle the constrain "*", so the "m" and "*m" have the same action at qWvod14G9 <https://godbolt.org/z/qWvod14G9>
(both isIndirect)
In IR level the constrain "p" is equal with "m" (TargetLowering::C_Memory + !isIndirect)
================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:4838
// If this asm operand is our Value*, and if it isn't an indirect memory
- // operand, we can't fold it!
+ // operand, we can't fold it! TODO: Also handle C_Address?
if (OpInfo.CallOperandVal == OpVal &&
----------------
I think C_Address the should return false. It is direct mem (!OpInfo.isIndirect). So no need change here.
================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:5621
+ // TODO: Also handle C_Address?
if (OpInfo.ConstraintType == TargetLowering::C_Memory &&
----------------
I think we can handle the C_Address.
As the comment ahead optimizeMemoryInst, this is used to
"Sink addressing mode computation immediate before MemoryInst if doing so
can be done without increasing register pressure."
Anyway that is not a big problem.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122220/new/
https://reviews.llvm.org/D122220
More information about the llvm-commits
mailing list