[PATCH] D46315: [RegUsageInfoCollector] Fix handling of callee saved registers with CSR optimization.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 1 07:38:27 PDT 2018


jonpa created this revision.
jonpa added reviewers: kbarton, vivekvpandya.

I saw a test case on SystemZ, where Target needed to save and restore the return register (and therefore also the SP), but those registers were missing from the regmask on the call to that function (in other words they were "not preserved"). This is wrong.

Currently, the set of clobbered physregs are first built, and then the callee saved regs are added back as preserved if the CSROpt did not take effect. This misses the registers that the target still had to save.

This patch instead first checks which registers the target actually decided to save, and then checks against this set during iteration over the target registers.


https://reviews.llvm.org/D46315

Files:
  lib/CodeGen/RegUsageInfoCollector.cpp
  test/CodeGen/SystemZ/ipra-04.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46315.144715.patch
Type: text/x-patch
Size: 4085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180501/67d19eaf/attachment.bin>


More information about the llvm-commits mailing list