[PATCH] D10416: Use function attribute "arm-restrict-it"
Akira Hatanaka
ahatanak at gmail.com
Thu Jul 2 12:14:23 PDT 2015
ahatanak added a comment.
Are you suggesting adding FeatureRestrictedIT to the implied feature list of HasV8Ops? I thought about doing so but found out it would make it impossible to disable restrict-it when we target v8. Try compiling the following IR with -mattr=-restrict-it after adding FeatureRestrictedIT to the implied feature list:
$ cat f1.ll
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv8--linux-gnueabi"
define void @test_inlineasm() {
entry:
tail call void asm sideeffect "hlt #64", ""()
ret void
}
$ llc f1.ll -o - -mattr=-restrict-it
<inline asm>:1:2: error: instruction requires: armv8
hlt #64
^
LLVM ERROR: Error parsing inline asm
This fails because disabling restrict-it transitively disables HasV8Ops too (see function ClearImpliedBits in SubtargetFeature.cpp).
If I compile the IR with trunk's llc with command line option -arm-no-restrict-it, it compiles without any errors.
$ llc f1.ll -o - -arm-no-restrict-it
Do we need the capability to turn off disable restrict-it when targeting armv8? I was assuming we do need it although I wasn't sure why users would want to do that.
http://reviews.llvm.org/D10416
More information about the llvm-commits
mailing list