[llvm] [WebAssembly] avoid to enable explicit disabled feature (PR #80094)

Congcong Cai via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 20:44:18 PST 2024


HerrCai0907 wrote:

I have do some testing, for 
```llir
attributes #0 = { noinline nounwind optnone "target-features"="+bulk-memory," }
declare void @llvm.memset.p0.i32(ptr, i8, i32, i1)
define void @memset_alloca(i8 %val) {
  %a = alloca [100 x i8]
  call void @llvm.memset.p0.i32(ptr %a, i8 %val, i32 100, i1 false)
  ret void
}
```
If I use `llc ID/a.ll -mattr=+bulk-memory`, It will use `memory.fill` but if I use `llc ID/a.ll -mattr=-bulk-memory`, it won't use any bulk memory instruction and disable this feature although it declared in function.

Which means it is impossible to have conflict between functions' feature and global feature.

Related code is in `MCSubtargetInfo::InitMCProcessorInfo`, here feature in opinion will be apply.

https://github.com/llvm/llvm-project/pull/80094


More information about the llvm-commits mailing list