
As of rev ea222be0d, LLVMs assembler will actually try to honour the "fill value" part of p2align directives. X86 printed these as 0x90, which isn't actually what it wanted: we want multi-byte nops for .text padding. Compiling via a textual assembly file produces single-byte nop padding since ea222be0d but the built-in assembler will produce multi-byte nops. This divergent behaviour is undesirable. To fix: don't set the byte padding field for x86, which allows the assembler to pick multi-byte nops. Test that we get the same multi-byte padding when compiled via textual assembly or directly to object file. Added same-align-bytes-with-llasm-llobj.ll to that effect, updated numerous other tests to not contain check-lines for the explicit padding.
35 lines
1.1 KiB
LLVM
35 lines
1.1 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=i386-pc-linux -mcpu=corei7 | FileCheck %s
|
|
|
|
define i64 @atomicSub(ptr %a, i64 %b) nounwind {
|
|
; CHECK-LABEL: atomicSub:
|
|
; CHECK: # %bb.0: # %entry
|
|
; CHECK-NEXT: pushl %ebp
|
|
; CHECK-NEXT: pushl %ebx
|
|
; CHECK-NEXT: pushl %edi
|
|
; CHECK-NEXT: pushl %esi
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %esi
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %edi
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ebp
|
|
; CHECK-NEXT: movl (%ebp), %eax
|
|
; CHECK-NEXT: movl 4(%ebp), %edx
|
|
; CHECK-NEXT: .p2align 4
|
|
; CHECK-NEXT: .LBB0_1: # %atomicrmw.start
|
|
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
|
|
; CHECK-NEXT: movl %eax, %ebx
|
|
; CHECK-NEXT: subl %edi, %ebx
|
|
; CHECK-NEXT: movl %edx, %ecx
|
|
; CHECK-NEXT: sbbl %esi, %ecx
|
|
; CHECK-NEXT: lock cmpxchg8b (%ebp)
|
|
; CHECK-NEXT: jne .LBB0_1
|
|
; CHECK-NEXT: # %bb.2: # %atomicrmw.end
|
|
; CHECK-NEXT: popl %esi
|
|
; CHECK-NEXT: popl %edi
|
|
; CHECK-NEXT: popl %ebx
|
|
; CHECK-NEXT: popl %ebp
|
|
; CHECK-NEXT: retl
|
|
entry:
|
|
%0 = atomicrmw sub ptr %a, i64 %b seq_cst
|
|
ret i64 %0
|
|
}
|