[llvm] [AMDGPU] Rematerialize scalar loads (PR #68778)
Piotr Sobczak via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 25 03:38:09 PDT 2023
================
@@ -108,7 +108,18 @@ static bool nodesHaveSameOperandValue(SDNode *N0, SDNode* N1, unsigned OpName) {
bool SIInstrInfo::isReallyTriviallyReMaterializable(
const MachineInstr &MI) const {
+
+ bool CanRemat = false;
if (isVOP1(MI) || isVOP2(MI) || isVOP3(MI) || isSDWA(MI) || isSALU(MI)) {
+ CanRemat = true;
+ } else if (isSMRD(MI)) {
+ CanRemat = !MI.memoperands_empty() &&
+ llvm::all_of(MI.memoperands(), [](const MachineMemOperand *MMO) {
+ return MMO->isLoad() && MMO->isInvariant();
+ });
+ }
+
+ if (CanRemat) {
----------------
piotrAMD wrote:
Done.
https://github.com/llvm/llvm-project/pull/68778
More information about the llvm-commits
mailing list