2018-05-06 05:19:59 +08:00
|
|
|
# RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s
|
2017-10-07 03:24:15 +08:00
|
|
|
--- |
|
|
|
|
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
|
|
|
|
target triple = "aarch64--"
|
|
|
|
|
|
|
|
define void @test_anyext_crash() {
|
|
|
|
entry:
|
|
|
|
br label %block2
|
|
|
|
|
|
|
|
block2:
|
|
|
|
%0 = trunc i16 0 to i8
|
|
|
|
%1 = uitofp i8 %0 to double
|
|
|
|
br label %block2
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_anyext_crash
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 4
|
2017-10-07 03:24:15 +08:00
|
|
|
legalized: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _, preferred-register: '' }
|
|
|
|
- { id: 1, class: _, preferred-register: '' }
|
|
|
|
- { id: 2, class: _, preferred-register: '' }
|
|
|
|
body: |
|
|
|
|
bb.1:
|
|
|
|
; Check we don't crash due to trying to legalize a dead instruction.
|
|
|
|
; CHECK-LABEL: test_anyext_crash
|
|
|
|
; CHECK-LABEL: bb.1:
|
|
|
|
successors: %bb.2
|
|
|
|
|
|
|
|
%0(s16) = G_CONSTANT i16 0
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
successors: %bb.2
|
|
|
|
|
|
|
|
%1(s8) = G_TRUNC %0(s16)
|
|
|
|
%2(s64) = G_UITOFP %1(s8)
|
|
|
|
G_BR %bb.2
|
|
|
|
|
|
|
|
...
|