Invalid base register with fast-isel

Ulrich Weigand Ulrich.Weigand at de.ibm.com
Mon Jun 23 05:57:22 PDT 2014



Hi Hal,

I've run into a bug where current LLVM at -O0 (with fast-isel) generated
invalid code like:

        ld 0, 20936(1)                  # 8-byte Folded Reload
        stw 12, 10348(0)
        stw 12, 10344(0)

This happens (at the moment -- register allocation problems tend to be
fragile) with the following .ll code:
(See attached file: nullbaseregbug.ll)

For some reason, the underlying vreg was allocated as G8RC instead of
G8RC_NOX0.   That vreg came originally from
PPCRegisterInfo::materializeFrameBaseRegister.  Changing the register class
there (along the lines of the attached patch) seems to fix the problem for
me, but I'm not really sure whether this is right solution.   How is
register class selection supposed to work with fast-isel?   Isn't the
presence of the vreg inside an address supposed to be enough to ensure use
of the G8RC_NOX0 class?
(See attached file: diff-llvm-fix-fastiselreg)


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand | Phone: +49-7031/16-3727
  STSM, GNU/Linux compilers and toolchain
  IBM Deutschland Research & Development GmbH
  Vorsitzende des Aufsichtsrats: Martina Koederitz | Geschäftsführung: Dirk
Wittkopp
  Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht
Stuttgart, HRB 243294
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nullbaseregbug.ll
Type: application/octet-stream
Size: 24029 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140623/cb6f2238/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff-llvm-fix-fastiselreg
Type: application/octet-stream
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140623/cb6f2238/attachment-0001.obj>


More information about the llvm-commits mailing list