Page MenuHomePhabricator

[llvm][PowerPC] Add missing support for 'I' asm template argument modifiers

Authored by tbaeder on Jun 9 2021, 8:44 AM.



I is already documented as being supported but was not implemented. Add the missing case for it and a test case.

This is after review in

Diff Detail

Event Timeline

tbaeder created this revision.Jun 9 2021, 8:44 AM
tbaeder requested review of this revision.Jun 9 2021, 8:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2021, 8:44 AM

I am sorry, my suggestion turned out to be wrong. I have suggested the fix in the original bug (and please add the IR for the motivating test case).

tbaeder updated this revision to Diff 351070.Jun 9 2021, 10:55 PM
tbaeder edited the summary of this revision. (Show Details)
nemanjai accepted this revision.Jun 10 2021, 3:09 AM

LGTM with a simplification to the test case.


We can simplify this test case and add checks rather than just expecting a successful execution. The entire test can be simplified to:

; NOTE: Assertions have been autogenerated by utils/
; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-- | FileCheck %s

define dso_local signext i32 @main(i32 signext %argc, i8** %argv) {
; CHECK-LABEL: main:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    stw 3, -4(1)
; CHECK-NEXT:    li 3, 0
; CHECK-NEXT:    addi 4, 1, -4
; CHECK-NEXT:    .ascii "-1@0(4)"
; CHECK-NEXT:    .byte 0
; CHECK-NEXT:    blr
  call void asm sideeffect " .asciz \22${0:n}@${1:I}$1\22 ", "n,nZr"(i32 1, i32 %argc)
  ret i32 0
This revision is now accepted and ready to land.Jun 10 2021, 3:09 AM
tbaeder updated this revision to Diff 351112.Jun 10 2021, 3:32 AM
This revision was landed with ongoing or failed builds.Jun 10 2021, 4:08 AM
This revision was automatically updated to reflect the committed changes.