[all-commits] [llvm/llvm-project] 6726c9: [AArch64] Fix tryMergeAdjacentSTG function in Prol...
Karthika Devi C via All-commits
all-commits at lists.llvm.org
Tue Nov 14 14:43:48 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6726c99f8893c4a7bce00059416cb462237c64a0
https://github.com/llvm/llvm-project/commit/6726c99f8893c4a7bce00059416cb462237c64a0
Author: Karthika Devi C <quic_kartc at quicinc.com>
Date: 2023-11-14 (Tue, 14 Nov 2023)
Changed paths:
M llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
M llvm/test/CodeGen/AArch64/settag-merge.ll
Log Message:
-----------
[AArch64] Fix tryMergeAdjacentSTG function in PrologEpilog pass (#68873)
The tryMergeAdjacentSTG function tries to merge multiple
stg/st2g/stg_loop instructions. It doesn't verify the liveness of NZCV
flag before moving around STGloop which also alters NZCV flags. This was
not issue before the patch 5e612bc as these stack tag stores does not
alter the NZCV flags. But after the change, this merge function leads to
miscompilation because of control flow change in instructions. Added the
check to to see if the first instruction after insert point reads or
writes to NZCV flag and it's liveout state. This check happens after the
filling of merge list just before merge and bails out if necessary.
More information about the All-commits
mailing list