================
@@ -6234,6 +6234,42 @@ unsigned
TargetLowering::AsmOperandInfo::getMatchedOperand() const {
return atoi(ConstraintCode.c_str());
}
+/// Return true if \p OpInfo is an "rm" operand that should prefer a register,
+/// leaving the register allocator to fold it to a stack slot if it runs out of
+/// registers (see AsmOperandInfo::MayFoldRegister).
+static bool
+shouldPreferFoldableRegister(const TargetLowering &TLI,
+ const TargetRegisterInfo *TRI,
+ const TargetLowering::AsmOperandInfo &OpInfo) {
+ // Codes stays empty for a constraint with alternatives ("r|m") until one is
+ // selected, so this only ever matches a plain "rm".
+ if (OpInfo.Codes.size() != 2 || !is_contained(OpInfo.Codes, "r") ||
+ !is_contained(OpInfo.Codes, "m"))
----------------
nickdesaulniers wrote:
This doesn't look right to me.
"g" is shorthand for "imr" (or as I like to think of it "I don't give a
shit")(expanded in the front end). This is pretty common IMO.
https://godbolt.org/z/ddPbTGsbY
https://github.com/llvm/llvm-project/pull/229632
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits