Page MenuHomePhabricator

[Clang][CodeGen][RISCV] Fix hard float ABI test cases with empty struct
ClosedPublic

Authored by luismarques on Nov 11 2020, 8:27 AM.

Details

Summary

The code seemed not to account for the field 1 offset. This patch hopefully fixes that issue.

Diff Detail

Unit TestsFailed

TimeTest
40 msx64 windows > LLVM.CodeGen/XCore::threads.ll
Script: -- : 'RUN: at line 1'; c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\llc.exe -march=xcore < C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\CodeGen\XCore\threads.ll | c:\ws\w16c2-1\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16c2-1\llvm-project\premerge-checks\llvm\test\CodeGen\XCore\threads.ll

Event Timeline

luismarques created this revision.Nov 11 2020, 8:27 AM
luismarques requested review of this revision.Nov 11 2020, 8:27 AM

I *think* this is looking good, but I'd like a second pair of eyes from @jrtc27 as I know she's fixed bugs around this area recently too. We would like to have this ready for 11.0.1 if possible.

clang/lib/CodeGen/TargetInfo.cpp
10595

Please may you update this name to reflect what it really is - the offset of the *end* of Field1, rather than its size. This code is complex enough without confusing names. :)

Seems good other than additional comments regarding code clarity.

clang/lib/CodeGen/TargetInfo.cpp
10567

This NFC hunk definitely makes this clearer :)

10595

+1 to Field1End or similar

10596–10597

Swapping the order of the operands would be the more natural way to express this.

Address review feedback.

luismarques marked 3 inline comments as done.Dec 7 2020, 12:06 PM
jrtc27 accepted this revision.Dec 7 2020, 12:08 PM
This revision is now accepted and ready to land.Dec 7 2020, 12:08 PM
lenary accepted this revision.Dec 7 2020, 1:40 PM

LGTM! Please land these tonight so we can have them backported.

luismarques closed this revision.Dec 8 2020, 3:26 AM