Files
clang-p2996/llvm/test/CodeGen/X86/trunc-store.ll
Jeremy Morse e6bf48d110 [X86] Don't request 0x90 nop filling in p2align directives (#110134)
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.
2024-10-02 11:14:05 +01:00

57 lines
1.6 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s
; With optimization at O2 we actually get the legalized function optimized
; away through legalization and stack coloring, but check that we do all of
; that here and don't crash during legalization.
; Original program:
; typedef enum { A, B, C, D } P;
; struct { P x[2]; } a;
; void fn2();
; void fn1() {
; int b;
; unsigned c;
; for (;; c++) {
; fn2();
; unsigned n;
; for (; c; c++) {
; b = a.x[c] == A || a.x[c] == B || a.x[c] == D;
; if (b) n++;
; }
; if (n)
; for (;;)
; ;
; }
; }
define void @fn1(i64 %a0) {
; CHECK-LABEL: fn1:
; CHECK: # %bb.0: # %for.cond
; CHECK-NEXT: .p2align 4
; CHECK-NEXT: .LBB0_1: # %vector.body
; CHECK-NEXT: # =>This Inner Loop Header: Depth=1
; CHECK-NEXT: cmpq $8, %rdi
; CHECK-NEXT: jne .LBB0_1
; CHECK-NEXT: # %bb.2: # %middle.block
; CHECK-NEXT: retq
for.cond:
br label %vector.body
vector.body: ; preds = %vector.body, %for.cond
%x42 = bitcast <4 x i4> zeroinitializer to i16
%x43 = icmp ne i16 %x42, 0
%x44 = select i1 %x43, i32 undef, i32 0
%x72 = bitcast <4 x i1> zeroinitializer to i4
%x73 = icmp ne i4 %x72, 0
%x74 = select i1 %x73, i32 %x44, i32 undef
%x84 = select i1 undef, i32 undef, i32 %x74
%x88 = icmp eq i64 %a0, 8
br i1 %x88, label %middle.block, label %vector.body
middle.block: ; preds = %vector.body
%0 = select i1 undef, i32 undef, i32 %x84
ret void
}